Show Posts
Pages: [1]
1  Using Arduino / Displays / Digital Projection Clock Interface Help on: February 11, 2012, 06:27:40 pm
HI everybody, i found this older ceiling projection clock part the other day and was wondering how i could interface it with my arduino. there is an IC under a glob of epoxy im almost sure, 8 pads for connections on the board only 7 being used, 2 for powering a red LED. The 5 wire ribbon cable must contain at least 1 power and 1 GND, meaning it uses 3 wire communication? Im not really sure. it uses the red LED behind and older style LCD That projects up to 4 digits with a colon in the middle. Any ideas on how to use it? heres a link to some pictures.http://srhaemmerling.webs.com/apps/photos/album?albumid=12982165
2  Using Arduino / Programming Questions / Re: variable or field 'keypadEvent' declared void on: July 25, 2011, 09:42:21 pm
that was it AWOL. Thanks. any other suggestions?
3  Using Arduino / Programming Questions / Re: variable or field 'keypadEvent' declared void on: July 25, 2011, 05:25:51 am
first: CrossRoads, yes i have it in my libraries folder. but thanks

second: David, i tried putting it under the void setup like the examples i saw but i got the same error, ill try putting it in the  void loop but i doubt ill get a different result. also thank you however.
4  Using Arduino / Programming Questions / variable or field 'keypadEvent' declared void on: July 24, 2011, 11:36:43 pm
im getting these errors now and dont know how to fix them can someone pls help.
thanks in advance. smiley-wink


-1: error: variable or field 'keypadEvent' declared void
-1: error: 'KeypadEvent' was not declared in this scope
29: error: expected constructor, destructor, or type conversion before '.' token


Code:
#include <Password.h>
Password password = Password("846*");

#include <Keypad.h>
const byte ROWS = 4; //Four Rows
const byte COLS = 3; //Four Columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','8'},
  {'#','0','*'}
};
//Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte rowPins[ROWS] = {7, 6, 5, 3};
//Connect keypad COL0, COL1 and COL2 to these Arduino pins.
byte colPins[COLS] = {4, 3, 2};

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

//this wont change
const int TLB = 11;
const int TLBLight = 12;

//Variables
int TLBCount = 0;
int Buttonstate = 0;
int LastButtonstate =0;

keypad.addEventListener(keypadEvent);

void setup(){
  //Set Pins 2-8 To INPUT from Keypad
  pinMode(2, INPUT); //Keypad Pin 1
  pinMode(3, INPUT); //Keypad Pin 2
  pinMode(4, INPUT); //Keypad Pin 4
  pinMode(5, INPUT); //Keypad Pin 3
  pinMode(6, INPUT); //Keypad Pin 5
  pinMode(7, INPUT); //Keypad Pin 6
  pinMode(8, INPUT); //Keypad Pin 7
  //Set Pins 9 and 10 To StepperDriver
  pinMode(9, OUTPUT); //Stepper DIR
  pinMode(10, OUTPUT);//Stepper STEP
  //Set Pins 11 and 12 to Tactile Light Button
  pinMode(TLB, INPUT); //TLB Button Press Watch
  pinMode(TLBLight, OUTPUT);//TLB Light Trigger
 
 
}
void loop(){
  //reads pin 11 for double button press
  Buttonstate = digitalRead(TLB);
  if (Buttonstate != LastButtonstate) {
  //STart counting TLB Presses
  if (Buttonstate == HIGH){
      TLBCount++;
   }
    else{
      digitalWrite(TLBLight, LOW);//Dont lght when not pressed
    }
  }
  LastButtonstate = Buttonstate;
  //If doubltap on TLB start Looking for pincode form keypad
  if (TLBCount % 2 == 0){
    //Blink TLB light x3
    digitalWrite(TLBLight, HIGH);
    delay(550);
    digitalWrite(TLBLight, LOW);
    delay(250);
    digitalWrite(TLBLight, HIGH);
    delay(550);
    digitalWrite(TLBLight, LOW);
    delay(250);
    digitalWrite(TLBLight, HIGH);
    delay(550);
    digitalWrite(TLBLight, LOW);
    //Start looking for input on keypad.
    keypad.getKey();
  }
}

