Wasn’t sure whether to post this in the Sensors forum or here…
I am trouble-shooting our analog breakout board to use it with a pot.
At this point, i’m just trying to read the input signal from the board, using printf statements and looking at the Analog Input lights on the I/O screen of the Driver Station. I have the PWM wired with 5V and ground on the middle pin and pin closest to the board, respectively, and a DC signal to the inside pin. The pertinent code looks like the following:
elbow = new Analogchannel(8); //PWM is connect to the pin closest to the jumpers - the outside 2 pins are jumpered
DriverStationLCD *dsLCD = DriverStationLCD::GetInstance();
voltage = elbow->GetValue();
dsLCD->Printf(DriverStationLCD::kUser_Line1, 1,“Voltage is %d”,voltage);
A few things are happening -
- the print out is giving me values of 1441 -ish (was 0 last night), and they don’t change if I vary the input voltage.
- I don’t see any signal on the Analog Input indicators in the I/O window
- I’m gett the following Message in the Diagnostics window:
Fatal error"Attempting to reuse an allocated resource" in Allocate() in C:/windriver/workspace/WPLib/Resource.cpp at line 76
Modifed Network Configuration: Set The object already exists.
I/O unit not detected or not installed correctly.
We are currently running in Autonomous mode.
The analog board is connected to the 9201 which is in slot 1 of the CRIO.
I’ve been working on this for hours, with no luck.
any help is appreciated.