stamp too slow?
I'm trying to use an r/c remote and reciever to control 2 wheelchair motors. i have 2 h-bridges made from 12 volt auto relays switched by the stamp and n-channel mosfets. everything worked ok on the desk switching 1 bridge so i installed everything on the project buggy (now 2 h-bridges) and when i hold the remote stick over the activate fwd for example the relay clicks on /off. everything acts like it should except the relays dont hold they keep clicking on/off. i was wondering if the stamp is too slow to read in 2 channels and run 8 relays(need a ninth for a safety shut off). any advice would be appreciated-mike
' {$STAMP BS2} ' {$PBASIC 2.5} channel9 VAR Word channel10 VAR Word channel9 = 750 channel10 = 750 main: receiver: HIGH 0 LOW 1 'rev off LOW 2 'rev off LOW 3 'fwd off LOW 4 'fwd off LOW 5 LOW 6 LOW 7 LOW 8 DO PULSIN 9,1,channel9 'read output from receiver channels "9" and "10" PULSIN 10,1,channel10 DEBUG "channel9=",DEC ? channel9,CR 'display pusles for each channel in debug terminal DEBUG HOME 'display range+/- 550-950 DEBUG "channel10=", DEC ? channel10,CR IF channel9<400 THEN IF channel9>1100 THEN ' pin 0 can kill power to motors if radio signal is out of normal parameters LOW 0 ' ENDIF ' IF channel10<400 THEN IF channel10>1100 THEN ' LOW 0 ' ENDIF IF channel9>800 THEN 'fwd motor 1 GOSUB for1 ENDIF IF channel9<700 THEN IF channel9>401 THEN 'bwd motor 1 GOSUB back1 ENDIF IF channel9<=770 THEN IF channel9 >= 700 THEN 'deadstick range center position GOSUB nogo ENDIF IF channel10<=770 THEN IF channel9 >= 700 THEN 'deadstick range center position GOSUB nogo ENDIF IF channel10<700 THEN 'bwd motor 2 GOSUB back2 ENDIF IF channel10>770 THEN 'fwd motor 2 GOSUB for2 ENDIF LOOP '----------------------------------------------------------------------------------- for1: LOW 2 'rev off LOW 3 ' rev off PAUSE 250 HIGH 1 'f on HIGH 4 'f on RETURN back1: LOW 1 'fwd off LOW 4 'fwd off PAUSE 250 HIGH 2 'b on HIGH 3 'b on RETURN back2: LOW 5 'f off LOW 8 'f off PAUSE 250 HIGH 6 'b on HIGH 7 'b on RETURN for2: LOW 6 'b off LOW 7 'b off PAUSE 250 HIGH 5 'f on HIGH 8 'f on RETURN nogo: LOW 1 'shut off all relays LOW 2 LOW 3 LOW 4 LOW 5 LOW 6 LOW 7 LOW 8 RETURN
Comments
where do you find the info for things like outa to control only pins 0-3? i looked in the manual and help section and only found them on the reserved word list, but with no info about how to use them.
thanks again i appreciate your time and help.-mike