Problem with the upload

i am using an arduino mega 2650 i havent had this problemthroughout my whol testing proccess and now it all fails...

i cant get te scetch to upload to the board. it compiles then says upload.... forever
the L light blinks once then the RX blinks every so often once then nothing...

any suggestions

-RKN

ps i am using the new updated software

Are there three consecutive exclamation marks ("!!!") anywhere in your sketch? One version of the bootloader recognizes them as an attempt to start the built in monitor program. Try with just two exclamation marks. :slight_smile:

my problem is i beieve with the board itself i cant even upload the blink scetch anymore it just freezes in the upload stage.

Perhaps the firmware for the USB-to-Serial processor has gotten corrupted and needs re-writing:

this does not work.. when i upload the 'L' light lights up then the RX light flashes every once in a while like its slowing receiving but never quite does.

actually went back to the previous version of the arduino computer software 0023 and it works great so im not exactly sure why....

but it seems to work...

just kind of upset i didnt try tht first

THNX for your help

next part of the project... im not sure where to post this so i just continued on with my thread maybe a mod can move it.

I am looking to use this code...

/** Imports **/

#include <Keypad.h>

/** Keypad **/

const byte ROWS = 4;
const byte COLS = 4;

char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

byte rowPins[ROWS] = {32,34,36,38};
byte colPins[COLS] = {33,35,37,39};

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

/** Pins **/

int ledPinRed = 50;
int ledPinGreen = 52;
int ledPinBlue = 52;
int lock = 22;

/** Variables **/

String passcode = "147A";
String debugMode = "ADBC";

String currentCode = "";
String tempCode = "";

String debug = "N";
String auth = "N";

int currentCodeCount = 0;
int tempInt = 0;



void setup() 
{
  pinMode(ledPinRed, OUTPUT);
  pinMode(ledPinGreen, OUTPUT);
  pinMode(ledPinBlue, OUTPUT);
  pinMode(lock, OUTPUT);
  
  Serial.begin(9600);
}

void loop() 
{
  char key = kpd.getKey();

  if(key != NO_KEY)
  {
    if(key == '*' && debug == "N")
    {
      flashGreenBlue(1000);
      codeReset();
      
      Serial.println("Cleared!");
    }
    else
    {
        currentCode = currentCode + key;
        currentCodeCount += 1;
        flashBlue(100);
      
        Serial.println(currentCode);
    }
    
    if(debug == "N")
    {
      if(currentCode == passcode)
      {
        doorOpen();
        codeReset();
      }
      else if(currentCode == debugMode)
      {
        analogWrite(ledPinRed, 127);
        digitalWrite(ledPinGreen, HIGH);
        codeReset();
        debug = "Y";
      }
      else if(currentCodeCount == 4)
      {
        flashRed(4000);
        Serial.println("Access Denied");
        codeReset();
      }
    }
    else
    {
      if(auth == "N")
      {
        if(currentCode == passcode)
        {
          digitalWrite(ledPinRed, LOW);
          flashGreen(1000);
          auth = "Y";
          codeReset();
        }
        else if(currentCodeCount == 4)
        {
          digitalWrite(ledPinGreen, LOW);
          flashRed(1000);
          auth = "N";
          debug = "N"; 
          codeReset();
        }
      }
      else
      {
        if(key == '*')
        {
          digitalWrite(ledPinBlue, HIGH);
          
          while(tempInt < 4)
          {
            char key = kpd.getKey();
  
            if(key != NO_KEY)
            {
              tempCode = tempCode + key;
              tempInt += 1;
              flashBlue(100);
            }
          }
          
          digitalWrite(ledPinBlue, LOW);
        
          flashGreen(100);
          delay(100);
          flashGreen(100);
        
          setPasscode();
        }
        else if(key == '1')
        {
          digitalWrite(ledPinGreen, HIGH);
          digitalWrite(lock, HIGH);
        }
        else if(key == '2')
        {
          digitalWrite(lock, LOW);
          digitalWrite(ledPinGreen, LOW);
        }
        else if(key == '#')
        {
          codeReset();
          flashRed(500);
          auth = "N";
          debug = "N";
        }
      }
    }
  }
}

/** Keypad Controls **/

void codeReset()
{
  currentCode = "";
  currentCodeCount = 0;
}

void setPasscode()
{
  passcode = tempCode;
  tempCode = "";
  tempInt = 0;
}

/** Motor Controls **/

void doorOpen()
{
  digitalWrite(ledPinGreen, HIGH);
  digitalWrite(lock, HIGH);
  Serial.println("Open");
  delay(6500);
  digitalWrite(ledPinGreen, LOW);
  digitalWrite(lock, LOW);
  Serial.println("Locked");
}
 
/** LED Control **/ 

void flashRed(int delayCount)
{
  digitalWrite(ledPinRed, HIGH);
  delay(delayCount);
  digitalWrite(ledPinRed, LOW);
}

void flashGreen(int delayCount)
{
  digitalWrite(ledPinGreen, HIGH);
  delay(delayCount);
  digitalWrite(ledPinGreen, LOW);
}

void flashBlue(int delayCount)
{
  digitalWrite(ledPinBlue, HIGH);
  delay(delayCount);
  digitalWrite(ledPinBlue, LOW);
}

void flashGreenBlue(int delayCount)
{
  digitalWrite(ledPinGreen, HIGH);
  digitalWrite(ledPinBlue, HIGH);
  delay(delayCount);
  digitalWrite(ledPinGreen, LOW);
  digitalWrite(ledPinBlue, LOW);
}

but i want to have (2) keypads.
how would i go about using multiple keypads. i have the mega so i have the pins to use 7 more i just dont know how the code would know which keypad was talking.

change the to [code]and to [/code]

thanx

Topic Moved to

http://arduino.cc/forum/index.php/topic,89075.0.html

-rkn