Test of activating pins via ajax

This example needs to run from your web server and shows that the GPIO pins can be toggled via a web interface using an ajax request.

When the page loads the pins will be set to 0 and you can toggle from there.

Important

To get this working on the Raspberry Pi, the PHP binary needs to be added to the sudoers file. The easiest way to do this is to use the command:

sudo visudo

and then append this at the bottom of the file and save:

www-data ALL=(ALL) NOPASSWD: /usr/bin/php

Toggle pin values

Pin reports as 0

Pin reports as 0

Pin reports as 0