Serial.setTimeout()

Discussion in 'Embedded Systems and Microcontrollers' started by bhuvanesh, Jan 2, 2014.

Thread Status:
Not open for further replies.
  1. bhuvanesh

    Thread Starter Member

    Aug 10, 2013
    268
    2
    Code ( (Unknown Language)):
    1. void setup()
    2. {
    3.   Serial.begin(9600);
    4. }
    5. void loop()
    6. {char a[10];
    7. if(Serial.setTimeout(1000)<1000)
    8. {
    9.   if(Serial.available())
    10.   {
    11.     int b=Serial.readBytes(a,10  );
    12.     Serial.println(b);
    13.   }
    14. }}
    is this way of using Serial.settimeout().if not please correct me
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
  3. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    Breaking a problem to very small pieces doesn't really help. Resume the discussion over your whole project in this thread so that people can have a complete idea of what you are trying to do.

    Do not create any more new threads on this project.
     
Thread Status:
Not open for further replies.