Sample ACTs
Sample Acts
最終更新
Sample Acts
最終更新
To help you understand how the ACT works, we have prepared some samples.
Several samples are provided to help you understand how the act works.
is a very simple example, without any radio functions, to give you an idea of the basic structure of Act.
This is an example of a wireless sensor implementation that connects an I2C sensor and sends wireless packets while performing a brief operation by sleeping. Since this is a relatively simple and typical structure, it is recommended that you refer to it after reviewing act0
through act4
.
Typical elements for implementing wireless sensors in TWELITE (, , , intermittent operation with sleep, etc.).
These are samples of sending or receiving wireless packets, each implemented from a slightly different perspective.
is a simple code that receives 1 byte commands from the UART, sends them and so on.
uses a state machine and intermittent operation with sleep, repeating the process of sleep recovery, radio transmission and sleep.
is a sample of sending packets from one side to the other and receiving packets back by the other side. It contains basic procedures for sending and receiving.
interprets the UART input into ASCII format using and sends it.
Refer to this when implementing your own Receiving Parent Node application.
The explanation of the ACT using Interactive settings mode describes the general flow of the program. There are no major differences between the explanations for any of the samples. (Here we quote BRD_I2C_TEMPHUMID)
This sample obtains sensor information from built-in peripherals and external sensor devices.
Although a standard PAL application is written into TWELITE PAL, it is possible to write a description using ACT without using the PAL application. The MWX library provides standard procedures for MOTION SENSE PAL use.
This is a sample for various PAL boards. This sample acquires sensor values, transmits these valuse, and sleeps on the PAL board.
The following is an example of an advanced application, which is a little more complicated to describe than the above ACT.
The following items are common settings in the Act sample and are explained below.
Note: can also be used to receive wireless packets for the ACTs included in this sample.
exclusively receives and outputs the reception result to the serial port. The wireless packets in this sample, which are addressed to the parent device (0x00) or to the child device broadcast (0xFE), can be received. It also includes a procedure to add the interactive mode to Act.
is an example code for universal packets receiver (e.g. TWENET layered tree network, App_Twelite, Act, ...). It alse uses EASTL library for container or some algorithm.
executes I2C sensor device read/write commands and wirelessly transmits measurements obtained from I2C sensors. It also uses the Interactive settings mode to Act.
Setting provides a higher degree of customisation of the interactive mode .
executes I2C sensor device read/write commands and wirelessly transmits measurements obtained from I2C sensors. It also uses the Interactive settings mode to Act.
provides bidirectional communication using digital input, analogue input, digital output and analogue output. It also contains the procedure for adding the interactive mode to Act.
uses a pulse counter function to count the number of pulses detected on the input port, even during sleep, and to transmit this data wirelessly.
is a behavioural example: in PAL_AMB the temperature and humidity sensors are called by the code inside the library, but this sample also includes its own procedure for accessing the temperature and humidity sensors via I2C bus.
is a sample that aims to save more power by allowing the TWELITE microcontroller to sleep briefly during the sensor's operating time, which can take several tens of milliseconds.
is a behavioural example: in PAL_AMB the temperature and humidity sensors are called by the code inside the library, but this sample also includes its own procedure for accessing the temperature and humidity sensors via I2C bus.
for continuous acquisition and wireless transmission of samples without interruption, using the accelerometer's FIFO and FIFO interrupts.
Acts with names starting with are intended to introduce features and APIs.