Mercurial > hg > beaglert
comparison examples/basic_blink/render.cpp @ 308:1feb9c23ac57 prerelease
Renamed read/write functions to remove the Frame --> e.g. analogWriteFrameOnce -> analogWriteOnce, digitalReadFrame -> digitalRead
author | andrewm |
---|---|
date | Fri, 27 May 2016 18:21:21 +0100 |
parents | e4392164b458 |
children | 02c4ca0e3718 |
comparison
equal
deleted
inserted
replaced
307:ff5f346a293e | 308:1feb9c23ac57 |
---|---|
34 float interval=0.5; //how often to toggle the LED (in seconds) | 34 float interval=0.5; //how often to toggle the LED (in seconds) |
35 static int status=GPIO_LOW; | 35 static int status=GPIO_LOW; |
36 for(unsigned int n=0; n<context->digitalFrames; n++){ | 36 for(unsigned int n=0; n<context->digitalFrames; n++){ |
37 if(count==context->digitalSampleRate*interval){ //if enough samples have elapsed | 37 if(count==context->digitalSampleRate*interval){ //if enough samples have elapsed |
38 count=0; //reset the counter | 38 count=0; //reset the counter |
39 // status=digitalReadFrame(context, 0, P8_07); | 39 // status=digitalRead(context, 0, P8_07); |
40 if(status==GPIO_LOW) { //toggle the status | 40 if(status==GPIO_LOW) { //toggle the status |
41 digitalWriteFrame(context, n, P8_07, status); //write the status to the LED | 41 digitalWrite(context, n, P8_07, status); //write the status to the LED |
42 status=GPIO_HIGH; | 42 status=GPIO_HIGH; |
43 } | 43 } |
44 else { | 44 else { |
45 digitalWriteFrame(context, n, P8_07, status); //write the status to the LED | 45 digitalWrite(context, n, P8_07, status); //write the status to the LED |
46 status=GPIO_LOW; | 46 status=GPIO_LOW; |
47 } | 47 } |
48 } | 48 } |
49 count++; | 49 count++; |
50 } | 50 } |