/      日本語

act Samples

Latest Edition
The MWSDK/Act_Samples directory contains sample programs for act.

Introduction to Samples

Below are acts introduced by purpose.

Short acts using only microcontroller functions without wireless communication

act0..4

These are very simple examples that do not use wireless functions. You can understand the basic structure of act.

Example of act description using I2C sensor

This is an example of a wireless sensor implementation that connects an I2C sensor and sends wireless packets while operating simply with sleep.

BRD_I2C_TEMPHUMID

Includes typical elements for implementing wireless sensors with TWELITE (use of simple relay network <NWK_SIMPLE>, interactive mode <STG_STD>, handling of I2C sensor Wire, intermittent operation by sleep, etc.).

Basic acts that perform wireless communication

These are samples that send or send/receive wireless packets, each implemented from slightly different perspectives.

Scratch

A simple code that receives a 1-byte command from UART and performs transmission etc.

Slp_Wk_and_Tx

Uses a state machine and intermittent operation with sleep, repeating sleep wake-up → wireless transmission → sleep.

PingPong

A sample that sends packets from one side to the other, and the receiver sends back packets. It includes basic procedures for sending and receiving.

WirelessUART

Interprets ASCII format using serparser from UART input and then transmits it.

Acts for the parent device side

Please refer when implementing your own receiving parent application.

Parent-MONOSTICK

Only receives and outputs the reception result to the serial port. It can receive wireless packets addressed to the parent device (0x00) or child broadcast (0xFE). It also includes procedures to add interactive mode <STG_STD> to act.

Rcv_Univsl

Sample code for a universal packet receiver (TWENET layer tree network, App_Twelite, act, etc.). It also uses the EASTL library for containers and algorithms.

Acts for adding interactive mode

The explanation of acts using interactive mode describes the general flow (here quoting the above BRD_I2C_TEMPHUMID). There is not much difference in the explanation of any sample.

BRD_I2C_TEMPHUMID

Executes read/write commands for I2C sensor devices and wirelessly transmits measurement values obtained from the I2C sensor. It also includes procedures to add interactive mode <STG_STD> to act.

Settings

Performs more advanced customization of interactive mode <STG_STD>. Please refer to the code for details.

Acts for operating sensors and other devices

Samples that obtain sensor information from built-in peripherals or external sensor devices.

BRD_APPTWELITE

Performs two-way communication using digital input, analog input, digital output, and analog output. It also includes procedures to add interactive mode <STG_STD> to act.

BRD_I2C_TEMPHUMID

Executes read/write commands for I2C sensor devices and wirelessly transmits measurement values obtained from the I2C sensor. It also includes procedures to add interactive mode <STG_STD> to act.

PulseCounter

Uses the pulse counter function to count pulses detected at the input port, including during sleep, and wirelessly transmits them.

PAL_AMB_behavior

An example using behavior. In PAL_AMB, the temperature and humidity sensor is called inside the library code, but this sample includes its own procedures for accessing the temperature and humidity sensor.

Acts for using TWELITE PAL

TWELITE PAL has standard PAL apps written, but you can also write acts without using PAL apps. The MWX library provides standard procedures for operating sensors used in PAL.

Samples for various PAL boards. They obtain sensor values on PAL boards, transmit, and sleep.

  • PAL_AMB
  • PAL_MOT-single
  • PAL_MAG

The following are advanced examples with slightly more complex descriptions than the above acts.

  • PAL_AMB_usenap is a sample aiming for lower power by putting the TWELITE microcontroller to sleep briefly during the tens of milliseconds sensor operation time.
  • PAL_AMB_behavior is an example using behavior. In PAL_AMB, the temperature and humidity sensor is called inside the library code, but this sample includes its own procedures for accessing the temperature and humidity sensor.
  • PAL_MOT_fifo is a sample that continuously acquires and wirelessly transmits acceleration sensor FIFO data and FIFO interrupts without interrupting the sample.

Acts for using TWELITE CUE

The PAL_MOT act is available. Minor modifications may be required.

  • PAL_MOT-single
  • PAL_MOT_fifo is a sample that continuously acquires and wirelessly transmits acceleration sensor FIFO data and FIFO interrupts without interrupting the sample.

Acts for using TWELITE ARIA

  • BRD_ARIA is an act for operating TWELITE ARIA.
  • BRD_I2C_TEMPHUMID is a template for using I2C sensors, but includes code for the SHT40 sensor used with TWELITE ARIA as an implementation example.
  • Can be used by modifying acts for PAL_AMB.

Acts introducing individual functions

Unit-* are intended to introduce functions and APIs.

Obtaining the Latest Edition

Common Descriptions

The following items are common settings in act samples and are explained below.

const uint32_t APP_ID = 0x1234abcd;
const uint8_t CHANNEL = 13;
const char APP_FOURCHAR[] = "BAT1";

act0..4

Simple acts to try first

Scratch

Template code

Slp_Wk_and_Tx

Transmits a packet upon waking from sleep

Parent_MONOSTICK

Parent application (for MONOSTICK)

PingPong

Send and receive packets

BRD_APPTWELITE

Digital and Analog Signal Transmission

BRD_I2C_TEMPHUMID

Transmit data from I2C sensor devices

BRD_ARIA

Sample using TWELITE ARIA

PAL_AMB

Sample using the environmental sensor PAL

PAL_AMB-usenap

Sample using the environmental sensor Pal

PAL_AMB-behavior

Sample using the environmental sensor PAL

PAL_MAG

Sample using magnetic sensor pal

PAL_MOT-single

Sample using motion sensor pal

PAL_MOT-fifo

Sample using motion sensor pal

PulseCounter

Sample using pulse counter

WirelessUART

Performs serial communication.

Universal Receiver

Receives various types of packets

Unit_???

Sample for verifying the operation of single functions