NMHU SSD 341 sieve demo with light sensor while loop for timer

Dependencies:   SLCD mbed

Fork of lightsense_kl46z_states by Stanley Cohen

Files at this revision

API Documentation at this revision

Comitter:
scohennm
Date:
Fri Sep 05 23:37:33 2014 +0000
Parent:
1:51f8c2b04ce2
Child:
3:64e28ee5719b
Commit message:
Moved location of PWM frequencies

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Sep 05 02:26:47 2014 +0000
+++ b/main.cpp	Fri Sep 05 23:37:33 2014 +0000
@@ -30,8 +30,6 @@
 
 int main() {
     char lcdData[LCDLEN];
-    greenColor.period_ms(PWMTIME); // set the frequency of the pulse train
-    redColor.period_ms(PWMTIME);
     int rampstate = RMPUP;
     int numSteps;
     float workingDelta;
@@ -39,6 +37,8 @@
     
     pc.printf(PROGNAME);
     
+    greenColor.period_ms(PWMTIME); // set the frequency of the pulse train
+    redColor.period_ms(PWMTIME);
     workingDelta = rampDirection[rampstate];
     numSteps = (int)(1.0/workingDelta);
     while(true) {