Propbasic: Invalid Parameter on HUB variable in 2nd Task (v99) [Solved]
Yendor
Posts: 288
Bean,
I took the code and added a hub variable 'myval', and tried to increment the value in my 2nd task.
It comes back as 'invalid parameter'.
Also, for fun, in the Serial_RX task, I added
INC RxHead
INC HPntr
And it comes back with invalid parameter for RxHead.
Am I doing something wrong?
Thanks!
Post Edited (Yendor) : 5/26/2010 2:20:38 PM GMT
I took the code and added a hub variable 'myval', and tried to increment the value in my 2nd task.
It comes back as 'invalid parameter'.
Also, for fun, in the Serial_RX task, I added
INC RxHead
INC HPntr
And it comes back with invalid parameter for RxHead.
Am I doing something wrong?
Thanks!
Post Edited (Yendor) : 5/26/2010 2:20:38 PM GMT
Comments
Inc applies to cog variables only.the variable RxHead is a hub variable.
regards
Gerry
Yeap, Gerry is exactly correct. HUB variables are not directly accessible. You'll need to do:
RDBYTE rxHead, temp
INC temp
WRBYTE rxHead, temp
Of course you may not need the WRBYTE if the updated value doesn't have to be permanent.
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]