Giter Club home page Giter Club logo

Comments (1)

hww avatar hww commented on August 20, 2024

Another interesting behavior happens when the Reader replaced by Scanner (example before)
Lets assume to call the next code in the infinitive loop, and the serial port gets infinitive stream of bytes. Then the line 8 will never be executed because the scanner returns empty lines. But if break the app in the line 1 or 2 and then continue execution, then the line 8 will print a valid data as minimum once.

Looks like "calling the reader with hi rate does not allow to get a valid data", the problem of concurrency or latency of the driver... Very strange, but it refers me to then next post https://stackoverflow.com/questions/21305392/io-operation-aborted-error-thrown-while-reading-serial-port

1	scanner := bufio.NewScanner(port)
2	scanner.Scan()
3	text := scanner.Text()
4
5	fmt.Println(text)
6	n := len(text)
7	if n > 0 {
8		fmt.Println(n)
9	}

from serial.

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.