Go Down

Topic: "L" light flashes, program restarts (Read 1 time) previous topic - next topic

pluggy

Quote
Pin 13's built-in LED has the legend "L" printed next to it on the PCB.


Must be young, us old beggers with aging eyes can't see such detail............   :)

TBAr

#6
Sep 29, 2009, 03:29 am Last Edit: Sep 29, 2009, 03:52 am by TBAr Reason: 1
Quote
shouldn't print be able to handle this?

Some of the library functions caution about using something other than constants and single variables as parameters to the functions. For example, Print cautions "Be careful about doing math inside the brackets" (http://www.arduino.cc/en/Serial/Print - see "Programming Tips / Known Issues" at the bottom of that page). I presume the same caution applies to using the results of other functions as a parameter, which is what the case is here. Try replacing

   d1.print(d1.getCursor());

with

   int j = d1.getCursor();
   d1.print(j);



Quote
any idea why print(); would fail, but sending each character to write() explicitly would work?

The end of that same section (referenced above) also cautions "The Serial.print function puts data into a buffer. It will wait for one character to send, before going on to the next character. However the function returns before sending the last character. " Maybe there is something weird about its interaction with the LedDisplay library that is causing that behavior. Dunno, it's got me stumped too.

TBAr

Quote
Quote
Pin 13's built-in LED has the legend "L" printed next to it on the PCB.

Must be young, us old beggers with aging eyes can't see such detail............  

Well, you can't say they didn't give you a fair chance. They did make it an upper-case "L".   ;D

Go Up