useMultipleSensors | |
Testscript for using up to four sensors on one SPI channel.
This example program starts one to four sensors on one SPI line with different CS pins and returns the angle value together with the safety word and the status register SNR. Due to the selected slave number the SNR will be set to 0x00, 0x01, 0x10 or 0x11. When you fetch a value from the sensor with safety word on, than the safety word register RESP will indicate the sensor who is responding. This should be the same than you have ask for. The loop function will than print out the individual sensor(s) angle values. This example also demonstrates how to handle more than on sensor in an array setup. SPDX-License-Identifier: MIT | |
#define | SENSOR_NUM 1 |
number of connected sensors More... | |
#define | CS_PIN_SENSOR_1 10 |
define more unique chipselect pins for more connected Sensors More... | |
#define | CS_PIN_SENSOR_2 5 |
This is also a setup for the Sensor2Go kit but with a second sensor attached. More... | |
Tle5012Wiced | sensor [SENSOR_NUM] |
Tle5012b Object, set/remove depending on the number of connected sensors. More... | |
errorTypes | checkError = NO_ERROR |
Sensor IFX SIL(TM) errorCheck. More... | |
double | d [4] = {0.0, 0.0, 0.0, 0.0} |
array if the read angle values and revolutions More... | |
int16_t | r [4] = {0, 0, 0, 0} |
void | setup () |
void | loop () |
void | application_start () |
#define SENSOR_NUM 1 |
number of connected sensors
#define CS_PIN_SENSOR_1 10 |
define more unique chipselect pins for more connected Sensors
This is a setup for the default Arduino, use 3 for the Sensor2Go kit
#define CS_PIN_SENSOR_2 5 |
This is also a setup for the Sensor2Go kit but with a second sensor attached.
void setup | ( | ) |
void loop | ( | ) |
void application_start | ( | ) |
Tle5012Wiced sensor[SENSOR_NUM] |
Tle5012b Object, set/remove depending on the number of connected sensors.
errorTypes checkError = NO_ERROR |
Sensor IFX SIL(TM) errorCheck.
double d[4] = {0.0, 0.0, 0.0, 0.0} |
array if the read angle values and revolutions
int16_t r[4] = {0, 0, 0, 0} |