Coder Social home page Coder Social logo

giljr / ardu_serie Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 11.0 270.94 MB

Arduino is the Apollo Project of the maker movement!!!

Lua 0.07% JavaScript 0.11% Processing 0.26% C++ 29.86% C 67.60% Assembly 1.14% Batchfile 0.01% Jupyter Notebook 0.96%

ardu_serie's People

Contributors

giljr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ardu_serie's Issues

Usage of Wire.requestFrom() and Wire.available().

The Wire.beginTransmission() and Wire.endTransmission() are only used when writing data. They should not be used with Wire.requestFrom().
The Wire.requestFrom() does a complete I2C transaction on its own, and when it returns the I2C transaction has completely finished and the received data is waiting in a buffer in the Wire library. The Wire.available() tells how many bytes are in that buffer.

In the next files, the Wire.requestFrom() is encapsulated by Wire.beginTransmission() and Wire.endTransmission(). You can remove those Wire.beginTransmission() and Wire.endTransmission().

  • _35_GY85__ITG3205_Gyroscope_07.ino
  • _35_GY85_ADXL354_Accelerometer_06.ino

When requesting a single byte, and testing it with: if (Wire.available() <= 1), then it is always true. When there was a problem on the I2C bus and the Wire library could detect it, then Wire.available() would probably return zero. If everything was okay, the Wire.available() would return the same number as requested.

Therefor, all those if (Wire.available() <= ?) can be removed. It is used in the files:

  • _34_gyroscope_code.ino
  • _34_magnetometer_code.ino
  • _35_GY85_HMC5883L_Magnetometer_08.ino
  • _24_arduSerie_Arduino_Compass.ino
  • _24_arduSerie_Arduino_Bluetooth_Compass.ino
  • _34_accelerometer_code.ino
  • _34_Sensor_ADXL345_Template.ino

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.