Nwebie Propeller Quickstart question
jujugoboom
Posts: 6
Hello,
I just bought my parallax propeller quickstart 40000 today from radioshack. Ive worked for a while with arduino and decided, why not try out the propeller. I downloaded the drivers and propeller tool and loaded up the touch example. I do not have any external peripherals right now so i just decided to mess around with using multiple cores and printing to the serial terminal. I used this code
to try to get it to start in a new cog. It gives me the error stating that it expected a , at touch in the cognew command. I was also wondering which way is the best way to have it read which button i press and output it to pst? Such as "Button 0 Pressed","Button 1 Pressed" etc etc. Thanks for any help
Justin
I just bought my parallax propeller quickstart 40000 today from radioshack. Ive worked for a while with arduino and decided, why not try out the propeller. I downloaded the drivers and propeller tool and loaded up the touch example. I do not have any external peripherals right now so i just decided to mess around with using multiple cores and printing to the serial terminal. I used this code
CON _CLKMODE = XTAL1 + PLL16X _CLKFREQ = 80_000_000 OBJ Buttons : "Touch Buttons" PST : "Parallax Serial Terminal" PUB Main cognew(Touch(_CLKFREQ/100), @stack[0]) PUB Touch dira[23..16]~~ ' Set the LEDs as outputs repeat outa[23..16] := Buttons.State'
to try to get it to start in a new cog. It gives me the error stating that it expected a , at touch in the cognew command. I was also wondering which way is the best way to have it read which button i press and output it to pst? Such as "Button 0 Pressed","Button 1 Pressed" etc etc. Thanks for any help
Justin
Comments
My QuickStart servo tester uses the buttons to set the servo parameters. I gave Joe some instructions on how to use the touchpads as selection buttons starting in post #15 of his QuickStart BOE-Bot thread.
Post #3 of my index has links to various Propeller tutorials.
You might have a hard time going back to the Arduino once you see how useful parallel processing can be on the Propeller.
Thats alot of great resources. Thanks. I am a slow learner though. When i run this code
I get an error stating it was expecting a variable at
of course if you compile and run this you will see that it doesn't work, at all. I was able to get the buttons to work in a seprerate cog but then adding PST broke it. Any help would be appreciated.
In the meantime, you may find the Programs on this link useful. IIRC, there is a game or two that used both the Serial Terminal and the Touchbuttons.
Jeff
Also, what's the idea behind PST.dec(Num.ToStr(Buttons.State, Num#DDEC)- 16)?
There are still issues with how quickly the two loops run. The display of the button states to PST flicker and the LEDs of non-pressed buttons light unless your touch is very light.
dgately
I dont have my propeller with me right now but this looks like it should work. Are you saying that it just needs some delays because i can easily add that in. So all i needed to do was start buttons? Thanks
And you were using the Numbers object incorrectly. PST has some built in methods for dealing with numbers so you don't need the "Numbers" object at all.
I think you'd get a better looking display if you didn't clear the screen with each loop but instead use the PST Position method to print the same line over the same location. I think the clear screen command will make the screen flicker a bit.
Yes, I was quickly trying to solve his issue and wasn't really thinking about why the flicker. Always best to just update by setting the X,Y position of the cursor, especially when the output is a known number of characters.
Thanks Duane! As usual, great advice from a sage Propeller dude :thumb:
dgately
And, sorry to ask so many questions, without putting in into the code, how would you propose doing that? Thanks
You can check-out all of Parallax Serial Terminal's functions/methods in its .spin file... But, here's an example...
I dont remember of the .Position method is ZERO-based or not, so try one of these in place of 'PST.clear':
dgately
Yes using is the proper one to use