void keypadEvent(KeypadEvent eKey){
  switch (keypad.getState()){
    case PRESSED:
switch (eKey){
  case '*': guessPassword(); break;
  case '#': password.reset(); break;
   default:
   password.append(eKey);
     }
  }
}

void guessPassword(){
     if (password.evaluate()){
     //Blink TLB light x3
       digitalWrite(TLBLight, HIGH);
       delay(550);
       digitalWrite(TLBLight, LOW);
       delay(250);
       digitalWrite(TLBLight, HIGH);
       delay(550);
       digitalWrite(TLBLight, LOW);
       delay(250);
       digitalWrite(TLBLight, HIGH);
       delay(550);
       digitalWrite(TLBLight, LOW);
       //Replace with stepper code
     }else{
     digitalWrite(TLBLight, HIGH);
             delay(750);
             digitalWrite(TLBLight, LOW);
     }
}

    //move stepper __degrees one direction if stepper is at POINT A,
    //move the motor  __ degrees opposite direction if at POINT B.
   
 
 
 
 
 
5  Using Arduino / Programming Questions / Re: error: expected unqualified-id before numeric constant on: July 22, 2011, 03:31:59 pm
Ok i get it so i need to name it something completely different from PIN1. Something Like CODEa, CODEb, CODEc, and CODEd.
6  Using Arduino / Programming Questions / Re: error: expected unqualified-id before numeric constant on: July 22, 2011, 02:10:15 pm
so your saying i need to save the get key char as pin1 instead of just comparing it to another name? if i added something like
if (PIN1 != NO_KEY){
  Pin1 = PIN1
}
after each one would i be fixing some of the problem?
7  Using Arduino / Programming Questions / Re: 12 button Keypad input into a string on: July 22, 2011, 02:05:57 pm
tanks. i think both of you will have helped by the time im down writing my code.
8  Using Arduino / Programming Questions / Re: error: expected unqualified-id before numeric constant on: July 22, 2011, 02:26:39 am
i manged to fix the unqualified id error by changing this:

Code:
char PIN1 = keypad.getKey();
char PIN2 = keypad.getKey();
char PIN3 = keypad.getKey();
char PIN4 = keypad.getKey();

into this

Code:
//Start looking for input on keypad.
       PIN1 == keypad.getKey();
   
       PIN2 == keypad.getKey();

       PIN3 == keypad.getKey();

       PIN4 == keypad.getKey();

the last problems untill i add the stepper portion of the code are :

KEYPAD_LOCK.cpp: In function 'void loop()':
KEYPAD_LOCK:89: error: expected primary-expression before 'PIN'
KEYPAD_LOCK:89: error: expected `)' before 'PIN'
KEYPAD_LOCK:106: error: expected primary-expression before 'PIN'
KEYPAD_LOCK:106: error: expected `)' before 'PIN'
 which is this part of the code:
Code:
   PIN4 == keypad.getKey();
   
      String PIN  = ('PIN1' + 'PIN2' + 'PIN3' + 'PIN4');
    if (String PIN == String SAMCODE){
    //Blink TLB light x3
      digitalWrite(TLBLight, HIGH);
9  Using Arduino / Programming Questions / error: expected unqualified-id before numeric constant on: July 22, 2011, 02:06:14 am
so ive been working on this bit of code for a few days now and my goal is to build an electronic door lock using a 12 key keypad and a stepper motor.  line 80 - 86 give me this error and i can t figure out whats wrong exactly. can some one please read through and make suggestions for change or efficency or just general problems in the design of my coding as i am self teaching myself.

the main i dea is that using a 12 key keypad and a single push button that lights up u can operate a door lock by pressing the push button 2x then entering a passcode and the motor will either lock or unlock depending on the position of the motor.

thanks.

Code:
#include <Keypad.h>
const byte ROWS = 4; //Four Rows
const byte COLS = 3; //Four Columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','8'},
  {'#','0','*'}
};
//Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte rowPins[ROWS] = {7, 6, 5, 3};
//Connect keypad COL0, COL1 and COL2 to these Arduino pins.
byte colPins[COLS] = {4, 3, 2};

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

//this wont change
const int TLB = 11;
const int TLBLight = 12;
String SAMCODE =('8' + '4' +'6' + '*');
String WILLCODE = ('3' + '7' + '2' + '*');

//Variables
int TLBCount = 0;
int Buttonstate = 0;
int LastButtonstate =0;



