Go to Post I worship whoever cleans the robotics room. - John Gutmann [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-02-2003, 17:21
Fares Fares is offline
Registered User
#1009 (Vikings)
 
Join Date: Dec 2002
Location: Georges Vanier S.S (Toronto)
Posts: 5
Fares is an unknown quantity at this point
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   Spotlight this post!  
Unread 03-02-2003, 17:41
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
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.
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies
  #3   Spotlight this post!  
Unread 03-02-2003, 18:26
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Re: My sensors don't work

Quote:
Originally posted by Fares
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


A couple of problems: Both c_sensor1 and c_p1_y are CONSTANTS used in initialization to set up communications with the master microprocessor. You're not going to be able to SET c_p1_y. You should use if sensor1=1 then p1_y=1 as SuperDanman suggested.

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".)
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 17:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi