An Arduino support package provides a number of libraries, #defines and objects that facilitate the development and so does the dice support package:
Core libraries & global objects
The object ‘Serial’ in the Arduino environment is a commonly known object for every developer creating applications for Arduino boards. The dice-support package delivers further objects of classes that are integrated in the core:
Core Class | Global Instance |
---|---|
BOOTLOADER_SETTINGS library | BOOTLOADER_SETTING |
SAMC21_CAN library | MCAN0 / MCAN1 (*) |
CAN2SER library | Serial |
Just like the pin-define ‘LED_BUILTIN’ in Arduino, there are further #defines depending on the hardware capabilities of the device variant.
Link: Pin assignment
The following #defines are pin numbers:
DICE-CPU
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the CAN transceiver |
#define | description |
DOUT1 | dig. outputs PIN1/3; controls the high side output switches on PIN1/3. |
DIN1 | dig. inputs (PIN 1/3); to read the dig. input value of PIN1/3. |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
ACC_WKUP | internal dig. input signal; reads the ‘interrupt’ output of the acceleration sensor that is used to wake up the device on motion. |
Objects & defines
#define | object | description |
DICE_CPU | a define to identify the hardware variant dice-CPU for | |
Recommended standard libraries & objects for dice-CPU
library | object | description |
#include “LowPowerSAMC.h” | LowPower | Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | Allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see also LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <DFRobot_LIS2DH12.h> | ACC | this object allows to work with the acceleration sensor (e.g. setting the measuring range, reading the current values and configuring wakeup settings. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistenten data within the application flash memory area. |
DICE-WiFi
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the CAN transceiver and the WiFi module supply. |
#define | description |
DOUT1 | dig. outputs PIN1/3; controls the high side output switches on PIN1/3. |
DIN1 | dig. inputs (PIN 1/3); to read the dig. input value of PIN1/3. |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
ACC_WKUP | internal dig. input signal; reads the ‘interrupt’ output of the acceleration sensor that is used to wake up the device on motion. |
Objects & defines
#define | object | description |
DICE_WIFI | a define to identify the hardware variant dice-WiFi for | |
Recommended standard libraries & objects for dice-WiFi
library | object | description |
#include <WiFiNINA.h> | WiFi | object auto created by including the library to operate the WiFi features of the dice-WiFi. Hint: use the WiFiHTTPClient for http-GET and POST requests. |
#include <ArduinoBLE.h> | BLE | object auto created by the library to run the dice-WiFi in bluetooth low energy mode (BLE). |
#include “LowPowerSAMC.h” | LowPower | autom. created instance by including the library. Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | object that is autom. created by including the library. It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <DFRobot_LIS2DH12.h> | ACC | this object allows to work with the acceleration sensor (e.g. setting the measuring range, reading the current values and configuring wakeup settings. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
DICE-GNSS
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the CAN transceiver. It also controls the supply of an external gnss antenna and puts the gnss module standby mode. |
#define | description |
DOUT1 | dig. outputs PIN1/3; controls the high side output switches on PIN1/3. |
DIN1 | dig. inputs (PIN 1/3); to read the dig. input value of PIN1/3. |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
ACC_WKUP | internal dig. input signal; reads the ‘interrupt’ output of the acceleration sensor that is used to wake up the device on motion. |
MOD_RESET | internal output signal controlling the reset pin of the GNSS module (high-active / 20ms pulse) |
Objects & defines
#define | object | description |
DICE_GNSS | a define to identify the hardware variant dice-GNSS(e) for | |
SERIAL_GPS | object that represents the serial (Uart) interface to the internal GNSS receiver. This is normally handled by the DICE_GPS- Library | |
SERIAL_GPS_BAUD | defines the default baud rate to communicate to the embedded GNSS receiver. |
Recommended standard libraries & objects for dice-GNSS
library | object | description |
#include “DICE_GPS.h” | GPS | this library creates the global object GPS that allows to read the positioning information. It also distributes the datapool holding the gnss information and time for other devices on the CAN bus. |
#include “LowPowerSAMC.h” | LowPower | Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | object that is autom. created by including the library. It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <DFRobot_LIS2DH12.h> | ACC | this object allows to work with the acceleration sensor (e.g. setting the measuring range, reading the current values and configuring wakeup settings. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
DICE-USB
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the two CAN transceivers. |
#define | description |
DOUT1 | dig. outputs PIN1/3; controls the high side output switches on PIN1/3. |
DIN1 | dig. inputs (PIN 1/3); to read the dig. input value of PIN1/3. |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
ACC_WKUP | internal dig. input signal; reads the ‘interrupt’ output of the acceleration sensor that is used to wake up the device on motion. |
USB_WKUP_PIN | internal input signalling that the device is connected to an USB host. Used for wake-ups by USB. see DICE->Basics->UsingPins and the console example. |
Objects & defines
#define | object | description |
DICE_USB | a define to identify the hardware variant dice-USB for | |
SerialUSB | Uart-Object to communicate to the host PC connected via USB. | |
SerialUSBBaud | default + initial baud rate (115200) of the embedded USB-serial converter interface. |
Recommended standard libraries & objects for dice-USB
library | object | description |
Uart | SerialUSB | This is the instance of the Uart library representing the interface to the internal UART-USB converter. It is pre-initialised at startup to SerialUSBBaud and can be used right away. |
#include “LowPowerSAMC.h” | LowPower | Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <DFRobot_LIS2DH12.h> | ACC | this object allows to work with the acceleration sensor (e.g. setting the measuring range, reading the current values and configuring wakeup settings. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
DICE-SD
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the two CAN transceivers. It also controls the supply of the SD-card (e.g. used in sleep-mode). |
#define | description |
DOUT1 | dig. outputs PIN1/3; controls the high side output switches on PIN1/3. |
DIN1 | dig. inputs (PIN 1/3); to read the dig. input value of PIN1/3. |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
ACC_WKUP | internal dig. input signal; reads the ‘interrupt’ output of the acceleration sensor that is used to wake up the device on motion. |
Objects & defines
#define | object | description |
DICE_SD | a define to identify the hardware variant dice-SD for | |
SD | the object SD will be created by including the library include<SD.h> |
Recommended standard libraries & objects for dice-SD
library | object | description |
#include <SD.h> | SD | This object represents the starting point of the SD-card operations in the script. It is used to read, write, list etc. files on the SD card. |
#include “LowPowerSAMC.h” | LowPower | Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <DFRobot_LIS2DH12.h> | ACC | this object allows to work with the acceleration sensor (e.g. setting the measuring range, reading the current values and configuring wakeup settings. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
DICE-RS485
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
#define | description |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the CAN transceiver. |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
Objects & defines
#define | object | description |
DICE_RS485 | a define to identify the hardware variant dice-RS485 for | |
SERIAL_RS485 | Uart instance of the interface to the internal RS485 transceiver. This object is normally used by the supporting libraries (ArduinoRS485.h) and not used by the user script directly. | |
SERIAL_RS485_BAUDRATE | default baud rate of the RS485 UART (9600 baud) |
Recommended standard libraries & objects for dice-RS485
library | object | description |
#include <ArduinoRS485.h> | RS485 | this object will be created when the library is included in the script. It provides functions to do low level (read, write etc.) operations on the RS485 interface. |
#include <ArduinoModbus.h> | ModbusRTUClient ModbusRTUServer | this object let the user sketch act as client or server on the serial mod-bus interface on the dice-RS485 at PIN7-A/D+ PIN9-B/D-. |
#include “LowPowerSAMC.h” | LowPower | Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib). |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
DICE-RS232
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
#define | description |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the CAN transceiver. It also controls the RS232 transceiver to ensure it is switched off during sleep mode. |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
Objects & defines
#define | object | description |
DICE_RS232 | a define to identify the hardware variant dice-RS232 for | |
RS232_1 | Uart-instance of the interface to the internal RS232 transceiver at dice PIN7-TX / PIN9-RX. | |
RS232_1_BAUD | default (initial) baud rate of the RS232 UART (115200 baud) | |
RS232_2 | Uart-instance of the interface to the internal RS232 transceiver at dice PIN1-TX / PIN3-RX. | |
RS232_2_BAUD | default (initial) baud rate of the RS232 UART (115200 baud) |
Recommended standard libraries & objects for dice-RS232
library | object | description |
#include “LowPowerSAMC.h” | LowPower | autom. created instance by including the library. Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | object that is autom. created by including the library. It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
DICE-LoRa
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the CAN transceiver. It also controls the supply of an external gnss antenna and puts the gnss module standby mode. |
#define | description |
DOUT1 | dig. outputs PIN1/3; controls the high side output switches on PIN1/3. |
DIN1 | dig. inputs (PIN 1/3); to read the dig. input value of PIN1/3. |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
ACC_WKUP | internal dig. input signal; reads the ‘interrupt’ output of the acceleration sensor that is used to wake up the device on motion. (*) |
LORA_RESET | internal output signal controlling the reset pin of the LoRa module (low active) – this pin is used by supporting libraries (MKRWAN) |
Objects & defines
#define | object | description |
DICE_LORA | a define to identify the hardware variant dice-LoRa for | |
SERIAL_GPS | object that represents the serial (Uart) interface to the internal GNSS receiver. | |
SERIAL_GPS_BAUD | defines the default baud rate to communicate to the embedded GNSS receiver. It might be handy in case the interface needs to be reinitialised (e.g. after sleep mode) | |
SerialLoRa | Uart object used by the MKRWAN library to talk to the LoRa module. |
Recommended standard libraries & objects for dice-GNSS
library | object | description |
#include “MKRWAN.h” | LORA | instance created by the library to use the LoRaWAN features of the device. |
#include “DICE_GPS.h” | GPS | this library creates the global object GPS that allows to read the positioning information. It also distributes the datapool holding the gnss information and gps-time to other devices on the CAN bus. |
#include “LowPowerSAMC.h” | LowPower | autom. created instance by including the library. Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | object that is autom. created by including the library. It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <DFRobot_LIS2DH12.h> | ACC | this object allows to work with the acceleration sensor (e.g. setting the measuring range, reading the current values and configuring wakeup settings. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
DICE-IoT
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the two CAN transceivers and the iButton interface. It also controls the supply of an external gnss antenna and puts the gnss module in standby mode. |
ENABLE_3V8 | internal dig. output signal that controls the power supply of the modem (high active), controlled by the DICENB Lib. |
#define | description |
DOUT1 | dig. outputs PIN1; controls the high side output switch on PIN1. |
DIN1 | dig. inputs (PIN 1/3); to read the dig. input value of PIN1/3. Since there is also the iButton interface on PIN3, DIN3 always reads high (but in case of a short circuit to gnd) |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
ACC_WKUP | internal dig. input signal; reads the ‘interrupt’ output of the acceleration sensor that is used to wake up the device on motion. |
MODEM_PWR_ON_N | internal output signal to control the power mode of the modem. Controlled by the library. |
Objects & defines
#define | object | description |
DICE_IOT | a define to identify the hardware variant dice-IoT for | |
SerialAT | Uart interface to the CATM1, 2G modem used by libraries (DICENB). | |
SerialATBaud | default baud rate (also used by lib) | |
SERIAL_GPS | object that represents the serial (Uart) interface to the internal GNSS receiver. | |
SERIAL_GPS_BAUD | defines the default baud rate to communicate to the embedded GNSS receiver. It might be handy in case the interface needs to be reinitialised (e.g. after sleep mode) |
Recommended standard libraries & objects for dice-IoT
library | object | description |
#include <DICENB.h> | LTE CAT-M1, 2G library to access the internet. | |
#include <OneWire.h> | oneWire | DS2482_OneWire library creating the object oneWire to read the iButtons numbers connected to the 1wire interface at PIN3. |
#include “DICE_GPS.h” | GPS | this library creates the global object GPS that allows to read the positioning information. It also distributes the datapool holding the gnss information and time to other devices on the CAN bus. |
#include “LowPowerSAMC.h” | LowPower | autom. created instance by including the library. Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | object that is autom. created by including the library. It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <DFRobot_LIS2DH12.h> | ACC | this object allows to work with the acceleration sensor (e.g. setting the measuring range, reading the current values and configuring wakeup settings. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
DICE-IO
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the CAN transceiver. It also switches the analog inputs off (high impedance state to prevent currents during sleep/off mode). |
#define | description |
DOUT1 DOUT3 | dig. outputs PIN1/3/7/9; controls the high side output switch on PIN1/3/7 & 9. |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
Objects & defines
#define | object | description |
DICE_IO | a define to identify the hardware variant dice-IO for |
Recommended standard libraries & objects for dice-GSM
#include <DICE_Analog.h> | DICE_ANALOG_INPUTS | AD converter library creates this object that is used to read the analog values of PIN1,3,7,9. |
#include “LowPowerSAMC.h” | LowPower | autom. created instance by including the library. Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | object that is autom. created by including the library. It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
DICE-iButton
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the two CAN transceivers and the iButton interface. |
#define | description |
DOUT1 | dig. outputs PIN1; controls the high side output switch on PIN1. |
DIN1 | dig. inputs (PIN 1/3); to read the dig. input value of PIN1/3. Since there is also the iButton interface on PIN3, DIN3 always reads high (but in case of a short circuit to gnd) |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
ACC_WKUP | internal dig. input signal; reads the ‘interrupt’ output of the acceleration sensor that is used to wake up the device on motion. |
Objects & defines
#define | object | description |
DICE_IBUTTON | a define to identify the hardware variant dice-iButton for |
Recommended standard libraries & objects for dice-IoT
library | object | description |
#include <OneWire.h> | oneWire | DS2482_OneWire library creating the object oneWire to read the iButtons numbers connected to the 1wire interface at PIN3. |
#include “LowPowerSAMC.h” | LowPower | autom. created instance by including the library. Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | object that is autom. created by including the library. It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <DFRobot_LIS2DH12.h> | ACC | this object allows to work with the acceleration sensor (e.g. setting the measuring range, reading the current values and configuring wakeup settings. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
DICE-ETH
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the CAN transceiver and the ethernet mac+phy, so that is switched off during sleep mode. |
#define | description |
DOUT1 | dig. outputs PIN1/3; controls the high side output switches on PIN1/3. |
DIN1 | dig. inputs (PIN 1/3); to read the dig. input value of PIN1/3. |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
ACC_WKUP | internal dig. input signal; reads the ‘interrupt’ output of the acceleration sensor that is used to wake up the device on motion. |
ETHERNET_RESETN | internal signal. Low active reset pin of the ethernet interface IC. |
Objects & defines
#define | object | description |
DICE_ETH | a define to identify the hardware variant dice-ETH for | |
Recommended standard libraries & objects for dice-ETH
library | object | description |
#include “DICE_Ethernet.h” | Ethernet | object created by the library to facilitate the ethernet interface of the device. Hint: use the EthernetHTTPClient for http-GET and POST requests. |
#include “LowPowerSAMC.h” | LowPower | autom. created instance by including the library. Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | object that is autom. created by including the library. It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <DFRobot_LIS2DH12.h> | ACC | this object allows to work with the acceleration sensor (e.g. setting the measuring range, reading the current values and configuring wakeup settings. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
DICE-2CAN
#define | description |
LED_BUILTIN | internal dig. output to control the LED |
IGNITION | dig. input pin (PIN2) |
SELFHOLD | internal dig. output signal; if set to high, it keeps the device (voltage converters) running even when the IGNITION pin goes low |
ENABLE_5V0 | internal dig. output signal; If set to high, it enables the 5V boost converter that supplies the two CAN transceivers. |
#define | description |
DOUT1 DOUT3 | dig. outputs PIN1 & 3; controls the high side output switches on PIN1 and 3. |
DIN1 | dig. inputs (PIN 1/3); to read back the dig. input value of PIN1/3. |
getUBatt | a define returning the float value of Ubatt, the voltage on PIN 4 |
ACC_WKUP | internal dig. input signal; reads the ‘interrupt’ output of the acceleration sensor that is used to wake up the device on motion. |
Objects & defines
#define | object | description |
DICE_2CAN | a define to identify the hardware variant dice-2CAN for |
Recommended standard libraries & objects for dice-IoT
library | object | description |
#include “LowPowerSAMC.h” | LowPower | autom. created instance by including the library. Provides means to configure the wakeup sources and to put the device into low power sleep mode. |
#include “RTCSAMC.h” | rtc | object that is autom. created by including the library. It allows to set and read the hardware real time clock and set alarms (e.g. for wakeups, see LowPower lib) |
#include “SerialFlash.h” | SerialFlash | the library autom. creates this object. It let you create, read, write etc. files in the serial flash that each dice-device has on board. |
#include <DFRobot_LIS2DH12.h> | ACC | this object allows to work with the acceleration sensor (e.g. setting the measuring range, reading the current values and configuring wakeup settings. |
#include <FlashStorage.h> | This library allows to create, read, write etc. persistente data within the application flash memory area. |
List of libraries that are part of the dice support package
The following libraries are included by the support package:
- Created or branched by dice
click on (*) for console application examples
- Provided by various authors (e.g. Arduino)
Hint: Find usage examples for the libraries above which are included in the dice-package in the Arduino IDE.
The source code of the libraries can be found locally on your computer here:
C:\Users\yourName\AppData\Local\Arduino15\packages\dice\hardware\samc\1.0.0\libraries