Last minute bug-fix of arduino-sketch

... happens when not completing testing before pushing commit :-)
This commit is contained in:
Ralf Schlatterbeck 2014-06-26 19:07:48 +02:00
parent f0f5391409
commit c5d25f5bfe
2 changed files with 3 additions and 2 deletions

View file

@ -139,8 +139,9 @@ led_pwm_handler
PRINTF ("GOT: %s\n", temp); PRINTF ("GOT: %s\n", temp);
tmp = strtoul (temp, NULL, 10); tmp = strtoul (temp, NULL, 10);
if (tmp > 255) { if (tmp > 255) {
pwm = 255; tmp = 255;
} }
pwm = tmp;
PRINTF ("Setting: %d\n", pwm); PRINTF ("Setting: %d\n", pwm);
REST.set_response_status(response, REST.status.CHANGED); REST.set_response_status(response, REST.status.CHANGED);
} else { } else {

View file

@ -29,7 +29,7 @@ void setup (void)
void loop (void) void loop (void)
{ {
/* Use 255 - pwm, LED on merkur-board is wired to +3.3V */ /* Use 255 - pwm, LED on merkur-board is wired to +3.3V */
analogWrite (LED_PIN, 255 - pwm); /* analogWrite (LED_PIN, 255 - pwm);
printf ("clock : %u\nmillis: %lu\n", clock_time (), millis ()); printf ("clock : %u\nmillis: %lu\n", clock_time (), millis ());
delay (period_100ms * 100); delay (period_100ms * 100);
analogWrite (LED_PIN, 255); /* OFF: LED on merkur-board is wired to +3.3V */ analogWrite (LED_PIN, 255); /* OFF: LED on merkur-board is wired to +3.3V */