Go Down

Topic: I have a Mega2560 that won't read from my computer... (Read 655 times) previous topic - next topic

scralings

I have a Mega2560 that won't read from my computer.  Both are are COM4.  I get:


avrdude: Version 6.0.1, compiled on Apr  3 2014 at 23:12:16
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x03

avrdude done.  Thank you.

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.


Any help is greatly appreciative.

ieee488

Are you sure you have the right driver installed?

scralings


scralings

/*
  Ray's LEGO Train
  <RayLEGOTrain.ino>
  Raymond Brown
  scralings.raymond@gmail.com
  04-25-2016
*/

#include <legopowerfunctions.h>
#include <LEGOPowerFunctions.h>
#include <Servo.h>

Servo servoMainA; // Define our Servo
Servo servoMainB;
Servo servoMainC;
Servo servoMainD;
Servo servoMainE;
Servo servoMainF;
Servo servoMainG;
Servo servoMainH;
Servo servoMainI;
Servo servoMainJ;
Servo servoMainK;
Servo servoMainL;
// Servo servoMainM;
Servo servoMainN;
Servo servoMainP;
Servo servoMainQ;
Servo servoMainR;

int curSpeed = 0;
// int curSpeedRed = 0;
// int curSpeedOrange = 0;
// int curSpeedBlue = 0;

LEGOPowerFunctions lego(13);
int switchA = 22;
int switchB = 24;
int switchC = 26;
int switchD = 28;
int switchE = 30; // possibly goes away as "D" take on dual role
int switchF = 32;
int switchG = 34;
int switchH = 36;
int switchI = 38;
int switchJ = 40;
int switchK = 42;
int switchL = 44;
// int switchM = 46;
int switchN = 46;
int switchP = 48;
int switchQ = 50;
int switchR = 52;

int countA = 0;
int countB = 0;
int countC = 0;
int countD = 0;
int countE = 0; // possibly goes away as "D" take on dual role
int countF = 0;
int countG = 0;
int countH = 0;
int countI = 0;
int countJ = 0;
int countK = 0;
int countL = 0;
// int countM = 0;
int countN = 0;
int countP = 0;
int countQ = 0;
int countR = 0;
// int buttonStateA = 0;
// int fwdRevA = 0;
// int stationPin = 2;
// int buzzerPin = 11;

void setup()
{
  Serial.begin(9600);
  pinMode(switchA, INPUT);
  pinMode(switchB, INPUT);
  pinMode(switchC, INPUT);
  pinMode(switchD, INPUT);
  pinMode(switchE, INPUT);
  pinMode(switchF, INPUT);
  pinMode(switchG, INPUT);
  pinMode(switchH, INPUT);
  pinMode(switchI, INPUT);
  pinMode(switchJ, INPUT);
  pinMode(switchK, INPUT);
  pinMode(switchL, INPUT);
  // pinMode(switchM, INPUT);
  pinMode(switchN, INPUT);
  pinMode(switchP, INPUT);
  pinMode(switchQ, INPUT);
  pinMode(switchR, INPUT);
  // pinMode(stationPin, INPUT);
  servoMainA.attach(23); // servo on digital pin 10
  servoMainB.attach(25);
  servoMainC.attach(27);
  servoMainD.attach(29);
  servoMainE.attach(31);
  servoMainF.attach(33);
  servoMainG.attach(35);
  servoMainH.attach(37);
  servoMainI.attach(39);
  servoMainJ.attach(41);
  servoMainK.attach(43);
  servoMainL.attach(45);
  // servoMainM.attach(47);
  servoMainN.attach(47);
  servoMainP.attach(49);
  servoMainQ.attach(51);
  servoMainR.attach(53);
  // pinMode(buzzerPin, OUTPUT);
}

void loop()
{
  if ( digitalRead(switchA) == 0 )
  {
    countA++;
    delay(3000);
  }
  if (countA <= 2)
  {
    lego.SingleOutput( PWM, PWM_FWD5, RED, CH1);
    delay(100);
    if (digitalRead(switchA) == 0)
    {
      lego.SingleOutput( PWM, PWM_FLT, RED, CH1);
      servoMainA.write(0); // Turn Servo Left to 45 degrees
      delay(2000);
      // tone(11,2000,1000);
      // delay(500);
    }
  }
  else
  {
    servoMainA.write(90); // Turn Servo Left to 45 degrees
    countA = 0;
  }


  if ( digitalRead(switchB) == 0 )
  {
    countB++;
    delay(3000);
  }
  if (countB <= 2)
  {
    lego.SingleOutput( PWM, PWM_FWD5, RED, CH1);
    delay(100);
    if (digitalRead(switchB) == 0)
    {
      lego.SingleOutput( PWM, PWM_FLT, RED, CH1);
      servoMainB.write(0); // Turn Servo Left to 45 degrees
      delay(2000);
    }
  }
  else
  {
    servoMainB.write(90); // Turn Servo Left to 45 degrees
    countB = 0;
  }


  if ( digitalRead(switchC) == 0 )
  {
    countC++;
    delay(3000);
  }
  if (countC <= 2)
  {
    lego.SingleOutput( PWM, PWM_FWD5, RED, CH1);
    delay(100);
    if (digitalRead(switchC) == 0)
    {
      lego.SingleOutput( PWM, PWM_FLT, RED, CH1);
      servoMainC.write(0); // Turn Servo Left to 45 degrees
      delay(2000);
    }
  }
  else
  {
    servoMainC.write(90); // Turn Servo Left to 45 degrees
    countC = 0;
  }
...
}

ieee488


westfw

Quote
What is the purpose of posting all that code?
Sheesh.  They've probably been reading all the posts where newbies get flamed to "post ALL your code."
 
Quote
Using Port                    : COM4
    Using Programmer              : stk500v1
    Overriding Baud Rate          : 19200
These are not the correct parameters for uploading to an Arduino MEGA.  It should be "wiring" at 115200bps.
It looks rather like you somehow have things set to "upload using programmer" with the programmer type to "arduino as ISP" instead of a simple upload (don't use "shift-upload")


Go Up