void setup(){
  //Set Pins 2-8 To INPUT from Keypad
  pinMode(2, INPUT); //Keypad Pin 1
  pinMode(3, INPUT); //Keypad Pin 2
  pinMode(4, INPUT); //Keypad Pin 4
  pinMode(5, INPUT); //Keypad Pin 3
  pinMode(6, INPUT); //Keypad Pin 5
  pinMode(7, INPUT); //Keypad Pin 6
  pinMode(8, INPUT); //Keypad Pin 7
  //Set Pins 9 and 10 To StepperDriver
  pinMode(9, OUTPUT); //Stepper DIR
  pinMode(10, OUTPUT);//Stepper STEP
  //Set Pins 11 and 12 to Tactile Light Button
  pinMode(TLB, INPUT); //TLB Button Press Watch
  pinMode(TLBLight, OUTPUT);//TLB Light Trigger
}
void loop(){
  start:
  //reads pin 11 for double button press
  Buttonstate = digitalRead(TLB);
  //if TLB presses is less than 1 do nothing
  if (Buttonstate != LastButtonstate) {
  //STart counting TLB Presses
  if (Buttonstate == HIGH){
      TLBCount++;
      //Light TLB when HIGH
      digitalWrite(TLBLight, HIGH);
   }
    else{
      digitalWrite(TLBLight, LOW);//Dont lght when not pressed
      goto start;
    }
  }
  LastButtonstate = Buttonstate;
 
  //If doubltap on TLB start Looking for pincode form keypad
  if (TLBCount % 2 == 0){
    //Blink TLB light x3
      digitalWrite(TLBLight, HIGH);
      delay(50);
      digitalWrite(TLBLight, LOW);
      delay(50);
      digitalWrite(TLBLight, HIGH);
      delay(50);
      digitalWrite(TLBLight, LOW);
      delay(50);
      digitalWrite(TLBLight, HIGH);
      delay(50);
      digitalWrite(TLBLight, LOW);
      //Start looking for input on keypad.
      char PIN1 = keypad.getKey();
   
      char PIN2 = keypad.getKey();

      char PIN3 = keypad.getKey();

      char PIN4 = keypad.getKey();
   
      String PIN  = ('PIN1' + 'PIN2' + 'PIN3' + 'PIN4');
    if (PIN == SAMCODE){
    //Blink TLB light x3
      digitalWrite(TLBLight, HIGH);
      delay(50);
      digitalWrite(TLBLight, LOW);
      delay(50);
      digitalWrite(TLBLight, HIGH);
      delay(50);
      digitalWrite(TLBLight, LOW);
      delay(50);
      digitalWrite(TLBLight, HIGH);
      delay(50);
      digitalWrite(TLBLight, LOW);
    //Replace with stepper code
    }else{
      goto start;
    }
    if (PIN == WILLCODE){
    //Blink TLB light x3
      digitalWrite(TLBLight, HIGH);
      delay(50);
      digitalWrite(TLBLight, LOW);
      delay(50);
      digitalWrite(TLBLight, HIGH);
      delay(50);
      digitalWrite(TLBLight, LOW);
      delay(50);
      digitalWrite(TLBLight, HIGH);
      delay(50);
      digitalWrite(TLBLight, LOW);
    //replace with stepper code
    }else{
      goto start;
    }
  }


    //move stepper __degrees one direction if stepper at this POINT A,
    //move the motor  __ degrees opposite direction if at POINT B.
10  Using Arduino / Programming Questions / 12 button Keypad input into a string on: July 21, 2011, 08:55:18 pm
so i want to work with the 12 button keypad from sparkfun. i know that there are a lot of tutorials explaining it but none really cover taking four seperate inputs from the keypad and turning them into a string that could be used as a password. should i just get the inputs one by one and try to label them with names then use that to create a string?  im working with the:  Keypad Library for Arduino
                                                                         Author:  Mark Stanley, Alexander Brevig
11  Using Arduino / Displays / Help: Need Sony Ericsson t60lx display Pinout on: June 08, 2011, 05:10:21 pm
if someone could help me search for the pinout for the display from my old t60lx that would be aswome. i know that it is a 1.9" TFT display capable of 262k colors w/ 176x220 pixel resolution. it only has 6 pins . thanks.
Pages: [1]