This category consists of execution related instructions such as sequential and conditional branching. Down counting timer and delay insertion are also included in this category.
Send a specific value to digital output pins, setting them to HIGH or to LOW.
The on-board mono colour LEDs are indicators of the output pins, a HIGH turns the corresponding LED on, a LOW turns it off.
tip
Digital output pins are typically used to drive electronic modules such as motor driver, power relay and so on.
caution
Some digital output pins may be occupied by specific modules or become not available as digital output pins when ultrasonic distance detector or MIDI player functions are enabled.
warning
Digital output pins can not afford high power load such as motors, they work on logic level only.
INST_DIGITAL_OUTPUT
HEX
sOP00
sOP01
sOP10
sOP11
Set DO0 to HIGH
01
00
00
00
01
Set DO3-DO0 with HIGH, LOW, LOW, HIGH
01
00
FF
00
09
Notice in the second example the 4 digital output pins are set to b1001 in consistent of the desired HIGH, LOW, LOW, HIGH:
(1001)2=23+20=9⋅160=(09)16
There for sOP11 should be 0x09.
Set one digital output pin
OP/sOP
Value
Remark
sOP00
00
Ignored
sOP01
00~03
Select output pin LED0~LED3 (DO0~DO3)
sOP10
00
Ignored
sOP11
00
Set digital output HIGH
01
Set digital output LOW
Set all digital output pins
OP/sOP
Value
Remark
sOP00
00
Ignored
sOP01
FF
Use bitwise digital output configuration
sOP10
00
Ignored
sOP11
00~0F
Corresponding hexadecimal value for digital output pins
Set a down counter as timer, the length is determined by a literal value or a register value, plus the unit specified in opcode. Register R23 is set to 0001; when the down counting is done, R23 is reset to 0000, indicating that the down counting reaches the end.
tip
Setting timer does not change the program counter and the execution order of lines.
caution
Down counter register R23 can be used as a regular user register, it's value will be overwritten when setting the timer or at time out.
INST_SET_TIMER
HEX
OP-0
OP-1
Set a 5000 ms timer
03
1388
0000
Set a 10 s timer
03
000A
0001
info
OP/sOP
Value/Range
Remarks
OP-0
0000~FFFF
Down counting value
OP-1
0000
Unit: millisecond
0001
Unit: second
0002
Unit: minute
0x04 Conditional Jump: Greater than Literal Value
If value stored in register R00 is greater than the given literal, jump to target line, otherwise continue running to the next line.
INST_JUMP_IF_REG0_GR
HEX
OP-0
OP-1
If value in R00 is greater than 00FF,jump to line 01C0
Compare the value stored in register R00 with that in a selected register, giving a judge condition, if the equality/inequality establishes, jump to target line, otherwise continue running to the next line.
INST_JUMP_CONDITION
HEX
sOP00
sOP01
OP-1
If value in R00 is not equal to that in R05,jump to line 0030
0A
02
05
0030
If value in R00 is greater than that in R05,jump to line 0040
The call instruction interrupts the flow of a program and jump to a target subroutine. A return instruction is needed to go back to the interrupted position.
tip
Multi-level Call+Return is supported.
caution
The target subroutine must contain a 0D instruction to return to the interrupted position to continue.