I and having problems with hservo, it just dosent seam to work.
I’ve tried several different ways, it compiles but nothing happens, using a debug line before and after the hservo command proves that it runs…even the prewriten code for the brat wont do anything.
The IDE ver. is 8.0.1.8.
The Atom is on a bb2.
the weird thing is everything else seams to work???
This is just a wag but I seem to recall a need for an ENABLEHSERVO command in the code so the module to support HSERVO commands got included or something. Do you have a line like this in your code?
There is not enough information here to help much. It would really help to have information, like you have what servos on pins xxx and you have the jumpers set for those pins to use VS and not the +5v and what you are using to supply power, etc.
Also it would help to see the code that is not working for you.
Even better show which tutorial you are using, and at what step it isn’t doing what you think it should. Have you skipped any steps? Were you able to get the offset program loaded and working?
I am using hitec hs-422 and hs-475hb, for the pins
for the pins, i am just trying to get it working with pins 0-3
The jumpers were set to +5, should i change it to vs? does it really make a difference?
When fully charged it reads at 5.46V, it is in vs and i do have the jummper on the vs, vl
3)I am not follow a tutorial, im just tring to use the hservo command, I havnt tried the offset because im not making a brat, i was just tring the code to see if it was an error in my code.
Servos can not be powered by the 5vdc regulator on the Bot Board II. That’s why we went to the trouble of adding a second place to apply servo power. You should at least look over the tutorials for the BRAT. You may just come out of the experience a little more knowledgeable.
This sounds like a job for AcidTech (Nathan). I think Hservo may be part or fully busted in 8.0.1.8. Or maybe my battery drained just after I rebuilt and downloaded my Brat code to my Brat using the new build and it no longer works.
To verify I just plugged in the battery charger to it and will try it again later. You might try downloading the 8.0.1.7 release and see if it works for you. You can get it from the Basic Micro web site:
But if you comment out the two hservo commends the sound command works. We wrote tutorials for the Atom Pro / 8.0.1.7 / and the BRAT. I am not sure they are still working. Nathan tells me he can help tomorrow.
Yes I have used the 8.0.1.7 for awhile and that was the only one that everything was working properly since 8.0.0.0.
When I recompiled the brat that was running using the 8.0.1.7 and working well with the 8.0.1.8 the brat stopped working completely, including the LCD display not showing anything. That is why I decided to try to recharge the battery. But I thought that was a longshot as
I was stupid when I first tried out the brat with 8.0.1.7 I was not careful on how I picked it up and hit the VOL up key, where the brat promptly pinched my finger in one of the leg joints and cut a little skin. and I will Razz myself
It sounds like it may be hanging in the EnableHSERVO code…
On my 8.0.1.8 code I am getting the sound, but I am not getting the hservo to do anything. This is on a my PS2 test setup with wall wart and I simply changed your code to hservo [p0\0] as I only had one servo and I did not specify a speed. I will try now speed of 255…
I am assuming my spare parallax servo will work, else I could through a 645 on it…
I did a little more playing around on my test setup. BB2 BAP28, PS2 setup, 645mg on P0 and jumpers from P4-6 to the LEDS on the board (p4->p13…) I am running this simple program:
[code]ENABLEHSERVO
i var sword
main:
high p4
high p5
high p6
for i = -10000 to 10000 step 1000
low p4
hservo [p0\i\255]
toggle p6
pause 150
;hservowait [p0]
high p4
next
for i = 10000 to -10000 step -1000
low p5
hservo [p0\i\255]
toggle p6
pause 50
high p5
next
hservo [p0\-16000\255]
low p4
low p5
low p6
pause 2000
goto main [/code]
I have tried several variations, but what happened was the servo would get power and go to one location and just sit there. , it was getting some type of signal as I could not move it. I put the extra code in to go to -1600 after each looping that should release the servo. Again it did not. While typing this I moved the servo to P3 and did not change the code so the code is to manipulating P0, but the servo started moving around some on P3. Not good. Maybe I will move the logic analyzer back to this setup and see what I am getting!
Ok, I did a quick setup with the Logic Analyzer. I hooked up probes on pins 0-6 and tried the program I showed above. I did play around with some of the timeouts… The only thing that the logic analyzer showed is that my LED outputs High/Low/Toggle are working on P4-P6 and P0 is pulled low and P1-p3 are floating high. So we are not seeing any servo pulses on P0…