Created
May 8, 2012 06:10
-
-
Save audreyt/2632953 to your computer and use it in GitHub Desktop.
Using c++0x in Arduino (Ubuntu Precise)
This file contains hidden or 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
| // /usr/bin/avr-gcc and /usr/bin/avr-g++ renamed to .orig | |
| // and replaced with this script: | |
| /* | |
| #!/usr/bin/perl | |
| exec "$0.orig", "--std=c++0x", @ARGV; | |
| */ | |
| auto led = 13; | |
| void setup() { | |
| pinMode(led, OUTPUT); | |
| } | |
| void loop() { | |
| auto ms = 500; | |
| auto set = [=](int state){ | |
| digitalWrite(led, state); | |
| delay(ms); | |
| }; | |
| set(HIGH); | |
| set(LOW); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment