User Manual

MCP Series
Brushed DC Motor Controllers
MCP Series User Manual
147
3.3 MCL Modiers
3.3.1 Output Modiers
Modiers can be use when outputing data using the PUTS command or when storing data in a
variable using the LET(=) command.
An example of a command modier is formatting a decimal value into a printable string. The
decimal value 32 would output to a terminal window as a space character(ASCII code 32 is a
space). Instead, to display the actual decimal value of the variable in a human readable format
you would use the DEC modier:
Temp Var Byte
Temp = 32
puts 0,[DEC TEMP] ;send the ascii characters “32” to the USB port
This code snippet above will send the ascii characters “3” and “2” to the USB port. If the DEC
modier was not used, a space character (“ “), binary value 32, would be sent instead
Modiers can be used to modify values stored in arrays with the LET(=) commands:
string var byte(100)
string = “Hello World” ;string(0-10)=”Hello World”
string = dec 1234567 ;string(0-6)=”1234567”
string = ihex 0x3456 ;string(0-4)=”$3456”
3.2.2 Modiers
Name Description
DEC Decimal
SDEC Signed Decimal
HEX Hexadecimal
IHEX Indicated ($) Hexadecimal
REP Repeat character n times
REAL Floating point number with decimal point
STR Write specied number of characters(can be used to copy arrays)