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.
Upcoming SlideShare
Let your website a ride of AngularJS
Next
Download to read offline and view in fullscreen.

445

Share

Download to read offline

26 EDISON TIPS var m Node.js and The Internet of Things

Download to read offline

26
EDISON TIPS
var m = require('mraa'); //require mraa
var myLed = new m.Gpio(13); //LED hooked up to digital pin 13
myLed.dir(m.DIR_OUT); //set the gpio direction to output
var ledState = true; //Boolean to hold the state of Led
function periodicActivity()
{
myLed.write(ledState ? 1:0); //write led state to pin
ledState = !ledState; //invert the ledState
setTimeout(periodicActivity,1000); //call after 1 second
}
periodicActivity(); //call the periodicActivity function
USE MRAA
npm install mraa

Related Books

Free with a 30 day trial from Scribd

See all
  • chikawonah

    Sep. 16, 2021
  • ssuserf26467

    Jun. 13, 2021
  • RajeshwariSHiremath

    May. 27, 2021
  • balutbp

    May. 24, 2021
  • WilliamDOLIGEZ

    May. 18, 2021
  • MdMahbuburRahman109

    May. 17, 2021
  • DanielCochran11

    May. 12, 2021
  • cbshivers

    Mar. 10, 2021
  • JamieWyatt8

    Mar. 5, 2021
  • viplocksmithsydney

    Feb. 15, 2021
  • RajeshKanjoor

    Jan. 3, 2021
  • AppZoroTechnology

    Dec. 3, 2020
  • StevePerkins39

    Nov. 14, 2020
  • mohammedahmed519

    May. 11, 2020
  • KOFFIKEVINKOUAME

    May. 9, 2020
  • jcb6

    Mar. 26, 2020
  • RachelSanchezJunior

    Feb. 18, 2020
  • victorjung_

    Feb. 6, 2020
  • omaruriel

    Jan. 27, 2020
  • MarioContreras59

    Nov. 16, 2019

26 EDISON TIPS var m = require('mraa'); //require mraa var myLed = new m.Gpio(13); //LED hooked up to digital pin 13 myLed.dir(m.DIR_OUT); //set the gpio direction to output var ledState = true; //Boolean to hold the state of Led function periodicActivity() { myLed.write(ledState ? 1:0); //write led state to pin ledState = !ledState; //invert the ledState setTimeout(periodicActivity,1000); //call after 1 second } periodicActivity(); //call the periodicActivity function USE MRAA npm install mraa

Views

Total views

138,529

On Slideshare

0

From embeds

0

Number of embeds

28,704

Actions

Downloads

1,607

Shares

0

Comments

0

Likes

445

×