View Single Post
  #10   Spotlight this post!  
Unread 14-01-2013, 11:51
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Programming ultrasonic rangefinders

Quote:
Originally Posted by ekapalka View Post
Thanks! How would I call the functions from the main robot cpp file? Is it just
Code:
//schnip
?
Don't use that code. It's simple, obvious, and wrong. You don't want to keep instantiating a new AnalogChannel every time you need to read the distance.

You can use the fancier .h file from the thread where you got that code, but that might be more than you're ready to handle. Joe ("DjScribbles") is right here and can help you understand how to use it. Or you can define the AnalogChannel object once at the beginning of your program and leave out the pair of lines that create it every time in the code you copied.
Reply With Quote