0.1.0 • Published 7 years ago

gpio-c.h.i.p v0.1.0

Weekly downloads
40
License
-
Repository
github
Last release
7 years ago

GPIO-C.H.I.P

How to use

var GPIO = require('gpio-c.h.i.p');

GPIO.exportAll();

GPIO.unexportAll();

If you don´t export, is exported automatically.

Use GPIO.export(gpio_port)

GPIO.export(4);

Use GPIO.unexport(gpio_port)

GPIO.unexport(4);

Use GPIO.read(gpio_port)

var value = GPIO.read(0);
console.log(value);

Use GPIO.write(gpio_port, state, direction)

GPIO.write(4, 1, GPIO.IN | GPIO.OUT);

Use GPIO.direction(gpio_port, direction)

GPIO.direction(4, GPIO.IN |	GPIO.OUT);

Use GPIO.isExported()

if(GPIO.isExported(4)){
	console.log("Yes");
}

Use GPIO.isChip()

if(GPIO.isChip()){
	console.log("I´m better than RPI");
}

Objects new GPIO.Gpio(gpio_port, direction)

var led = new Gpio(4, GPIO.OUT);
led.off(); // Value = 0;
led.on(); // Value = 1;
if(led.read() == 0){
	led.on();
}
0.1.0

7 years ago

0.0.16-a

7 years ago

0.0.15-a

7 years ago

0.0.14-a

7 years ago

0.0.13-a

7 years ago

0.0.12-a

7 years ago

0.0.11-a

7 years ago

0.0.10-a

7 years ago

0.0.9-a

7 years ago

0.0.8-a

7 years ago

0.0.7-a

7 years ago

0.0.6-a

7 years ago

0.0.5-a

7 years ago

0.0.4-a

7 years ago

0.0.3-a

7 years ago

0.0.2-a

7 years ago

0.0.1-a

7 years ago