Lynxmotion Tech Support

www.lynxmotion.com
It is currently Sat May 25, 2013 4:40 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 289 posts ]  Go to page Previous  1 ... 14, 15, 16, 17, 18, 19, 20  Next
Author Message
PostPosted: Sat Feb 13, 2010 7:56 pm 
Offline
Roboteer
User avatar

Joined: Fri Feb 05, 2010 12:43 am
Posts: 51
Location: Nelson NewZealand
Is there any more updates to to his thread like final code for tx and rx. it has been a most interesting thread to read. amaz
ing guys. ty for sharing. And any applications by the ppl that have built it and using on their bots, or has the ps2 controller taken over, as this thread is about a year old.

_________________
People yearn after this robotic dream, but you can't strip your life of all meaning, emotion and feeling and expect to function.


Top
 Profile  
 
PostPosted: Sat Feb 13, 2010 8:01 pm 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4415
Hi there was code posted for the transmitter and I think code fro running it with the phoenix. Since this was completed, I personally on my unit have converted it over from the 2.4ghz system to XBEE based. There is another thread on that. With that I have posted code for the transmitter, as well as the phoenix. I also have code for the brat that still needs testing as well as for the rover.

Kurt


Top
 Profile  
 
 Post subject: Re:
PostPosted: Thu Aug 05, 2010 9:39 pm 
Offline
Roboteer

Joined: Wed Dec 06, 2006 2:24 pm
Posts: 210
Location: Tucson AZ
I recieved most the parts needed to proceed, just waiting on the key pad and LCD. I was going through the thread again and saw this part about using pull ups

Robot Dude wrote:
Hi Kurte,
No go on the no pullup code. I had James solder the pullups in, changed low's to high's and it's good and solid!
Code:
123A 456B 789C 0FED


But did not see any more. could you please shed a little more light on this part.

Thanks


Top
 Profile  
 
PostPosted: Sun Aug 08, 2010 10:10 pm 
Offline
Roboteer

Joined: Wed Dec 06, 2006 2:24 pm
Posts: 210
Location: Tucson AZ
I think I've figured out how to connect the the keypad. I'm just not sure what resistance i should use. I found several articles using 4k7,100ohms some help here would be helpful. This is how I'm read yo connect the 4x4 keypad is this correct?
Attachment:
KEYPAD.JPG
KEYPAD.JPG [ 64.23 KiB | Viewed 1343 times ]


Top
 Profile  
 
PostPosted: Mon Aug 09, 2010 12:05 am 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4415
I think we used 10K resistors. I added another 5 stitches to mine to control what is displayed, changing configurations and the like. I had a diagram of it, but Zenta made a much better diagram of it as you can see: viewtopic.php?f=21&t=5447&start=91

Kurt


Top
 Profile  
 
PostPosted: Mon Aug 09, 2010 1:11 pm 
Offline
Roboteer

Joined: Wed Dec 06, 2006 2:24 pm
Posts: 210
Location: Tucson AZ
Kurt,
Thanks I'll add the 10K resistors and build in an upgrade path to add more switches later. Is your avatar a picture of your DIY remote control? Looks like it has an additional LCD.

Thank you
Phil.


Top
 Profile  
 
PostPosted: Mon Aug 09, 2010 1:44 pm 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4415
Yep, my avatar is a picture of my remote control. Still using the original LCD. The thing toward the top is my XBEE that is on a board that used to be available from Selmware for holding an XBee and doing the level shifting... Can easily use sparkfun version as well.

Kurt


Top
 Profile  
 
 Post subject: Re:
PostPosted: Tue Aug 10, 2010 12:24 am 
Offline
Roboteer

Joined: Wed Dec 06, 2006 2:24 pm
Posts: 210
Location: Tucson AZ
I added the 10K resistors to P4-7 and tried this code. I still haven't recieved my LCD so used the terminal

Code:
aa var bit
bb var bit
cc var bit
dd var bit

input p4
input p5
input p6
input p7

output p10
output p11
output p12
output p13
   
low 10
low 11
low 12
low 13

start:
 
high 10
aa = in4
bb = in5
cc = in6
dd = in7
serout s_out, i9600, [bin aa, bin bb, bin cc, bin dd]   
low 10
high 11
aa = in4
bb = in5
cc = in6
dd = in7
serout s_out, i9600, [" ",bin aa, bin bb, bin cc, bin dd]   
low 11
high 12
aa = in4
bb = in5
cc = in6
dd = in7
serout s_out, i9600, [" ",bin aa, bin bb, bin cc, bin dd]   
low 12
high 13
aa = in4
bb = in5
cc = in6
dd = in7
serout s_out, i9600, [" ",bin aa, bin bb, bin cc, bin dd, 13]
low 13   

goto start


I get "1111 1111 1111 1111"
I think I might have something wrong :?


Top
 Profile  
 
