Hardware hacking with PHP via Raspberry Pi

Cae2dd246ed83dd458e4ce5f927aa2f7?s=47 U-Zyn Chua
September 12, 2012

Hardware hacking with PHP via Raspberry Pi

Ever wished you knew Python or C so you can do some electronics projects but couldn't afford the time to pick up the languages? Fret not, if you are familiar with PHP, you can hack hardwares too!

Presented at Singapore PHP User Group Meetup on 12 September 2012.

Code available at https://github.com/uzyn/raspi-gpio-demo.php

Cae2dd246ed83dd458e4ce5f927aa2f7?s=128

U-Zyn Chua

September 12, 2012
Tweet

Transcript

  1. U-Zyn Chua chua@uzyn.com

  2. I work at

  3. What is

  4. Why hardware?

  5. PHP • Ugly language • Hated by hackers • Most

    tutorials in Python, Ruby. • Arduino mainly in C
  6. PHP • But we love PHP!

  7. PHP • But we love PHP! • Because it’s like

    the mother of language, C! (excuse)
  8. PHP Anyway, we’re most proficient with it!

  9. Hardware is not scary

  10. Hardware is not scary is just I/O

  11. Hardware is not scary is just I/O just like file-handling

    /sys/class/gpio
  12. Pins

  13. GPIO is all we care (for noobs at least)

  14. GPIO is all we care (for noobs at least) +

    some basic electronics
  15. GPIO WiringPi https://github.com/WiringPi/WiringPi C-based very simple

  16. WiringPi gpio mode 1 out gpio write 1 1 gpio

    write 1 0
  17. WiringPi-PHP PHP wrapper for WiringPi https://github.com/WiringPi/WiringPi-PHP Requires compilation (is it

    ready?)
  18. PHP-GPIO PHP wrapper for /sys/class/gpio https://github.com/pickley/PHP-GPIO Simple to setup

  19. PHP RasPi GPIO Libs • WiringPi-PHP • Userland • Requires

    compilation • PHP-GPIO • Easy to set up • root :(
  20. Demo time! https://github.com/uzyn/raspi-gpio-demo.php

  21. PHP web language tons of frameworks + libraries scripts easy!

  22. PHP + Hardware world domination

  23. Ideas? U-Zyn Chua chua@uzyn.com twitter.com/uzyn