-
Notifications
You must be signed in to change notification settings - Fork 9
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
No serial output #7
Comments
Hmmm, I don't know why. Sorry about that. Can you try printing glossentry, glossdiv, and glossary? |
@wyojustin Thank you for your fast reply! No, there is nothing, something is erasing the whole Json String in the "jsonRemoveWhiteSpace" function. I really need this library! Could you please fix it? I don't wanna use the heavy ArduinoJson library. |
I will be able to test... but it might be tomorrow. Do any of the other test work? |
Just tested them all and neither of them are working! Also, in the "simple_json.ino" there is a "Serial.printf" function at the end and it will not work on Uno, etc... btw.. I'm using v0.1.2 downloaded from here. |
Seems like a bug in the String class. |
@wyojustin I hope you can fix and optimize it and make it lightweight as possible, I wish to use it on ATtiny85 too. |
Thanks @beicnet . Looks like a bug with String class. I can find "coords", unless I print a couple of lines. `jsonExract.name::"coord" coord: Serial.begin(115200); String coord = jsonExtract(json, "coord"); but not with this code: Serial.begin(115200); String coord = jsonExtract(json, "coord"); jsonExract.name::"coord" coord: ` |
The extra println's break the simple example. Only place now is to stop using the String class (which I've been warned against using in the first place). |
Ok, simple "jsonExtract" function working on clean one line Json String, but would it work as same if it has spaces or the example shown below?
|
You might be able to get this to work. It only uses char[]. I gave up on String class. I'm going to leave this for now. Good luck. Hope to get back to this later. `void delete_whitespace(char* source){ } String jsonIndexList(char* json, int idx, char* out){ while(i < n && count > 0){ bool equal(char* a, char* b, int k){ int indexOf(char* source, char* search, int start){ for(int i = start; i < n; i++){ void copy(char* source, char* dest, int k){ int k = strlen(name); char *json = "{"coord":{"lon":-77.35,"lat":38.93},\n" void setup(){ Serial.begin(115200); char coord[100]; jsonExtract(json, "coord", coord); jsonExtract(coord, "lat", lat); Serial.println(); Serial.print("coord:"); Serial.print("lat:"); Serial.print("lon:"); /* void loop(){ |
Hi there,
I tried to test the "json_org.ino", but it doesn't give me any Json output on the Serial terminal, I'm using Arduino IDE v1.8.2 for reference.
Any ideas?
Kind regards,
Viktor
The text was updated successfully, but these errors were encountered: