Programming Help


the program im trying upload arduino uno follows,


/**
* read card using mfrc522 reader on spi interface
* pin layout should follows (on arduino uno):
* mosi: pin 11 / icsp-4
* miso: pin 12 / icsp-1
* sck: pin 13 / iscp-3
* ss: pin 10
* rst: pin 9
*
* script based on script of miguel balboa.
* new cardnumber printed when card has changed. dot printed
* if card same.
*
* @version 0.1
* @author henri de jong
* @since 06-01-2013
*/

#include <spi.h>
#include <rfid.h>

#define ss_pin 10
#define rst_pin 9

rfid rfid(ss_pin, rst_pin);

int buzzpin = 3;

// setup variables:
    int sernum0;
    int sernum1;
    int sernum2;
    int sernum3;
    int sernum4;

void setup()
{
  serial.begin(9600);
  spi.begin();
  rfid.init();
}

void loop()
{
   
    if (rfid.iscard()) {
        if (rfid.readcardserial()) {
            if (rfid.sernum[0] != sernum0
                && rfid.sernum[1] != sernum1
                && rfid.sernum[2] != sernum2
                && rfid.sernum[3] != sernum3
                && rfid.sernum[4] != sernum4
            ) {
                /* new cardnumber, show it. */
                serial.println(" ");
                serial.println("card found");
                sernum0 = rfid.sernum[0];
                sernum1 = rfid.sernum[1];
                sernum2 = rfid.sernum[2];
                sernum3 = rfid.sernum[3];
                sernum4 = rfid.sernum[4];
               
                //serial.println(" ");
                serial.println("cardnumber:");
                serial.print("dec: ");
      serial.print(rfid.sernum[0],dec);
                serial.print(", ");
      serial.print(rfid.sernum[1],dec);
                serial.print(", ");
      serial.print(rfid.sernum[2],dec);
                serial.print(", ");
      serial.print(rfid.sernum[3],dec);
                serial.print(", ");
      serial.print(rfid.sernum[4],dec);
                serial.println(" ");
                       
                serial.print("hex: ");
      serial.print(rfid.sernum[0],hex);
                serial.print(", ");
      serial.print(rfid.sernum[1],hex);
                serial.print(", ");
      serial.print(rfid.sernum[2],hex);
                serial.print(", ");
      serial.print(rfid.sernum[3],hex);
                serial.print(", ");
      serial.print(rfid.sernum[4],hex);
                serial.println(" ");
                //buzzer
                analogwrite(3,20);
                delay(500);
                analogwrite(3,0);
             } else {
               /* if have same id, write dot. */
               serial.print(".");
             }
          }
    }
   
    rfid.halt();
}



now, when click verify or upload error. screenshot of errror in attachment. appreciated , awesome if fix program upload fixed copy thread. :)

several things. first, many people here reluctant open file cannot confirm. better responses here, please read nick gammon's post @ top of forum title how post forum, use of code tags when presenting code listings. next, you'd better off display error message expect people here open unknown file. finally, see if ctrl-t on source code when it's in ide makes easier read.


Arduino Forum > Using Arduino > Programming Questions > Programming Help


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor