A talk on Node.js, asynchronous I/O, Promises and the Raspberry Pi
(not necessarily in that order)
by Jean-Claude Batista /@jcbatista
Microcontrollers or Microprocessors?
On the Pi, GPIOs are like a regular files
we can write to and read from...
# Set up GPIO 7 (Pin 26 in board) and set it to output echo 7 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio7/direction # Write output echo 1 > /sys/class/gpio/gpio7/value # Clean up echo 7 > /sys/class/gpio/unexport
Paul, the *REAL* question should have been ...
curl -H "Content-Type: application/json" -d '{"action":"stop"}' http://192.168.31.161:8080/api/party
“This can’t be understated. Writing asynchronous code is hard”
It's OKAY, to use {mostly} synchronous GPIO calls for your Internet of Things related project
If you go asynchronous all the way, learn how to use Promises ...
Thanks for listening!