A talk on the Raspberry Pi, the Web and everything else...
(not necessarily in that order)
by Jean-Claude Batista / @jcbatista
http://slackingcoders.com
Microcontrollers or Microprocessors?
Digital | Analog | |
---|---|---|
Raspberry Pi | 3.3v | |
BeagleBone Black | 3.3v | 1.8v |
Arduino | 5v | 5v |
Power conversion might require a "level shifter"
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
Representational state transfer (REST)
Our Party resource will be available at the following url:
http://192.168.xxx.yyy:8080/api/party
curl -H "Content-Type: application/json" -d '{"action":"stop"}' http://192.168.xxx.yyy:8080/api/party
We barely scratched the surface of what's possible ...
Thanks for listening!