SX/B SHIFTOUT - Multiple data in one command?

SX/B SHIFTOUT - Multiple data in one command
·
Is there a way in SX/B to have SHIFTOUT send multiple values?
·
PBASIC has option for multiple [noparse][[/noparse]OutputData {\Bits}
SHIFTOUT Dpin, Cpin, Mode, [noparse][[/noparse]OutputData {\Bits} {,OutputData {\Bits}...}]
SX/B seems to not have that option
SHIFTOUT DPin, CPin, ShiftMode, Value {\Count} {, SpeedMult}
·
I searched Parallax site for SX/B “shiftout multiple values” and got no applicable results.
(The SX/B {\Count} provides for sending other then 8 bits, but that is not the question.)
·
Specifically, what is the best way to translate the following PBASIC to SX/B?
SHIFTOUT PinData, PinClock, LSBFIRST, Datum1, Datum2, Datum3, Datum4
Thanks.
·
·
·
Is there a way in SX/B to have SHIFTOUT send multiple values?
·
PBASIC has option for multiple [noparse][[/noparse]OutputData {\Bits}
SHIFTOUT Dpin, Cpin, Mode, [noparse][[/noparse]OutputData {\Bits} {,OutputData {\Bits}...}]
SX/B seems to not have that option
SHIFTOUT DPin, CPin, ShiftMode, Value {\Count} {, SpeedMult}
·
I searched Parallax site for SX/B “shiftout multiple values” and got no applicable results.
(The SX/B {\Count} provides for sending other then 8 bits, but that is not the question.)
·
Specifically, what is the best way to translate the following PBASIC to SX/B?
SHIFTOUT PinData, PinClock, LSBFIRST, Datum1, Datum2, Datum3, Datum4
Thanks.
·
·
Comments
This is similar to SEROUT in SX/B. Only one byte at a time.
The best way to handle this is to make a subroutine to do the SHIFTOUT. Then call the subroutine for each byte that needs sent.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Teacher: What is the difference between ignorance and apathy ?
Student: I don't know and I don't care
Teacher: Correct !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
As Bean stated use subroutines like these for SEROUT but modify them for SHIFTOUT.
Post Edited (T&E Engineer) : 8/6/2007 11:37:09 AM GMT
But I'm having problems sending the contents of a byte size varible. What if you had these lines of code:
Price VAR byte
Price = 50
And you wanted to get the value in Price to show up on the LCD?
If I use: LCD_OUT 50 then I get the ASCII character #50 which is the numeral two.
If I use: LCD_OUT Price then I still get the numeral two.
In the end, I want the value of a byte size variable to show up on the screen as a number between 0 and 255. I think this would be a common need; your project senses or calculates a byte sized value and you want to use the LCD so the user can see that value
Thanks.
You may want to also take a look at this posting. Jon has code listed as SERIAL_LCD_DEMO.sxb and mine is LCD_Serial_RevE.sxb.
They show how to·display numbers 0-99 (or more) to the LCD.
http://forums.parallax.com/showthread.php?p=560786
·Bean also has a very good method that I am using in my current LCD project.
http://forums.parallax.com/showthread.php?p=603003
My project:
http://forums.parallax.com/showthread.php?p=660476
(code posted too).
Post Edited (T&E Engineer) : 8/7/2007 12:40:18 AM GMT