BreadBoard | |
A push button switch x1 | |
1KOhms resistor x1 | |
10KOhms resistor x1 | |
Male-Female jumper wires |
$ sudo npm install rpi-gpio
take note of the server address e.g. SystemServer running at http://192.168.1.???:8088$ sudo node n8.snapshot.js
What you'll see on standard output (console) is the text: 'Channel 16 value is now (?)' whenever you push the button. Congratulations!!| gpio | gpio := RPI gpio. gpio setMode: gpio modeRPI. gpio on: #change do: [:channel :value| self print:'Channel ', channel , ' value is now ' , value ]. gpio setup: 16 direction: gpio dirIn edge: gpio edgeBoth with: [].