Sixteen-Segment_V1.4 and N64_v1.2 and the XBee Object...
Ttailspin
Posts: 1,326
They just don't seem to be getting along for Me.
Not sure what I am doing wrong... Not even sure of how to ask this question.
I am building My version of a Boe_Bot/Stingray/Scribbler/Thing. Complete with Remote Control.
For the Rolling/Moving Parts,I am Using a USB ProtoBoard,
And a Propeller Professional Development Board (PPDB) is used for the Remote Control.
The Bot moves about nicely, and uses Remote Control from the Xbee/N64 objects
The Nintindo 64 Joystick uses Pin(25), and the XBee is using Pins(23..24),
Everything is/was working well enough, However, it bothered Me that only Three Pins were
being used on the PPDB, Whatever could I use To "Burn Up" some of the other unused Pins..
Oh, I know, how about a nice display on the "Handy" 16 segment led display allready on the PPDB,
that will use a few Pins... Indeed, 23 Pins..
Excellent! now I won't have any of those nasty "unused" Pins looking at Me.
I would just have it simply display "front" for forward, "Back" for Backward,
"Right" For Right turns,ect,ect..
I can make the Sixteen-Segment_v1.4 Demo Send,Scroll,Flash and Clear with no Problem,
But...When I Combine the Three Programs.. Something Just does'nt sit right with the PPDB.
All I get is jibberish and locking/freezing and just general Mayhem on the Display..
It won't Scroll, just displays bizare Char's, Most aren't even letters/Numbers in the string.
or even Letters or Numbers at all, (Kinda neat though, it looks like some alien Alphabet.)
AnyWays, I will post the code for the Remote Control...
(WARNING, the following code was "Written"(cut/pasted) by a Journeyman Carpenter!)
Thanks for Your help and Patience.
Not sure what I am doing wrong... Not even sure of how to ask this question.
I am building My version of a Boe_Bot/Stingray/Scribbler/Thing. Complete with Remote Control.
For the Rolling/Moving Parts,I am Using a USB ProtoBoard,
And a Propeller Professional Development Board (PPDB) is used for the Remote Control.
The Bot moves about nicely, and uses Remote Control from the Xbee/N64 objects
The Nintindo 64 Joystick uses Pin(25), and the XBee is using Pins(23..24),
Everything is/was working well enough, However, it bothered Me that only Three Pins were
being used on the PPDB, Whatever could I use To "Burn Up" some of the other unused Pins..
Oh, I know, how about a nice display on the "Handy" 16 segment led display allready on the PPDB,
that will use a few Pins... Indeed, 23 Pins..
Excellent! now I won't have any of those nasty "unused" Pins looking at Me.
I would just have it simply display "front" for forward, "Back" for Backward,
"Right" For Right turns,ect,ect..
I can make the Sixteen-Segment_v1.4 Demo Send,Scroll,Flash and Clear with no Problem,
But...When I Combine the Three Programs.. Something Just does'nt sit right with the PPDB.
All I get is jibberish and locking/freezing and just general Mayhem on the Display..
It won't Scroll, just displays bizare Char's, Most aren't even letters/Numbers in the string.
or even Letters or Numbers at all, (Kinda neat though, it looks like some alien Alphabet.)
AnyWays, I will post the code for the Remote Control...
(WARNING, the following code was "Written"(cut/pasted) by a Journeyman Carpenter!)
PUB Start ''Start up the XBee and N64 JoyStick led.start(lowChar, numChars, Segment0, true) 'Bring up the display 'waitcnt(clkfreq * 2 + cnt) 'Clear(1) 'Configure XBee XB.start(XB_Rx, XB_Tx, 0, XB_Baud) ' Initialize comms for XBee XB.AT_Init ' Fast AT updates 'led.start(lowChar, numChars, Segment0, true) 'Bring up the display XB.AT_ConfigVal(string("ATMY"), MY_Addr) XB.AT_ConfigVal(string("ATDL"), DL_Addr) 'set MY and DL (destinaton) address. N64.start(MainStickPin) 'Fire up the Main Joystick 'led.start(lowChar, numChars, Segment0, true) 'Bring up the display Scroll(string("Starting and Configuring the XBee Device"), 8) 'SendControl 'Call SendControl MainStick PUB MainStick | i, hello, front, back, right, left 'Main Joystick Operating Commands front := string("Front") back := string("Back") right := string("Right") left := string("Left") '******************************** Main Joystick Steering ********************************* repeat if N64.CU XB.tx("u") 'send Forward Command to bot Forward(0) send(front) 'waitcnt(clkfreq / 2 + cnt) if N64.CD XB.tx("d") 'send Reverse Command to bot Reverse(0) send(back) if N64.CR XB.tx("r") 'send Right Command to bot Right(0) send(right)I just Pasted a piece of the MainStick Method, the attachment has the complete Code.
Thanks for Your help and Patience.
Comments
I would have been less discouraged with an "RTFM" at the very least..
To state it another way, Can you go back to the last point it was working?
If so, then we can take it one step at a time.
Don't pull jumpers from breadboard yet. Just don't use them.
It boiled down to just this little bit of code...
Just putting those four objects and adding the line "led.start(lowChar, numChars, Segment0, true),
is all it takes to get the alien display...
I wonder what one of the stacks is not big enough?.(not a well thought out question).
Anyways, thank You for that, I will go read up on "stacking things" in the Manual.
I try to display anything on the Leds, when I try to display anything,
All I get is "COG SLAP"...:mad:
So the last working point would be pre display. I can comment out the display,
and InaPinch rolls around as directed...
Excellent, so now you have a good place to debug from.
what is COG SLAP???
they are bound to wobble around and "Slap" into each other from time to time...
(shoulda known better then to trust something without an oil hole!)
These newfangled modern things, Self lubricating..bah.
Anyway's, I did fiddle around with setting stack sizes, but not much success.
I can make different Alien letters predictably, changing different lines in Main.
but I was hoping for some better direction then the hunt and peck method I've been using.
If it were me, I'd change these one at a time and see what happens.
For example change:
front := string("Front") to front := string("Back")
Now, do commands for forward and reverse display the same? (even if incorrect )
By commenting out those very four lines, I can make the 2nd from the left led,
and the 4th from the left led, display an 8 and an Alien e.
the other led's remaining blank, and no action from the Xbee..
The 4 send(xxxxx) lines above control your LEDs, correct?
If these are commented, does the robot move as expected?
I can comment out the entire rest of the code, and will still get Alien alphabet on startup.
It seems to come down to the four objects and there associated files.
and then calling led.start...