Public projects 1

Arduino Controlled Artificial Candle Lights

Project tutorial by Mattias Larsson

  • 18,665 views
  • 14 comments
  • 44 respects

Toolbox 3


Arduino Mega Chess II

Project showcase by Sergey_Urusov

  • 5,521 views
  • 11 comments
  • 41 respects

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

Project showcase by Tobi_Lxtr and wotanzero

  • 1,960 views
  • 2 comments
  • 11 respects

Roman Numeral Converter for Arduino

Project tutorial by Alfodr

  • 1,711 views
  • 2 comments
  • 9 respects

  • Roman Numeral Converter for Arduino about 1 year 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 about 1 year 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 2 years 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