04.03.2013 Views

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SBIN<br />

SBIN{#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 SBIN modifi er, in output commands, converts stored values to ASCII characters. The example<br />

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

display 1100.<br />

temp var sword<br />

temp = -0x0C<br />

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

SBIN(#max) variable<br />

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

The SBIN 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 negative sign or numeral is received (e.g. “0” to<br />

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

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

temp var sword<br />

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

78

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

Saved successfully!

Ooh no, something went wrong!