Created
December 15, 2014 18:54
-
-
Save graysonarts/1becfbfe4c8c2231778e to your computer and use it in GitHub Desktop.
small example of the intermediate langauge that I'm considering building for my arduino led vm
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
%version 1 | |
%numleds 5 | |
%require imu | |
%green RGB(0,128,0) | |
%red RGB(128,0,0) | |
states { | |
state foo { | |
skipif imu.accel.x > 1 | |
setall %green | |
fade | |
} | |
state bar { | |
pulse %green | |
skipif imu.accel.y > 1 | |
set 1 %red | |
skipif imu.accel.z > 1 | |
set 2 %green | |
ripple | |
} | |
state loop { | |
everypixel { | |
set i RGB(imu.orientation.y, imu.orientation.z, imu.orientation.x) | |
} | |
} | |
} | |
decisions { | |
imu.velocity.x > 0.1: foo | |
imu.velocity.y > 0.1 and imu.accel.y < 0.5: loop | |
imu.gesture.step: bar | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment