I cannot read rfid properly

Discussion in 'General Programming Discussion' started by can1907, Oct 25, 2014.

  1. can1907

    can1907 New Member

    Joined:
    Oct 25, 2014
    Messages:
    1
    Likes Received:
    0
    Hi guys ı am new on udoo.

    Just i have this code for arduino. For read rfid
    Code:
    // Red--->+5V
    // Black---->GND
    // Blue------>pin 1 also i connect 18,19 like due serial1 comminication.
    
    
    
    void setup()  
    {
      Serial.begin(9600);
      Serial1.begin(9600);
    }
    
    void loop()
    {
      String gelen = "";
      while (Serial1.available()){
        char deger=Serial1.read();
        gelen+=deger;
    
        if (gelen.length() >9) {
          Serial.println(gelen);
         gelen="";
        }
      }
    }
    
    When i upload this code arduino uno with software serial this work good. But in udoo not working, Just i cannot read other serials. But when connect blue wire 1 pin, i get data which is not in my program... but this is sometihng like this "00035265870003526587000352658700035265870003526587" when rfid see card just add over and over string, not a new line in serial monitor also can't going other code block just read this value like this and stack into there. Other serials ı cannot active and read data them and python cannot see this data... SOrry for bad english :)

    Edit: Rfid 125 khz also i tried serialevent result is same :(


    Pls guys help me
     
  2. ekirei

    ekirei Administrator

    Joined:
    Jun 14, 2013
    Messages:
    78
    Likes Received:
    3
    Sometimes the "String" object of Arduino returns strange communication issues when the sketch is compiled and uploaded from the pre installed internal Arduino IDE. You could try to program the Arduino side of UDOO from an external pc to check if the same code works, or try to use char[] instead String.
    Let us know if this do the trick.
     

Share This Page