5 Replies Latest reply on Jun 1, 2015 10:58 AM by mbox

    Edison Receiving data is unreadeble

    mbox

      Hello everyone, I'm trying to test my edison to display text on the serial monitor and receiving data by entering 1 or 2. Displaying text is no problem but when entering data to edison for processing is unreadable. Here is my code for testing.

      int xctr =0 ;
      // the setup function runs once when you press reset or power the board
      void setup() {
        // initialize digital pin 13 as an output.
        pinMode(5, OUTPUT);
        digitalWrite(5,LOW);
        Serial.begin(9600);
        Serial.println("Ready...");
        delay(2000);
      }
      // the loop function runs over and over again forever
      void loop() {
        xctr++;
        Serial.print(xctr);
        Serial.println(".] Enter 1 or 2 to control LED ");
        delay(1500);              // wait
      }
      
      void serialEvent() {
         while (Serial.available()) {
        char ch = Serial.read();
          if( ch == '1')  // Turn On Load1
          {
          digitalWrite(5,HIGH); 
          }
          if(ch=='2')
          {
            digitalWrite(5,LOW);
          }
        }
      }
      
      

      This is the output when entering 1 or 2 - gives out characters and hangs.

      ToForum4.png

      I tried to change baud rates but same results. Can anyone give some idea how to resolve it?

       

      Thanks and more power,

      mbox