Public projects 1

Arduino Controlled Artificial Candle Lights

Project tutorial by Mattias Larsson

  • 15,398 views
  • 14 comments
  • 42 respects

Toolbox 3


Replicated projects 0

 Mattias Larsson hasn't replicated any projects yet.

I Let Everyone on the Internet Control My X-Mas Decoration 2

Project showcase by Tobi_Lxtr and wotanzero

  • 1,750 views
  • 2 comments
  • 8 respects

Roman Numeral Converter for Arduino

Project tutorial by Alfodr

  • 1,401 views
  • 2 comments
  • 9 respects

Cocktail Parasol

by alain_haerri

  • 3,847 views
  • 7 comments
  • 15 respects

  • Roman Numeral Converter for Arduino 6 months ago

    Hello! Please note that the isValidNumber method is wrong. It actually only checks the first character of the string -- and if that one is a digit, the method returns true immediately (ignoring the following characters).
    You should invert the if-statement, and in the loop return false if it is not a digit.
    In the end, if the whole loop was passed without encountering a non-digit, the method should return true.
    However, now, you might want to check the length of the string before the loop. If it is an empty string you might want to return false.
    So, something like:

    boolean isValidNumber(String str) {
       if (str.length() == 0) return false;
       for (byte i = 0; i < str.length(); i++)
       {
           if (!isDigit(str.charAt(i))) return false;
       }
       return true;
    }
    
  • Arduino Controlled Artificial Candle Lights 7 months ago

    Thanks Ed! I spent a considerable amount of time to get it right; comparing it to a real candle light next to it. (At least as right it can be, giving the limited color range of the LED lights)
    I also have a critical judge at home... I'm very happy to hear that you were able to re-use the code! ;-) Cheers!

  • Arduino Controlled Artificial Candle Lights over 1 year ago

    Yes, adding the features I wanted made it rather complicated. (That's why I marked the project as "Intermediate". :-)
    But if you take your time and look into the different parts and how they interact I'm sure that you will understand how it works.

Add projectSign up / Login