View unanswered posts | View active topics It is currently Sun Dec 21, 2014 11:28 am






Reply to topic  [ 3 posts ] 
threshold error 
Author Message
Rookie

Joined: Thu Mar 13, 2014 2:39 pm
Posts: 5
Post threshold error
im pretty new to this so don't give me a hard time
i'm wrote the basic tank drive code from a video tutorial on YouTube but i got this error:
Undefined variable 'threshold'. 'short' assumed.
and and this the line i wrote: if(abs(joystick.joy1_y1)>threshold)
i checked on the video and several forum post and everything right so i dont know whats wrong


Thu Mar 13, 2014 3:01 pm
Profile
Moderator
Moderator

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 198
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post Re: threshold error
Have you initialized the variable "threshold" in your code anywhere? Like this:

Code:
int threshold;
//or
float threshold;


That error shows up when you try to read from a variable that you never created.

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot


Thu Mar 13, 2014 4:37 pm
Profile
Rookie

Joined: Thu Mar 13, 2014 2:39 pm
Posts: 5
Post Re: threshold error
yep that was the problem
thanks buddy


Thu Mar 13, 2014 4:39 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.