Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Open the door of embedded systems to IoT! mruby on LEGO Mindstorms (R)


Published on

mruby is lightweight implementation of the Ruby language, and it will encourage embedded system programmers to open the door to IoT (Internet of Things).

Published in: Software
  • Be the first to comment

Open the door of embedded systems to IoT! mruby on LEGO Mindstorms (R)

  1. 1. Open the door of embedded systems to IoT (the Internet of things)! mruby on LEGO Mindstorms EV3 ® Takehiko YOSHIDA @chihayafuru
  2. 2. Agenda Self-introduction What's LEGO Mindstorms ◦Standard Programming Environment ◦Extended Programming Environment (ev3dev) Can we use mruby in embedded systems? ◦Example of a light sensor for Mindstorms RCX ◦APIs for EV3s color sensor implemented with mruby Concluding Remarks Demonstration of the "RUBY JINJA"
  3. 3. Self-introduction I'm from Matsumoto city, Nagano. I work in a manufacturer of information- related equipment as a programmer. Takehiko YOSHIDA @chihayafuru
  4. 4. A hierarchy of a Japanese manufacturing industry Samurai Farmer Artisan Trader Mechanical Engineer Electrical Engineer Software Engineer
  5. 5. What's LEGO Mindstorms Educational Tool>Toy STEM education ◦Science ◦Technology ◦Engineering ◦Mathematics
  6. 6. History of LEGO Mindstorms 1st gen. MindstormsRCX 2nd gen. MindstormsNXT 3rd gen. Mindstorms EV3 ReleaseDATE 1998 2006 2013 CPU H816MHz ARM7 48 MHz ARM9 300 MHz RAM 32 KB 64 KB 16 MB
  7. 7. Standard Firmware Architecture OS (Linux) System Program Device driver (kernel module) VM (Virtual Machine) User Program Direct Command
  8. 8. Extended Firmware ev3dev ◦full Debian 7 (wheezy) Linux Distribution. ◦customized for the LEGO MINDSTORM EV3 controller. ◦Bootable from microSD/SDHC card Available Programming Language C / C++ Python JavaScript (Node.js) Lua Go Ruby
  9. 9. What's mruby ? mruby is the lightweight implementation of Ruby language complying to (part of) the ISO standard. Its syntax is Ruby 1.9 compatible. mruby can be linked and embedded into your application.
  10. 10. Can we use "mruby" in embedded systems ? Real-time constraint •Can mruby meet the deadline ? •A process of GC (Garbage Collection) deactivate other interrupts.
  11. 11. An example of a light sensor for1st gen. Mindstorms RCX LED Light Photo Detector
  12. 12. Circuit diagram of general light sensor Signal Power Common Out In LED Photodiode (Photo Detector)
  13. 13. Connector of Mindstorms RCX
  14. 14. Circuit diagram of the RCX’s light sensor Signal Power Common Out In
  15. 15. Waveforms of a signal voltage from the Light Sensor for RCX Oscilloscope reflected light is strong reflected light is weak
  16. 16. delay of programmed cycle
  17. 17. Color Sensor API with mruby for Mindstorms EV3
  18. 18. Initializer of Color sensor port : "in1", "in2", "in3" , "in4"
  19. 19. Connector of Mindstorms EV3
  20. 20. 3 modes of Color Sensor Ev3Color#mode=(mode) EV3Color.Mode.COL-REFLECT EV3Color.Mode.COL-AMBIENT EV3Color.Mode.RGB-RAW
  21. 21. Evolution of Mindstorms Intelligent Brick Light Sensor 1st gen. Mindstorms RCX 2nd gen. Mindstorms NXT 3rd gen. Mindstorms EV3 ANALOG ANALOG DIGITAL
  22. 22. Concluding Remarks What is mruby suitable for ? What is mruby NOT suitable for ?
  23. 23. What is mruby NOT suitable for ? Reaching a hardware limit under software control. Be willing to work in the background of mechanics and electronics, and struggle with C/C++, assembly language.
  24. 24. What is mrubysuitable for ? High-functional / Multi-functional electric devices Newly-developed Cloud servicesCreating new value with mashup technology
  25. 25. References LEGO Mindstorms® ev3dev mruby mruby-ev3dev