i am very stressed!sorry for not providing the accurate information.if you want a scematic i ll do one.speed of the servos could be the maximum.not of much importance.as long as it moves and not fall asleep
what kind of table do ineed to do?does it need to have an equasion or sth?
the voltage i use ± 6volts.all the jumpers for the pins of the switches are set to 5v on the board and to vs for pins of the servos.
i tried to do a scematic of the wiring i have
If you want help, you are going to have to better than this… Could you wire switches with that diagram? I need to know without a doubt what you have on your end. Without a good understanding of what you have I can not tell you what to do…
I have 100% confidence your project can be done very easily. The program I wrote will do what you are describing.
By a table I mean this…
-----------------------------------------|
| Servo1 | Servo2 | Servo3 |
-----------------------------------------|
Switch1 | -90deg | +90deg | +90deg |
-----------------------------------------|
Switch2 | +90deg | +90deg | -90deg |
-----------------------------------------|
Switch3 | +90deg | -90deg | -90deg |
-----------------------------------------|
hi!you were absolutely right and yes i had the wiring wrong. i was very stressed. after this message from you: [code]buttona = in12 ’ this tells you where to plug in the switches.
buttonb = in13
buttonc = in14
pulsout 0, servo0 'this tells you where the servos are plugged in.
pulsout 1, servo1
pulsout 2, servo2[/code].
i tried to relax and redid the wiring and now it is as you mentioned!.
is this the table?
---------------------------------------------------------------------------|
| Switch1 | Switch2 | Servo3 |
---------------------------------------------------------------------------|
Servo1 | -90deg to +90 deg | -90deg to +90deg | no movement
---------------------------------------------------------------------------|
Servo2 | -90deg to +90deg | +90deg to -90 deg | no movement |
---------------------------------------------------------------------------|
Servo3 | no movement | no movement |-90deg to +90deg
--------------------------------------------------------------------------|
the code you wrote does the following moves:
switch1 (turning left to right)moves servo1 or servo2 from -45degr to +45 degr*****
switch1 (turning from right to left)moves servo1 from +45degr to -45degr
switch2 (turning from left to right) moves servo1 from+45deg to -45deg while servo2 from -45deg to +45deg
switch2 (turning from right to left) moves servo1 from -45degr to+45deg while servo 2 from +45 to -45degr
switch 3 does no movement
*****sometimes it does late movement and gets confused either not enough pulses or the mechanical limits of th servos
i am doing exactly what you wrote.
So the servos are moving now?
The table should only show the destination position. It makes no sense to talk about them moving from here to there, because pressing a button will make the servo move to the new destination no matter where it was left from the previous position.
I still have no clue as to how your switches are wired.
In order to work properly the switches need to be momentary. Press once to make the servos all move as desired. They will stay in position until a new button is pressed.
in the board i wrote the range i wanted each servo to have.i want them to be able to stop in between.whereever i choose manually
Personally the marked up picture does not show me much… But maybe next step should be to see if we are getting all of the proper inputs… Maybe update Robot Dudes program like:
[code]servo0 var word
servo1 var word
servo2 var word
buttona var bit
buttonb var bit
buttonc var bit
sound 9, [100\880, 100\988, 100\1046, 100\1175]
low 0
low 1
low 2
start:
buttona = in12
buttonb = in13
buttonc = in14
if buttona = 0 then button_a_process
if buttonb = 0 then button_b_process
if buttonc = 0 then button_c_process
goto servo_pulse_generation
button_a_process:
servo0 = 2000
servo1 = 4000
servo2 = 4000
sound 9, [60\4000]
goto servo_pulse_generation:
button_b_process:
servo0 = 4000
servo1 = 4000
servo2 = 2000
sound 9, [60\4500]
goto servo_pulse_generation:
button_c_process:
servo0 = 2000
servo1 = 2000
servo2 = 4000
sound 9, [60\5000]
servo_pulse_generation:
pulsout 0, servo0
pulsout 1, servo1
pulsout 2, servo2
pause 10
goto start[/code]
Makes 3 different sounds, so you can tell if you are receiving proper data from all of them…
Kurt
yes it is working but i have to wait for around 20-30sec to be able to give another order to any of the switches
That is not what you asked for, and it will require a complete rewrite of the program. I’m unable to devote any more time to this. Good luck with your project.
The way the program works is it will branch if the first switch is “on”, and not even test for the other switches. You have toggle switches that stay “on” or “off”. If you make sure all 3 switches are off, then turn them on one at a time, turning them back off before going to the next switch you should have no delays and you should be able to hear the three different tones.
Kurt, I believe the switches are putting either 5vdc or ground on the I/O pins. This is just a guess, but it sort of hints to this.
the jumper is on 5vdc if this is what you are telling.guys i am in the last semester and my parents are killing me!!!
Your personal situation has little impact on our ability to help you.
Your inability to provide any helpful information is the true problem here.
ok.maybe i am not as smart as other people.i never said i was but i am doing the best i can.if smart person can guide me correctly maybe i learn a few things also…
what kind of information do you need to help me?i will try my best not to waste any more of your time