rvt / headtracker

Head Tracker using MPU6050/MPU9250 and ESP8266
BSD 3-Clause "New" or "Revised" License
33 stars 10 forks source link

ArduinoJson Ver>6.20 causes compilation issues #7

Closed Zhaosn closed 9 months ago

Zhaosn commented 9 months ago

main.cpp:112 result in

cannot bind non-const lvalue reference of type 'string&' to an rvalue of type 'string'

reference: https://arduinojson.org/v6/api/jsonvariant/as/

I tried for hours before I realized I should look here😂

Snipaste_2024-01-28_00-09-58

When I changed this line to "const char tmp = json["tracker_server"].as<const char>();" the problem was solved

I've made a similar headtracker before and found this much superior project only after doing so. I learned platformIO through this project while adapting my nodemcuv2, thanks to this project. Also, generating html or js looks like it requires linux, which I found can now be generated and downloaded from Codespaces.

I'm using a translation program, so I apologize for the reading inconvenience!

Zhaosn commented 9 months ago

8 made this change and can compile successfully now.