User Manual
MCP Series
Brushed DC Motor Controllers
MCP Series User Manual
151
IHEX
IHEX{#max} expression{\#min}
#max: optional maximum number of digits to send
#min: optional minimum number of digits to send
The IHEX modier, in output commands, converts stored values to ASCII characters. The
example will format the value of temp so it prints out the number in a terminal window. The
output would display $12ab.
temp var word
temp = 0x12ab
puts 0, [SHEX temp] ;prints “$12ab”
IHEX(#max) variable
#max: optional maximum number of digits to receive
The IHEX modier, for input commands, formats incoming ASCII characters into a numeric
value. The example will read in ASCII characters that represent hexidecimal numbers up to 8
characters long and store the converted value in a variable. Until the indicator ($) is received,
any incoming characters are ignored. Once the indicator has been received any character not a
numeral will cause the conversion to nish before 8 characters have been received.
temp var word
puts 0, [IHEX temp]
REP
The REP modier will output the character n a specied number of times. The example will
repeat the specied character “A” 10 times.
puts 0, [REP “A”\10] ;prints A 10 times