The servo can travel (rotate) 180 degrees. If it can travel more than 180 degrees (preferred), the programmer can program its travel distance and allow it travel from 0 to 180 degrees and from 180 to 0 degrees, and go forward and back in the same speed.
The time interval between travels (from 0-180 degrees and from 180-0 degrees) and the travel speed (from 0-50 rpm, eg. 20rpm) are all programmable as in following “3â€.
when it travels to 180 degrees, it stops moving for 5-30 seconds (eg. 10 seconds), then travels from 180 degrees to 0 degree and stops for 5-30 seconds again, and repeats these process 6-8 times and then has long break for 1-24 (e.g. 8 hours) hours. After the long break, the whole above procedure will be repeated at for least 7 days.
Thank you and waiting for you reply.
Yongxin
The servo can travel (rotate) 180 degrees. If it can travel more than 180 degrees (preferred), the programmer can program its travel distance and allow it travel from 0 to 180 degrees and from 180 to 0 degrees, and go forward and back in the same speed.
The time interval between travels (from 0-180 degrees and from 180-0 degrees) and the travel speed (from 0-50 rpm, eg. 20rpm) are all programmable as in following “3â€.
when it travels to 180 degrees, it stops moving for 5-30 seconds (eg. 10 seconds), then travels from 180 degrees to 0 degree and stops for 5-30 seconds again, and repeats these process 6-8 times and then has long break for 1-24 (e.g. 8 hours) hours. After the long break, the whole above procedure will be repeated for at least 7 days.
Thank you and waiting for you reply.
Yongxin
I can help you with this. It’s easy to set the servos to one position then another. It’s also easy to set the delays in between moves. I’m not sure I understand #2. Do you mean it has to move very fast? This is also no problem. I will take a stab at your basic atom program in the morning.
Maybe something like this… I couldn’t test it from home.
Plug the servo into I/O pin0 and run the program. Not sure about a 24 hour pause though. Accuracy?
[code]servo0 var word
buttona var bit
Position1 con 2000 'about -45 degrees (adjust to desired angle)
Position2 con 4000 'about +45 degrees
Time1 con 2000 '2 second pause value (adjust)
Time2 con 4000 '4 second pause value
It compiled and sort of worked, but I need to make some changes. This works much better. See if you can follow how the program works.
[code]hsPosition var sword
Position1 con -14000 'about -90 degrees (adjust to desired angle)
Position2 con 14000 'about +90 degrees
Time1 con 2000 '2 second pause value (adjust)
Time2 con 4000 '4 second pause value
Thank you so much, Jim.
I am going to test it tomorrow morning----I just backed to office.
By the way, should I just try the 2nd program, or both?
Have a good evening.
Yongxin
Jim,
in my Bot Board, a jumper (I so call it) occupys one pin (out of 3) of I/O pin0. Should I remove that jumper and plug on my servo?
Thanks and waiting for your reply.
Yongxin
I have not checked to see if you wish for the processor to do anything during that 24 hours or not. If not I would probably try the sleep command else I would use the pause command. The issue is that I don’t believe that either command can take a value large enough for a 1 day delay.
But you could always put the delay into some form of loop, something like:
; simple function to sleep for about a day.
_iSADCount var long
SleepADay:
for _iSADCount = 0 to 60*24 ; number of minutes in a day.
sleep 60000 ; sleep the number of milliseconds per minute...
next
return
Note: I typed this in on the fly so there may be some problems. Also none of the timers are 100% accurate and there is some overhead for the loop. So you will probably need to adjust the value (60*24) to get an exact timing. Also since I have never run a BAP this long I don’t know what happens when their internal timer counter overflows…
Thank you, Jim.
I found P0-3 and moved my Servo to P0 and changed jumper from 5V to VS. After I connected them, the servo still did not move. I could see that y- and p- like letters ware increasing in the terminal 4 window with the music, but the servo was silent…
The thing is still not correct, or I should do somthing else to get the servo move?
Yongxin
Err… It is a servo though. It should be in the VS position. The Atom Pro is not fully seated into the socket. The I/O pins may not be making contact. Try pressing it into the socket. Take care not to bend the pins.
I have changed the jumper back to the position as shown in your picture and I checked I pushed all things all way to the ends , but the servo still does not move. How long would it be from the “connect” to servo moving normally?
Thank you again and waiting for more instruction.
Yongxin
Hi, Jim
Does the green LED light up? Yes
Does the servo hold position or is it movable by hand? Yes.
Do you click “program” on the Studio program, and does it complete? Not before–this must be the reason. I like your basic questions----I am really at that level. After I click program, the thing were different: my servo moved once then stopped and the music stopped, too. in the build window, many things were shown up with a end “finished programing”. Now what would be the next step I should take?
Thank you so much and waiting for your further instruction.
By the way, the jumper setting in above picture from innerbreed is correct, right?
Yongxin