HB-25 SPIN Question
NWCCTV
Posts: 3,629
I am anxiously awaiting the arrival of my Wild Thumper robot which will be here tomorrow. While I am waiting I am working on getting my SPIN code for the IR Remote to work with it. It comes with 2 Ea. HB-25's. Several months ago I wrote the code for 2 HB-25's to work using Parallax IR receiver and a standard remote control for another project using PBasic. In PBasic, you must issue a pause 1 command immediately after the first PULSEOUT command to start the second HB-25. Do I do the same thing in SPIN? PBasic code example below.
IF (IN3 = 1) THEN ' Checks if Pushbutton on IN3 is pressed, ' If Yes then send pulseout command to Pin PULSOUT HB25, 500 ' 15 to rotate motor 1 forward. PAUSE 1 ' 1 mS Delay For Motor 2 Pulse PULSOUT HB25, 1000 ' send pulsout command to pin 15 ' to rotate motor 2 reverse. PAUSE 10 ' wait 10 ms
Comments
Converting your PBASIC fragment:
Remember that BS2 PULSOUT units are 2us each; the pulse_out() method uses 1us units, hence the change in the values.