ROBOTC.net forums
http://robotc.net/forums/

Values with line follower?
http://robotc.net/forums/viewtopic.php?f=11&t=7780
Page 1 of 1

Author:  licciardij [ Wed Jan 22, 2014 12:16 pm ]
Post subject:  Values with line follower?

i don't know why but i don't understand the changing typ defs issue? my kids are using a line follower to get a value of a marble (steel,wood,plastic) and want to use the value code to determine further actions. help!

Attachments:
File comment: this is his program.
davidanthonymarblesorterversion1.c [1.05 KiB]
Downloaded 458 times

Author:  JohnWatson [ Wed Jan 22, 2014 12:52 pm ]
Post subject:  Re: Values with line follower?

A quick example of the problematic code is below:

Code:
if(SensorValue(linefollower >180 &&  linefollower <200)


The issue with this is that the SensorValue() command should contain the name of the sensor inside of the SensorValue() command's parentheses. You will also need to use the SensorValue command each time you would like to read a sensor (even if it is the same sensor):

Code:
if(SensorValue(linefollower) >180 &&  SensorValue(linefollower) <200)


Try updating the code as such and see if the syntax errors clear themselves out.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/