Sha256: 0d34afd641b00823546c68c5832cae555d05d8503e97bcb25bc7cfa82b535cf1
Contents?: true
Size: 1.35 KB
Versions: 3
Compression:
Stored size: 1.35 KB
Contents
class Basics < ArduinoPlugin # RAD plugins are c methods, directives, external variables and assignments and calls # that may be added to the main setup method # function prototypes not needed since we generate them automatically # directives, external variables and setup assignments and calls can be added rails style (not c style) # hack from http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1209050315 # plugin_directives "#undef int", "#include <stdio.h>", "char _str[32];", "#define writeln(...) sprintf(_str, __VA_ARGS__); Serial.println(_str)" # add to directives #plugin_directives "#define EXAMPLE 10" # add to external variables # ok, we need to deal with # what about variables # need to loose the colon... # external_variables "char status_message[40] = \"very cool\"", "char* msg[40]" # add the following to the setup method # add_to_setup "foo = 1";, "bar = 1;" "sub_setup();" # one or more methods may be added and prototypes are generated automatically with rake make:upload # call pulse(us) to pulse a servo ##################### ## basics.rb contains a set of simple methods such as on an off, enabling things like # button.on or button.off ## abstract summary: # ###################### void on(int pin) { digitalWrite( pin, HIGH ); } void off(int pin) { digitalWrite( pin, LOW ); } end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
madrona-rad-0.3.7 | lib/plugins/basics.rb |
madrona-rad-0.3.8 | lib/plugins/basics.rb |
madrona-rad-0.3.9 | lib/plugins/basics.rb |