Serial.readbytesuntil()

Status
Not open for further replies.

Bhuvanesh123

Advanced Member level 4
Joined
Aug 29, 2013
Messages
113
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Location
Singrauli, India, India
Visit site
Activity points
814
Code:
void setup()
{
  Serial.begin(9600);
}
void loop()
{char a[10];

  if(Serial.available())
  {
    byte b=Serial.readBytesUntil(b,a,10  );
    Serial.println(b);
  }
}
this is an arduino code

here terminator string is b
input:adb
actuall output:3

but expected out put is 2.how could it include terminator character as it made to terminate..help me
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…