PostPosted: Tue Aug 10, 2010 8:34 am 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4415
Hi,
Since we are using pull-ups, we will only set one row to low and the others will stay high, with this the code will assume that a button is not pressed with a bit value of 1 and is pressed with a bit value of 0.

The current code does not set the values of the pins high it sets them to input (ie it lets them float). Why? I was afraid that if the user pressed two buttons and during the scan it ran into 1 pin being set to high being connected to another pin being sent low we would have a dead short... With it set to input, then the logical high is set by the pull-up resistor, so there is no direct short. I hope that makes sense.

The current code (which probably can be cleaned up looks like:
Code:
Row0          con 10             ; Row 0 on keypad
Row1          con 11             ; row 1 on keypad
Row2       con 12             ; Row 2
Row3       con 13             ; Row 3

col1                var bit       ; Column values on keypad used in check keypad
col2                var bit
col3                var bit
col4                var bit



; P14 RXD                  ; HSERIAL
; P15 TXD                  ; hserial
RowB      con   17            ; Cmd buttons new row


;==============================================================================
; [CheckKeypad] function
;
; Input Parameters:
;       FCheckModeChange: Should we do checks for mode change? Currently always true.
;
; Variables updated:
;      keypress - the ascii value associated with that key.
;      Ver 2.0 - Add 4 buttons hang off of keyboard as an extra row...
;       change Highs to inputs to keep possibility of dead shorts from happening
;      when pressing multiple switches.
; BUGBUG:: Need to clean this up, maybe table drive?
;==============================================================================
fCheckModeChange var   byte      ; should we check for a mode change ?
CheckKeypad[fCheckModeChange]:
   low  Row0
   input Row1
   input Row2
   input Row3
   input RowB   ; buttons we hacked on
   
   col1 = in4
   col2 = in5
   col3 = in6
   col4 = in7

   bPacket(0) = 0      ; assume no buttons pressed
   bPacket(1) = 0
    keypress = " "
    CmdBtnsPrev = CmdBtns
    CmdBtns = 0
   if fCheckModeChange then
      fTModeChanged = FALSE
   endif

   ;Read buttons - New version reads multiple keys as well are down.
   ; Process Row 0
   if col1 = 0 then
      bPacket(0).bit1 = 1
      keypress = "1"
   endif
   if col2 = 0  then
      bPacket(0).bit2 = 1
      keypress = "2"
   endif
   if col3 = 0 then
       bPacket(0).bit3 = 1
       keypress = "3"
   endif
   if col4 = 0 then
       bPacket(1).bit2 = 1
       keypress = "A"
   endif

   ; Process Row 1
   input Row0
   low  Row1
   col1 = in4
   col2 = in5
   col3 = in6
   col4 = in7
   if col1 = 0 then
       bPacket(0).bit4 = 1
       keypress = "4"
   endif
   if col2 = 0  then
       bPacket(0).bit5 = 1
       keypress = "5"
   endif
   if col3 = 0  then
      bPacket(0).bit6 = 1
      keypress = "6"
   endif
   if col4 = 0 then
      bPacket(1).bit3 = 1
      keypress = "B"
   endif

   ; Process Row2
   input Row1
   low  Row2
   col1 = in4
   col2 = in5
   col3 = in6
   col4 = in7
   if col1 = 0 then
       bPacket(0).bit7 = 1
       keypress = "7"
   endif
   if col2 = 0 then
       bPacket(1).bit0 = 1
       keypress = "8"
   endif
   if col3 = 0 then
       bPacket(1).bit1 = 1
       keypress = "9"
   endif
   if col4 = 0 then
       bPacket(1).bit4 = 1
       keypress = "C"
   endif

   ; Process Row 3
   input Row2
   low  Row3
   col1 = in4
   col2 = in5
   col3 = in6
   col4 = in7
   if col1 = 0 then
       bPacket(0).bit0 = 1
       keypress = "0"
   endif
   if col2 = 0 then
       bPacket(1).bit7 = 1
       keypress = "F"
   endif
   if col3 = 0 then
       bPacket(1).bit6 = 1
       keypress = "E"
   endif
   if col4 = 0 then
       bPacket(1).bit5 = 1
       keypress = "D"
   endif

   ; Process Row B - Our 4 added on buttons.
   input Row3
   low   RowB
   col1 = in4
   col2 = in5
   col3 = in6
   col4 = in7
   if col1 = 0 then
       CmdBtns.bit0 = 1
       keypress = "W"
   endif
   if col2 = 0 then
       CmdBtns.bit1 = 1
       keypress = "X"
   endif
   if col3 = 0 then
       CmdBtns.bit2 = 1
       keypress = "Y"
   endif
   if col4 = 0 then
       CmdBtns.bit3 = 1
       keypress = "Z"
   endif
   
   ; Check to see if the state of the command buttons has changed.
   if fCheckModeChange and (CmdBtns <> CmdBtnsPrev) then         ;
      if (CmdBtns & CMD_UP_MASK) and ((CmdBtnsPrev & CMD_UP_MASK) = 0) then
         ; CmD Up button has been pressed
         if TransMode = TMODE_MAX then
            TransMode = 0
         else
            TransMode = TransMode + 1
         endif
         fTModeChanged = TRUE
      elseif (CmdBtns & CMD_DOWN_MASK) and ((CmdBtnsPrev & CMD_DOWN_MASK) = 0)
         ; CmD Up button has been pressed
         if TransMode = 0 then
            TransMode = TMODE_MAX
         else
            TransMode = TransMode - 1
         endif
         fTModeChanged = TRUE
      endif
      
      if fTModeChanged then
         gosub ClearLCDDisplay
         bTDataLast = 0xff      ; make sure we will display something when it changes.
      endif
   endif

   return
   


Kurt


Top
 Profile  
 
PostPosted: Wed Aug 11, 2010 11:57 am 
Offline
Roboteer

Joined: Wed Dec 06, 2006 2:24 pm
Posts: 210
Location: Tucson AZ
Ok, keypad now works correctly. I had forgotten to change the lows to High and vice versa. also found some loose wire crimps.
Thanks.


Top
 Profile  
 
PostPosted: Fri Aug 13, 2010 12:07 am 
Offline
Roboteer

Joined: Wed Dec 06, 2006 2:24 pm
Posts: 210
Location: Tucson AZ
OK,i'm ready to add the gimbals. one question before i start. i don't know what the green yellow and white wires do. it's a hitec laser 4 transmitter. it looks like a pot. so i guess its white to 5V yellow to signal and green to ground is this correct? : :?


Top
 Profile  
 
PostPosted: Fri Aug 13, 2010 8:38 am 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4415
Jim or James could probably answer this one better than me as they built the first ones. I was starting to collect parts to build another one, but the gimbals that I collected were not from Hitec. The pots on these have Red white and black wires.

If you have a multi-meter I would recommend that checking the resistance between the pins of the pot, when it is at center and when you move it to both edges. My guess is you can connect one outside pin to +5v the other to ground and the center one to an analog input pin. You may want to check the different voltages and may need to adjust the program depending on how different it is. But since I believe that they used laser 4 gimbals in the first ones it may just work.

Kurt


Top
 Profile  
 
PostPosted: Fri Aug 13, 2010 10:12 am 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
Unfortunately I used up all the gimbals Hitec and I had. lol But as Kurt said it's not difficult to ohm out the connections. Or just look at where the wires connect to the pot. The one in the middle is the one that varies when the joystick is moved. You can put 5vdc and ground on the outside pins. If the result is backwards you can reverse the outside pins.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
PostPosted: Sat Aug 14, 2010 10:44 am 
Offline
Roboteer

Joined: Wed Dec 06, 2006 2:24 pm
Posts: 210
Location: Tucson AZ
Jim/Kurt
I thought the wire colors might have had a color code associated with them. I was able to get the gimbals hooked up, they seem to work as i see the display numbers change when moving the them. Thanks this also helped me get the sliders figured out :D
Quote:
Unfortunately I used up all the gimbals Hitec and I had
I must agree with this as it was slim pickings to find them.

Thanks for the help

Phil


Top
 Profile  
 
PostPosted: Wed Nov 10, 2010 8:14 pm 
Offline
Robot Guru
User avatar

Joined: Tue Nov 02, 2010 9:39 pm
Posts: 1433
Location: Quebec Canada
Hi All,

Sorry for my little to no knowing about botboard and basic Micro...

I have a spare transmitter that i just disassembled. I have "for now" just take one potentiometer and hook
it to a servo lead.

Ok... so now for understanding the programming and the hardware...

I want to connect that potentiometer to the board and send back the info on the serial port.
After that i would like to be able to send a command to the SCC-32 to move a servo accordingly to
that input...

Am i clear..?

(sorry again for my english)

Tanks

Eric Nantel
Qc Canada

Got something that work

Quote:
SSC_LM_SETUP con 1 ;Changes the SSC pins corresponding to the setup
;1 = Setup with connector to the front
;0 = Setup with connector to the back

SSC_OUT con P11 ;Output pin for (SSC32 RX) on BotBoard (Yellow)
SSC_IN con P10 ;Input pin for (SSC32 TX) on BotBoard (Blue)
SSC_BAUTE con i38400 ;SSC32 Baute rate
loop:
my_input var Word
ADIN P19, my_input
my_input = my_input * 2.4557
serout SSC_OUT,SSC_BAUTE,["#0 P",DEC my_input ,13]
;serout s_out,i9600,["#0 P",DEC my_input ,13]
pause 20

goto loop


Bit of code from one and another... llol

_________________
Eric Nantel
Qc Canada

Always liked Robot... Now i am learning to make some...! Wonderfull...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 289 posts ]  Go to page Previous  1 ... 14, 15, 16, 17, 18, 19, 20  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group