Page 1 of 1

PhidgetSpatial function not declared for Arduino

Posted: Wed Jan 20, 2021 6:03 pm
by ptalbot
I have a Teensy4.1 board, which is an Arduino. On windows, I use the tool Arduino 1.8.13 to compile the C code. I've loaded the library phidget21 and I have included the library.

The code is:

#include <phidget21.h>

void setup()
{
...
CPhidgetSpatialHandle spatial = 0;
CPhidgetSpatial_create(&spatial);
CPhidget_open((CPhidgetSpatialHandle)spatial, -1);
result = CPhidget_waitForAttachment((CPhidgetSpatialHandle)spatial, 10000);

When I compile, I get the error 'CPhidgetSpatial_create' was not declared in this scope.

Any idea why?

Re: PhidgetSpatial function not declared for Arduino

Posted: Thu Jan 21, 2021 9:12 am
by mparadis
Phidgets can only be used with computers that are running Windows, macOS, Linux, iOS or Android.

If you need something small, a Raspberry Pi zero is probably your best option.

The other option if space/portability is a concern would be to use a Wifi VINT Hub (HUB5000) and one of our VINT Spatials, and then use another computer on the same wifi network to access the spatial over the Network Server.

Re: PhidgetSpatial function not declared for Arduino

Posted: Thu Jan 21, 2021 2:33 pm
by ptalbot
Does the library can be compiled for the Arduino? Or do you have any plan to support the Arduino?

PhidgetSpatial would have been convenient to use since the Teensy 4.1 has a USB port.

Re: PhidgetSpatial function not declared for Arduino

Posted: Thu Jan 21, 2021 3:00 pm
by mparadis
We don't have any plans to support USB-enabled Arduino boards.

If you're set on using the Teensy, there are plenty of arduino-compatible accelerometer/IMU breakout boards out there that communicate over I2C or serial.