Skip to content

API mode

Dilshan R Jayakody edited this page Jul 3, 2019 · 9 revisions

This mode consists of 8 functions and all these functions are described below.

In API mode device accept instructions which start with a combination of header byte (0x5E) and function byte (Fn).

5E|Fn

Following Python sample demonstrate how to display number 6174 using low-level API mode instruction.

import serial

device = serial.Serial('/dev/ttyACM0')
if device.is_open:
	device.write([94, 49, 54, 49, 55, 52, 0, 0, 0, 0, 0, 0])
	device.close()

Python wrapper API for this mode is also available in here


Clear display

Clear all 10 digits of the display module. This function does not require any additional parameters.

5E|30

Function (Fn): 0x30


Set display message

Update display of the module with the specified digit array.

5E|31|M0|M1|M2|M3|M4|M5|M6|M7|M8|M9

Function (Fn): 0x31

M0 - M9: Character array to display on the module.


Set system time

Change the system time of the display module.

5E|32|H0|M0|S0

Function (Fn): 0x32

H0: Hour in 24-hour format. Value of this byte must between 0 to 23.

M0: Minute. Value of this byte must between 0 to 59.

S0: Seconds. Value of this byte must between 0 to 59.


Set system date

Change the system date of the display module. This function is not available in version 1.0 firmware due to the limitation of the STM32F103C series MCUs.

5E|33|D0|M0|Y0

Function (Fn): 0x33

D0: Date. Value of this byte must between 1 to 31.

M0: Month. Value of this byte must between 1 to 12.

Y0: Year as two digits number. Value of this byte must between 0 to 99.


Switch to idle mode

Switch module to the idle mode.

5E|34

Function (Fn): 0x34


Set idle message

Configure message to display on the idle state.

5E|35|M0|M1|M2|M3|M4|M5|M6|M7|M8|M9

Function (Fn): 0x35

M0 - M9: Character array to display on the idle state.


Set idle mode

Configure idle mode.

5E|36|V0

Function (Fn): 0x36

V0: Idle mode value.

Mode (V0) Description
0 Clear display. (Maximum power-saving mode)
1 Display system time
2 Display system date
3 Display custom message

Bell

Activate built-in buzzer.

5E|37

Function (Fn): 0x37