Pages: [1]   Go Down
Author Topic: firmata set initial value?  (Read 887 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys.

Im using processing with servo firmata to control some pan/tilt servo arrangement.  The problem im having is that when i run the processing program, before the window opens, the pan motor spins as fast it can in one direction, before spinning back the other way to the position defined in processing.  This is a problem as the motors are moving a sound sculpture which is very delicate and heavy.

Is there a way to make sure im sending the same right value on startup?

thanks!
Logged

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

You need to do the same as you would if you were doing it right. Define the servo position BEFORE you attach the servo.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I dont understand, do you mean inside the arduino code or processing?

Logged

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

Once you loaded firmata on the Arduino, you lost all ability to affect it's behavior. That only leaves one place where you can make code changes.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

can i not edit the servoFirmata example to set the initial value?

i know that the initial value from processing is correct.
Logged

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

You can do whatever you like. Feel free to let us know how it turns out.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok thabks well i hope you eventually.get some at home
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why not try asking the people that wrote Firmata. They are not affiliated with Arduino, and have their own site at http://firmata.org.

Alternatively, ditch the unsupported Firmata, and write your own sketch to run on the Arduino. Then you'd have complete control of how it worked, and would be able to tune it better to your needs.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Right i see.  Thanks for your genuine answer dxw00d!
Logged

Pages: [1]   Go Up
Jump to: