EAPL-Trainer mruby 試ãã¦ã¿ã¾ãã
æ ªå¼ä¼ç¤¾ã¢ã¤ã»ã¨ã«ã»ã·ã¼ãããçºå£²ãããmrubyå¦ç¿ããããEAPL-Trainer mrubyããEmbedded Technology 2012 ã§è³¼å ¥ãã¾ãããç°¡åãªããåä½ãã¹ãããã¦ã¿ã¾ããã®ã§ãã¬ãã¼ãã¨ãã¦ã¾ã¨ãã¦ããã¾ãã
EAPL-Trainer mrubyã¨ã¯
æ ªå¼ä¼ç¤¾ã¢ã¤ã»ã¨ã«ã»ã·ã¼ãããçºå£²ãããmrubyå¦ç¿ãããã§ããçµã¿è¾¼ã¿ãã¼ãã¨ãã¦ã¯ãã«ããµã¹ ã¨ã¬ã¯ãããã¯ã¹ç¤¾ãããããã£ã¨ãããããã¨ãã¦ä¼ç»ã»éçºããããGR-SAKURAãã¼ããç¨ãã¦ãã¾ããGR-SAKURAã¯"arduino"ã¨IOãã¼ãããã³é åäºæã«ãªã£ã¦ãããããarduinoã§æä¾ããããã·ã¼ã«ããã¨å¼ã°ããæ¡å¼µããã¤ã¹ãä¸é¨ä½¿ç¨ã§ããããã§ãã
ã§ãããã¨
GR-SAKURAãã¼ãä¸ã§mrubyããã°ã©ã ãå®è¡ãããã¨ãã§ãã¾ãã
éçºç°å¢ã¯Arduinoäºæã®ãããä¸è¨ã®ããã«Arduinoã®Cè¨èªéçºã¨åããããªè¦é ã§ã³ã¼ããè¨è¿°ãããã¨ãã§ãã模æ§ã§ãã
arduino㧠LEDãç¹æ»
int led = 13; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }
EAPL-Trainer mruby ã§LEDãç¹æ»
def setup() gr_pinMode($PIN_LED0, $OUTPUT) end def loop() gr_digitalWrite($PIN_LED0, 1) gr_delay(100) gr_digitalWrite($PIN_LED0, 0) gr_delay(100) end
軽ã調ã¹ã¦åãã£ããã¨
- GR-SAKURAã¯RXduinoãã¤ã³ã¹ãã¼ã«ããã¦ãã模æ§ã§ããGR-SAKURAãã¼ã+Cè¨èªã®éçºã¯ã«ããµã¹ ãã¯ããã¸ãããæä¾ãã¦ããwebä¸ã®ãµã¼ãã¹ãç¨ãããã¨ã§åºæ¥ã¾ãããRXduinoã®ã½ã¼ã¹ã³ã¼ãèªä½ã¯ãªã¼ãã³ã½ã¼ã¹ã§ã¯ãªã模æ§ã§ã
- EAPL-Trainer mrubyã«ã¯ãGR-SAKURAãã¼ãç¨ã®mrubyãçµã¿è¾¼ã¾ãã¦ãã¾ãããã¡ã¼ã ã¦ã§ã¢ãå
¥ãæ¿ããããã«ã¯ãããããä¸è¨ã®ãã®ãå¿
è¦ã«ãªãã¨æããã¾ã
- RXduino ã½ã¼ã¹ã³ã¼ã (2012å¹´12æ7æ¥ä»¥éã¯ãç¹æ®é»ååè·¯æ ªå¼ä¼ç¤¾ããããã©ã¤ã»ã³ã¹è²©å£²ããã模æ§)
- ã«ããµã¹E1ã¨ãã¥ã¬ã¼ã¿
- EAPL-Trainerç¨ã«ã«ã¹ã¿ãã¤ãºãããmruby (æ ªå¼ä¼ç¤¾ã¢ã¤ã»ã¨ã«ã»ã·ã¼ãããæä¾ãã¦ããããã¨ãæå¾ ..)
å人çã«ã¯ãã¿ããããã«ä»ãLEDããEthernetã使ã£ã¦ã¿ããã¨ããã§ãããéçºç°å¢ãèªåã§ç¨æããã®ã¯ãããªãã«å¤§å¤ããã§ããã