-
Notifications
You must be signed in to change notification settings - Fork 13.3k
strtok is not working #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Investigated:
I will put out a pull after some testing. |
Merged. |
How can I get this fix please? should it already be in 1.6.5? |
Normola
pushed a commit
to Normola/Arduino
that referenced
this issue
Feb 19, 2020
Add Cache-control headers to Javascript & CSS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried lot of things found in issues to make strtok working,but no luck.
this is my program
include <string.h>
include <stdint.h>
include <stdlib.h>
void setup() {
Serial.begin(115200);
while(1){
if(Serial.available()){
char in = Serial.read();
if(in == 's') break;
Serial.println("send s");
}
delay(10);
}
char rtopic[60] = "hello-LIGHT-L1-POWER";
char* level;
char* thing_cat;
char* thing_id;
char* feature;
level = strtok(rtopic,"-");
thing_cat = strtok(NULL,"-");
thing_id = strtok(NULL,"-");
feature = strtok(NULL,"-");
Serial.println(level);
Serial.println(thing_cat);
Serial.println(thing_id);
Serial.println(feature);
}
void loop() {
// put your main code here, to run repeatedly:
}
its returning the entire string every time.Please point in the right direction if I'm doing something wrong.
same program is working fine with Arduino IDE and Arduino Uno.
The text was updated successfully, but these errors were encountered: