04.03.2013 Views

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

HEX<br />

HEX{#max} expression{\#min}<br />

#max: optional maximum number of digits to send<br />

#min: optional minimum number of digits to send<br />

Structure - Modifi ers<br />

The HEX modifi er, in output commands, converts stored values to ASCII characters. The example will<br />

format the value of temp so it prints out the number in a terminal window. The output would display<br />

12ab.<br />

temp var word<br />

temp = 0x12ab<br />

serout s_out, i9600, [HEX temp] ;prints “0x12ab”<br />

HEX(#max) variable<br />

#max: optional maximum number of digits to receive<br />

The HEX modifi er, for input commands, formats incoming ASCII characters into a numeric value. The<br />

example will read in ASCII characters that represent hexidecimal numbers up to 8 characters long<br />

and store the converted value in a variable. Until a numeral is received (e.g. “0” to “9” or “a” to “f”) any<br />

incoming characters are ignored. Once a numeral has been received any character not a numeral<br />

will cause the conversion to fi nish before 8 characters have been received.<br />

temp var word<br />

serin s_out, i9600, [HEX temp]<br />

73

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!