|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
My sensors don't work
I tried installing the sensors on the EDU and test them out, but the coding doesn't seem to be working
this is what i have: if c_sensor1=1 then c_p1_y=1 what's wrong with this code if it keeps telling me that it expects a label ![]() |
|
#2
|
||||
|
||||
|
try using just 'sensor1' and 'p1_y'
And also, it seems like you're trying to make the robot go forward when the sensor is active. Since p1_y is a analogue input/output, it goes from 0 to 254 (note: a common mistake for rookies - including us last year - is thinking that PWM outputs go up to 255. Although TECHNICALLY right (analogue-wise), it's a, uh, how do I put this... *bright flashing red lights*<b>bad</b> thing to output that). Anyways, if you're outputing p1_y to a PWM port, make it equal to 254. |
|
#3
|
|||||
|
|||||
|
Re: My sensors don't work
Quote:
Also, since you are using PBASIC v2.5 syntax (if ... then ... statement) rather than v2.0 (if ... then ... label), you need to enable 2.5 syntax by including a '{$PBASIC 2.5} directive. (If 2.5 syntax had been enabled, the error message would have said: "Expected a label, variable, or instruction" instead of "Expected a label".) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Robotics Tournament at Sensors Expo & Conference | Kyle Fenton | Off-Season Events | 4 | 04-05-2003 12:15 |
| Optical sensors with EduBot | Gui Cavalcanti | Robotics Education and Curriculum | 5 | 02-03-2003 10:05 |
| Q&A Discuss: Optical sensors with EduBot | CD47-Bot | Extra Discussion | 2 | 01-03-2003 18:37 |
| Q&A Discuss: optical sensors | CD47-Bot | Extra Discussion | 0 | 15-02-2003 22:58 |
| Robogui ! sensors don't work | Fares | Programming | 2 | 07-01-2003 16:31 |