Last active
March 22, 2018 02:42
-
-
Save martinribelotta/c098855a510ac39a6a842f5f12aa6091 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <programa.h> | |
using namespace sapi; | |
struct { | |
DigitalIn button; | |
DigitalOut led; | |
} io[] = { | |
{ { TEC2 }, { LED1 } }, | |
{ { TEC3 }, { LED2 } }, | |
{ { TEC4 }, { LED3 } }, | |
{ { TEC1 }, { LEDR } }, | |
}; | |
int main( void ) | |
{ | |
DigitalOut blinkLed(LEDB); | |
while( true ) { | |
for( auto& e: io ) e.led = !e.button; | |
blinkLed = !blinkLed; | |
delay( 100 ); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment