fritl's code didnt work with my start here bot so i re-wrote it and my bot did the same thing that it did with frits'. it just sits there turning its head from side to side
i could not get the sharp sensor test to work... the value just stays the same
heres my code.. can you post any mistakes in it.... thanks
symbol dangerlevel= 65 symbol turn= 300 symbol servo_turn= 700
main: readadc 0, b0 if b0< dangerlevel then gosub nodanger else gosub whichway end if goto main
nodanger: low 4:high 5:low 6:high 7 return
whichway: gosub totalhalt gosub left_turn pause servo_turn readadc 0, b0 gosub totalhalt gosub right_turn pause servo_turn readadc 0, b1 return if b1<b2 then gosub left_body_turn else gosub right_body_turn end if return
Geir is correct with his code sample. You can have the commands grouped together but you must have a space between colon and next command. low 4: high 5: low 6: high 7
The simulator will give you an error with the code you have now.
it turns out my code was fine except for that… its just that my ir sensor is burnt out… though it does give me the opportunity to upgrade to the SRF05, so YAY!
You are using a 28x board (the start here board) and you are using a servo connector to plug into the ADC, right? Yup, I fried 4 sharps at once doing this. --The data pin is in the center of the ADC pins on that board. It is different than the 8 outputs on the other side.
i dont know what your talking about… sorry im kind of new at this… i didnt have plastic around the bottom of the sharp wires so they were touching when i ran the current through them… would that burn them out???
It is not exactly the same as frit’s. Frits didn’t fry his sharp sensor. We need a clear picture of your set-up so we can be sure you connected everything right.