+ 1

Can javascript control the GPIO of a raspberry pi?

I'm building a simple robot. I'm wanting to interface with it in a Web page hosted on the pi. I just need a camera and a few buttons to control motors.

18th Jul 2017, 9:53 PM
Chris Winner
Chris Winner - avatar
5 Réponses
+ 3
you can control the gpio of a raspberry pi via command line. this means you can send these commands from a nodejs server installed on your rpi. a js client could trigger such commands using sockets (socket.io) to communicate with the server edit: look at what i found https://www.npmjs.com/package/rpi-gpio
2nd Nov 2017, 7:49 PM
seamiki
seamiki - avatar
+ 1
Strictly speaking Python is the way to go controlling the pi's GPIO. However there are some packages available (like NodeJS) that allows you to use javascript to acces the GPIO.
19th Jul 2017, 12:35 AM
Jesrael Cruz
+ 1
is it easy to embed python in a html script and use buttons like that or do I need to start learning Flask?
19th Jul 2017, 12:56 AM
Chris Winner
Chris Winner - avatar
+ 1
acctually you have to add CGI from python
19th Jul 2017, 12:59 AM
Nushan Kodikara
Nushan Kodikara - avatar
0
nope go for python
18th Jul 2017, 11:38 PM
Nushan Kodikara
Nushan Kodikara - avatar