What is the NOT for multi I/O PINs w/ PropBasic?
$WMc%
Posts: 1,884
Hello
·I need to invert the states of a pin group. "LEDs· PIN··15..12 LOW".
"TOGGLE" will do one PIN, I need to invert 4 pins·.
·I need to change this·%1111 to this·%0000
Thanks·in advance for any help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
You can feel stupid by asking a stupid question or You can be really·stupid by not asking at all.
Post Edited ($WMc%) : 6/5/2010 6:19:15 PM GMT
·I need to invert the states of a pin group. "LEDs· PIN··15..12 LOW".
"TOGGLE" will do one PIN, I need to invert 4 pins·.
·I need to change this·%1111 to this·%0000
Thanks·in advance for any help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
You can feel stupid by asking a stupid question or You can be really·stupid by not asking at all.
Post Edited ($WMc%) : 6/5/2010 6:19:15 PM GMT
Comments
... but the compiler is complaining. So, a quick work-around is this:
... which is what I would expect the compiler to produce for the above line of BASIC. One of the nice things about PropBASIC is that we can work in snippets of Assembly when the compiler doesn't do exactly what we want.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
PINs cannot be used with binary operators.
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
I keep forgetting that I can use PASM snippets in PropBasic.
Thanks Bean
I tried the SPIN NOT "~" before I posted this post and I got a syntax error.I just tried it again and it compiled fine.Hhmm....
Thanks Again guys
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
You can feel stupid by asking a stupid question or You can be really·stupid by not asking at all.·
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
You are the Man. TOGGLE does work for multi pin outputs
I just needed to put it in the right spot to make the compiler happy.
I've been going through these exercises to get the hang of the compiler.I'm seeing what the compiler likes and doesn't like. I use pin masks a lot,So I wanted to really understand this with PropBasic. I think I have a good understanding on it now.I can flip-flop invert etc.and it all works like I want.
Thanks Again
Next is SERIN/SEROUT w/ PropBasic
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
You can feel stupid by asking a stupid question or You can be really·stupid by not asking at all.·