GithubHelp home page GithubHelp logo

Comments (3)

dwilches avatar dwilches commented on July 24, 2024

Hi!

You are welcome :). It is good to hear this project is being useful out there.

This library can send any string over to the Arduino, just as the one you mentioned.
The problem you describe sounds like you are using the Serial.read() function in your Arduino code, which only reads the first byte sent (if you call it a second time you would get the second character sent).
If you want to read a full string, check the function Serial.readString(), that will read the whole string sent. Then you can use the function toCharArray() to copy it to a normal C-like string and break it by commas using strtok().

from ardity.

twhalen08 avatar twhalen08 commented on July 24, 2024

Thank you! I appreciate the assistance!

from ardity.

dwilches avatar dwilches commented on July 24, 2024

You are welcome!

Please note I modified a bit my answer, do not use c_str() with strtok() because strtok modifies the first argument (i.e. the string returned by c_str), which is something the Arduino docs tell us not to do.

Better use toCharArray() that copies the string to a different char array that you can modify with strtok as you want.

from ardity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.