Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: Arduino BotBoarding error code "avrdude: stk500_getsync(): not in sync: resp=0x" on: February 12, 2013, 07:51:29 am
@Paul S.

Email Me... Thanks
2  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 16, 2012, 09:48:50 pm
PaulS.. It's on the way...
HazardsMind...The code is what I grabbed for a publication and I have tweaked it with your and PaulS's help..

I will attempt to get a screen shot for u..
Dave
3  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 16, 2012, 08:05:32 pm
I added the code as supplied.. The digits as entered are displayed as ---- (actually three horizontal lines in a stack) when inputted... When you push * it removes the dashes and displays the digits you hit..

The full code is included here:

/* @file HelloKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Demonstrates the simplest use of the matrix Keypad library.
|| #
*/
#include <Keypad.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
String keyIn;
int currentCommand = 0;


char Data[5];
const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};
byte rowPins[ROWS] = {28, 26, 24, 22}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {31, 33, 35}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
  Serial.begin(9600);
  lcd.begin(15,2);
}
 
void loop(){
  //lcd.begin(15,2);
  lcd.setCursor(2,0);
  lcd.print("Input Digits");

  char key = keypad.getKey();
if(key != NO_KEY) // Do nothing if no key is pressed, incorporated from PaulS's example.
  {
      if (key != '*') {
    Data[currentCommand++] = key;
    lcd.setCursor(6 + currentCommand,1);
    lcd.print(Data[currentCommand]);
   
}

else {
    int keyIn = atoi(Data);
    lcd.setCursor(6,1);
    lcd.print(keyIn);     
    lcd.print("     ");
    Serial.println(keyIn);
    while(currentCommand !=0){   // This can be used for any array size,
    Data[currentCommand--] = 0; //clear for new data
        }
     }
  }
}



I'm / We're gettin there !!
4  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 16, 2012, 09:20:54 am
HazardsMind.... yes the code works.. No more overflow..Ok.. Is there a way to show the digits on the display Before pushing the * key?.. I know I'm a pain in the Arse..
5  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 16, 2012, 08:38:36 am
HazardsMind... Its for a LARGE tubing bender in a private residence.. He is building a Mud truck and wants to bend a lot of tubing..

Its my brother so I'm attempting to help him out..

Sequence.. Figure out what angle he wants.. look on table, retrieve the two or three digit #( count from encoder, predetermined), enter the digits via the keypad, have digits appear on LCD#1 (for reference and verification), push the reset/clear key (separate push button,this clears the encoder count stack, resets to 0), Push the * key, This sets the first counter stack to digits entered via keypad, output pin goes high(relay attached to output pin to control motor), Rotary encoder is attached to the arm and outputs pulses as the arm moves (Pipe Bends), the count is displayed on LCD#2 to show the bend value... when the rotary encoder count matches the keypad # the output pin goes low and everything stops..

@PaulS..  As for the beer and hardware, Where do I send it to??..LOL (i'm serious.. I have two sets of hardware if your serious)

6  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 15, 2012, 07:38:23 pm
@PaulS...
There isn't any !!!!! LOL...

For my project, I really want to use the Arduino instead of the PLC.. But this language is a real bear for me to grasp.. Almost wish there were someone who wrote this stuff for a few bucks and a beer !!!LOL..

Its simple... enter 3 or 4 digits via keypad.. Push "*" to enter... Display the digits on LCD #1...Have Arduino energize a relay (Pin goes High)... Have rotary encoder input pulses... count pulses as they come in...Display the count on LCD #2... Have Arduino take pin Low when inputted digits match the rotary encoders count... Have a button to clear the rotary encoder count (stack) and the "#" key as a backspace or delete key for the numeric input from the keypad...

Is this a complicated sketch?.. Is it lengthly?

So far I have the keypad talking to the Arduino and the Keyed in digits sort of displaying on the LCD# 1... The rotary encoder is inputting the count but not working correctly.. Lots of bounce..

Hair is getting thinner by the evening with this project..

I appreciate all of the suggestions and help this community has provided.. I'm sure I will require ALOT more help before I'm done...
7  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 14, 2012, 09:39:02 pm
Thanks again for all of your help...

I will upload this code and see if I can make it do what I need..

I only wish I could get the hang of this language... I can do ladder logic but cant seem to grasp this..

Thanks again
8  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 13, 2012, 08:35:31 pm
HazardsMind... For what it's worth... When I look on the term, I see about 30 seconds worth of 0's then random characters.. all this time, the TX LED is lit on the Mega
9  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 13, 2012, 08:26:58 pm
Ok..I learned something today... THANKS..
for some reason I can not get any digits to appear except when the * is pushed I get a 0 on the LCD
10  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 13, 2012, 08:21:05 pm
In layman's terms, what is this doing?
if (key != '*'){
keyIn += key;

11  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 13, 2012, 08:17:52 pm
Folks... I APPRECIATE ALL OF THE INPUT... I am totally at a loss so please accept my appreciation for your knowledge..

Is there any tutorials for what I am trying to do?. I can say I have looked but with no success
12  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 13, 2012, 08:08:24 pm
Folks,
I am to say the least LOST.. What should I delete to add the:  char keyLin[6];

Im sorry I'm so lost
13  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 13, 2012, 08:01:52 pm
Ok.. I used the code that was last supplied,.. I un remarked the int keyDisp = keyIn.toInt(); line.. Now I get a 0 on the lcd when I input the * key.. The TX LED on the Mega stays on for approx 30 seconds.. No other key does any thing.. No digits show on the LCD or Term.. The code is exactly what was provided by HazardsMind
14  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 13, 2012, 06:59:40 pm
I declared it ... Remarked out the string... now it just keeps erroring on anything added
15  Using Arduino / Project Guidance / Re: Entering 3 digits on: December 13, 2012, 06:52:22 pm
added the new loop.. Now I get a compile error at the: String keyIn += Key line

HELP !!!!
Pages: [1] 2