problem uploading to board?


i error while uploading code

global variables use 1,124 bytes (54%) of dynamic memory, leaving 924 bytes local variables. maximum 2,048 bytes.
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x63
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x63
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x63
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x63
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x63
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x63
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x63
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x63
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x63
avrdude: stk500_recv(): programmer not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x63
problem uploading board.  see http://www.arduino.cc/en/guide/troubleshooting#upload suggestions.

code: [select]
//include necessary libraries
  #include <adafruit_cc3000.h>
  #include "motordriver.h"
#include <spi.h>
#include "utility/debug.h"
#include "utility/socket.h"
byte mac[] = { 0xde, 0xad, 0xbe, 0xef, 0xfe, 0xed };
// these interrupt , control pins
#define adafruit_cc3000_irq   3  // must interrupt pin!
// these can 2 pins
#define adafruit_cc3000_vbat  5
#define adafruit_cc3000_cs    10
// use hardware spi remaining pins
// on uno, sck = 13, miso = 12, , mosi = 11

adafruit_cc3000 cc3000 = adafruit_cc3000(adafruit_cc3000_cs, adafruit_cc3000_irq, adafruit_cc3000_vbat,
                                         spi_clock_divider); // can change clock speed

#define wlan_ssid       "wentworth"   // cannot longer 32 characters!
#define wlan_pass       "dawsonliam"
// security can wlan_sec_unsec, wlan_sec_wep, wlan_sec_wpa or wlan_sec_wpa2
#define wlan_security   wlan_sec_wpa2

#define listen_port           80      // tcp port listen on connections. 
                                      // http protocol uses port 80 default.

#define max_action            10      // maximum length of http action can parsed.

#define max_path              64      // maximum length of http request path can parsed.
                                      // there isn't memory available keep short!

#define buffer_size           max_action + max_path + 20  // size of buffer incoming request data.
                                                          // since first line parsed this
                                                          // needs large maximum action
                                                          // , path plus little whitespace and
                                                          // http version.

#define timeout_ms            500    // amount of time in milliseconds wait for
                                     // incoming request finish.  don't set this
                                     // high or server slow respond.

adafruit_cc3000_server httpserver(listen_port);
uint8_t buffer[buffer_size+1];
int bufindex = 0;
char action[max_action+1];
char path[max_path+1];
     
  string webclickrequest;
     
     
  void setup(){
   
     // initialize digital pin output.
    motordriver.init();
motordriver.setspeed(200,motorb);
motordriver.setspeed(200,motora);
     
      serial.begin(115200);
  serial.println(f("hello, cc3000!\n"));

  serial.print("free ram: "); serial.println(getfreeram(), dec);
 
  // initialise module
  serial.println(f("\ninitializing..."));
  if (!cc3000.begin())
  {
    serial.println(f("couldn't begin()! check wiring?"));
    while(1);
  }
 
  serial.print(f("\nattempting connect ")); serial.println(wlan_ssid);
  if (!cc3000.connecttoap(wlan_ssid, wlan_pass, wlan_security)) {
    serial.println(f("failed!"));
    while(1);
  }
   
  serial.println(f("connected!"));
 
  serial.println(f("request dhcp"));
  while (!cc3000.checkdhcp())
  {
    delay(100); // todo: insert dhcp timeout!
  } 

  // start listening connections
  httpserver.begin();
 
  serial.println(f("listening connections..."));
}
   
    void loop(){
    // try client connected.
  adafruit_cc3000_clientref client = httpserver.available();
  if (client) {
    if (client) {
        while (client.connected()) {
          if (client.available()) {
            char c = client.read();
     
            //read incoming http request
            if (webclickrequest.length() < 100) {
     
              //store request string
              webclickrequest += c;

            }
     
            //check see if request has come end
            if (c == '\n') {
     
              //begin drawing out website using
              //using basic html formatting css
              client.println(f("http/1.1 200 ok"));
              client.println(f("content-type: text/html"));
              client.println();
              client.println(f("<html>"));
              client.println(f("<head>"));
              client.println(f("<title>internet controlled rc car</title>"));
              client.println(f("<style>"));
              client.println(f("body{margin:50px 0px; padding:0px; text-align:center;}"));
              client.println(f("h1{text-align: center; font-family:\"trebuchet ms\",arial, helvetica, sans-serif; font-size:24px;}"));
              client.println(f("a{text-decoration:none; width:75px; height:50px; border-color:black; font-family:\"trebuchet ms\",arial, helvetica, sans-serif; padding:6px; background-color:#aaaaaa; text-align:center; border-radius:10px 10px 10px; font-size:24px;}"));
              client.println(f("a:link {color:white;}"));
              client.println(f("a:visited {color:white;}"));
              client.println(f("a:hover {color:red;}"));
              client.println(f("a:active {color:white;}"));
              client.println(f("</style>"));
              client.println(f("</head>"));
              client.println(f("<body>"));
              client.println(f("<h1>internet controlled rc car</h1>"));
              client.println(f("<br />"));
              client.println(f("<br />"));       
              client.println(f("<a href=\"/?left\"\">left</a>"));
              client.println(f(" "));
              client.println(f("<a href=\"/?forward\"\">forward</a>")); 
              client.println(f(" "));     
              client.println(f("<a href=\"/?right\"\">right</a>"));
              client.println(f("<br />"));
              client.println(f("<br />"));
              client.println(f("<br />"));           
              client.println(f("<a href=\"/?backleft\"\">back left</a>"));
              client.println(f("<a href=\"/?back\"\">back</a>"));
              client.println(f(" ")); 
              client.println(f("<a href=\"/?backright\"\">back right</a>"));
              client.println(f("</body>"));
              client.println(f("</html>"));
     
              //stop loading website     
              delay(1);
              client.stop();
     
     
     
            //check see if of drive commands have been sent
            //from webpage arduino
           
            if(webclickrequest.indexof("?left") > 0){
              serial.println(f("hello"));
                  motordriver.goleft();
                  delay(1000);
                  motordriver.stop();
            }

            else if(webclickrequest.indexof("?forward") >0){
                motordriver.goforward();
                delay(1000);
                motordriver.stop();
            }
           
            else if(webclickrequest.indexof("?right") >0){
                motordriver.goright();
                delay(1000);
                motordriver.stop();
            }
           
            else if(webclickrequest.indexof("?backleft") >0){
                motordriver.goleft();
                motordriver.gobackward();
                delay(1000);
                motordriver.stop();
            }
           
            else if(webclickrequest.indexof("?back") >0){
                motordriver.gobackward();
                delay(1000);
                motordriver.stop();
            }
           
            else if(webclickrequest.indexof("?backright") >0){
                motordriver.goright();
                motordriver.gobackward();
                delay(1000);
                motordriver.stop();
            }
           
           
            //clear string new incoming data
            webclickrequest="";
     
            }
          }
        }
      }
    }
    }


Arduino Forum > Using Arduino > Programming Questions > problem uploading to board?


arduino

Comments