Chapter 2

  1. The first LED.strobe() parameter defines the blinking speed of LED, which is 100 ms by default. If the argument is defined as 500 then the blink will go in 500 ms intervals.
  2. The second line of argument use require function to pull in the johnny-five modules.
  3. Johnny-Five LED objects are output only and therefore do not emit any events.
  4. Raspberry Pi pin P1-29 translate to GPIO 5 in terms of GPIO#.
  5. LED.blink() function is an alias to LED.strobe() function.
  6. We begin with constructing a board object, and we pass a new instance of the raspi-io module in as its I/O. This is how we tell the Johnny-Five library we're running this code on a Raspberry Pi.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.0.240