+ 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.
5 ответов
+ 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
+ 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.
+ 1
is it easy to embed python in a html script and use buttons like that or do I need to start learning Flask?
+ 1
acctually you have to add CGI from python
0
nope go for python