HB-25's and SimpleIDE
NWCCTV            
            
                Posts: 3,629            
            
                    Has anyone at Parallax tested SimpleIDE with the HB-25's. My observations are the following: They do not work with the Servo code. I have spent the past couple of days coding 2 servos on my PropBOE board and when I ported it to my Wild Thumper, it did not work the way it is suppose to. I guess I may end up going back to Spin since I have working code for that.                
                            
                            
Comments
EDIT: Do not pay attention to the comments. I fix that after the programs work.
int main() // main function{ sirc_setTimeout(200); // -1 if no remote code in 0.2 s while(1) // Repeat indefinitely { print("%c remote button = %d%c", // Display button # decoded HOME, sirc_button(2), CLREOL); // from signal on P10 int button = sirc_button(2); // Check P10 for remote message if(button == 16) { servo_speed(0, 100); // P18 servo full speed CCW servo_speed(1, -100); // P19 servo full speed CW } else if(button == 17) { servo_speed(0, -100); // P18 servo full speed CW. servo_speed(1, 100); // P19 servo full speed CCW. } else if(button == 18) { servo_speed(0,100); servo_speed(1,25); } else if(button == 19) { servo_speed(0,25); servo_speed(1,100); } else { servo_speed(0, 0); // Set P18 speed to 0 servo_speed(1, 0); // Set P19 speed to 0 } } }-Phil
EDIT: Should I place a pause in between each of the commands? Was not needed in the spin code which I am attaching below:
-Phil
As for HB25 timing, I usually make sure the pulse train is going before turning on the HB25s. The first print statement has a built-in 0.8 second delay to prevent PCs from trying to install the Propeller as a plug and play serial device. I think Parallax Serial Terminal has the same thing, so you should be okay there. If you delay a certain time between starting code and powering up HB25 in Spin, that same delay should be about right with C.
Full speed on the HB25s is going to be +/- 500 with the Spin and C libraries you are using.