I’m working on a project using the Phidget 1047-1 Highspeed 4-input encoder with 2 draw wire sensors and a rotary encoder. I’m coding in C++ in Visual Studio and trying to handle both encoders and digital inputs using the Phidget22 library.
The code compiles fine, but I’m running into runtime issues and errors that all seem to point to line 1, which makes it hard to debug. I suspect it might be something with how I’m including the header or initializing the devices.
Here’s roughly what I’m doing:
- Creating multiple PhidgetEncoder and PhidgetDigitalInput handles
- Setting serial numbers and channels for each device
- Assigning event handlers (onPositionChange and onStateChange)
- Opening each device with Phidget_openWaitForAttachment
Has anyone successfully used multiple 1047-1 encoders and digital inputs in C++? Any tips on:
Proper header/library includes
Correct event handler setup
Common pitfalls when opening multiple devices simultaneously
Thanks in advance for any help or example snippets!