Quote:
Originally Posted by ekapalka
Thanks! How would I call the functions from the main robot cpp file? Is it just ?
|
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.