View Full Version : How can keys program be disabled in the Link2FS_inout

02-11-2012, 09:44 AM
We have an Arduino Uno configured as in diagram given with LCD display and switches. We modified the circuit to run 6 hobby servos on a stewart platform model. In doing so we needed to use card's PWM pins 3,5,6,9,10 and 11. We changed the LCD display pin # in your PDE software "LiquidCrystal lcd (7,6,5,4,3,2)" to LiquidCrystal lcd (13,12,8,7,4,2) allowing PWM pin# 3,5,6 to be available. We also remove switches on pin# 8,9,10,11 and 12 allowing PWM pin# 9,10 and 11 to be available. With modifications we ran the program and we got "waiting for data" no data ever loaded into the display. We then commented out Stringoldstate and from oldpinStateSTR = ("") to delay(11); We commented out these items thinking the card software was hung up waiting looking for the state of the switches. When ran again and got " waiting for data" no data came.

Do you have any ideas how this problem my be solved? We are thinking of purchasing a Mega card it has 12 PWM pins. Do you have available a diagram for it?

Looking forward... By the way thanks for your help with our last post. It was an Arduino version problem. We are now using version 0023.



Jim NZ
02-11-2012, 04:11 PM
Good your getting it sorted.

Now ,,, although I've never played with them yet ,, to me it appears RC servo's dont need a PWM pin on the Arduino if you are using the Arduino's "servo library" ,, they can be hooked to any pin. Have a look-see at this ,,,
And to confirm ,, a deeper search on the net brings up PDE's that don't use PWM pins with driving servo's.

As far as disabling the "keys" section of the PDE it's just a matter of removing the code from the PDE. If your unsure of exactly what code is involved ,, have a look-see at "Starter2.pde" in my starter pack. In there it says what each line of code is doing and it would be easy to spot the ones being used by "Keys".
http://www.jimspage.co.nz/intro.htm (You may have to hit refresh to see the new pages)

Just a suggestion ,,, if you just want an LCD and servo's ,,, go back to my original PDE ,, leave the LCD where it is(You know it works there) ,, remove all the "keys" code ,, attach the servo library and allocate the spare pins to what ever servos you want ???

Lets know how you get on as Reids going to be playing in this field also.

Hope that helps ,,, Jim

02-12-2012, 08:35 PM
Hi Jim

We ended up purchasing a Mega card it worked out fiine, extra i/o for servos. Thanks for info where I could explaination of Keys software. Got all hardware connected using Digital pin 52,50,48,46,44 and 42 for servo 1,2,3,4,5,6 signal pins. Ran a servo loop code to exercise each servo. Then ran a code to run pairs for pitch up servos (1,2) with servos (3,4) set constant and pitch down vise-versa. Did not know Servo library allows any pin to be set up to run servo. Thanks for that info.

Ran into a problem when tryed to integrate servos into PED. We set PED code " if (j1 = ("W")" to if (j1 = ("A") for pitch instead of airspeed. Added four more lines of "airsp += char(Serial.read());" was able to now see all pitch character on LCD. Added servo library (#include < Servo.h>), added Servo myservo; Servo myservo1; this allowed servos to run more syncronized. Added


after lcd.print (airsp); and ran into integer and character (ascii) issues, we did not consider this in our infinite wisdom :) (this is the fun part, where we begin learning code). Been at it all day...Tryed several ideas to no avail ... I'm thinking we need to add some conversion prior to servo write..... Any ideas???.....your help is appreciated.

Thanks for Everything