Go Down

Topic: Web server and servo interaction (BlackWidow) (Read 7159 times) previous topic - next topic



I have a BlackWidow wifi arduino, and it's very cool.

Run into a snag - I am using the supplied web library (#include WiShield.h) and have a web server up - this handles GET requests (return JSON) and as well you can POST a JSON object, and it updates data accordingly.

I'm using this to right now control 2 servos ("s1" and "s2") so the position is set from values in the JSON object POSTed to the server.

So, for example, POSTing:

{ "s1": 0, "s2": 120 }

to the arduino ultimately results in the following calls to update the servos (the Servo object defined in the standard arduino servo lib):


You can make a GET request and get back the JSON:

{ "s1": 0, "s2": 120 }

If I run with the servo updates commented out, it works. When I uncomment the code, the server runs fine for a bit (and servos rotate) but then it crashes (?) I think it crashes - it doesn't respond to GET requests - seems dead.

May take a bit, but eventually does, and so I'm wondering if there might be a timing thing with the servo rotation code causing problems with the network library?

It's got me stumped so far - any hints appreciated.




How are you powering your servos? How much current do they draw?


Oh my! I was powering the arduino and servos from the USB cable. I changed to power from an external power supply (9V 650mA) and seems to be working fine now.

I'm a software guy, not a hardware person.

Did a quick test, and everything looks to be working okay!

Wicked news - thanks a ton, pocketscience.



Go Up