Is it possible to control an Arduino Uno with a PHP webpage?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you can. You can connect your Arduino via USB to your server, and use phpSerial.
Or you can connect to your Arduino with an Ethernet shield. In PHP you can open a stream to your Arduino.
You can write your own protocol to communicate, for example:
To read the value of an analog input:
rA0followed by (‘\n’).rA0: and sends the value of analog input A0 back in ASCII followed by a newline (‘\n’).A little more explanation:
r(to set an I/O port or PWM aw)On the Arduino side;
atoi()you can parse ASCII to integers.If it is a legal command; respond to the command.