Pages: [1]   Go Down
Author Topic: Serial programming and php  (Read 506 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 28
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey Arduino people.

Im doing a big project in my home, and need to control some servos, from my php work.


How do i do that?
Im using a php_serial.class.php

And are not sure how to use it.

Btw.. Could not post the code here, it's to long.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 50115
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
And are not sure how to use it.
You don't know how to use the php class to send data to/receive data from the Arduino or don't know how to make the Arduino receive data from the PC/send data to the PC?

Quote
Could not post the code here, it's to long.
Can you post it as an attachment?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 28
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

this is the attachment

i've also included the pde file...

* php_serial.class.php (12.35 KB - downloaded 2 times.)
* virkerdet.php (2.84 KB - downloaded 4 times.)
* SerialLEDComm.pde (1.46 KB - downloaded 2 times.)
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 50115
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Opening the serial port when a button is pressed, and closing it, are both actions that are going to reset the Arduino. The LED will be on for less time than it takes for your eye to recognize that.

You need more buttons, with different actions. You need a connect button, that will open and configure the serial port.

You need a disconnect button to close the serial port.

In the other button callback blocks, don't open or close the serial port.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 28
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey Paul.

Thanks for reply.

Can you code PHP? If yes, a little code would be greath :-)
Cause im not sure i understand what you ment.

Thanks again
Logged

Pages: [1]   Go Up
Jump to: