Coder Social home page Coder Social logo

ericksimoes / ultrasonic Goto Github PK

View Code? Open in Web Editor NEW
135.0 11.0 65.0 158 KB

Minimalist library for Ultrasonic Module HC-SR04, PING))) and Seeed SEN136B5B to Arduino

License: MIT License

C++ 100.00%
arduino ultrasonic minimalist-library hc-sr04 sensor arduino-library ping sen136b5b hacktoberfest ultrasound

ultrasonic's Issues

An Arduino simulation page for the Ultrasonic library!

hi there

Thank you very much for the library.
I have created a simulation page for the Ultrasonic sensor library here:.
https://wokwi.com/arduino/projects/296099969420493322

It is a permanent page and it gives an opportunity for your future library users to play with the library and get a feel of it even before they integrate the library into their own project.

Kindly let me know what you think!
image

If you feel it is good, I would love to create a PR to add the simulation link in the ReadMe file.

Thanks a lot!
Puneeth

Enable the change of sound velocity constants

Currently the constants referring to sound speed can not be modified by the API, just by modifying the code manually.
Consider allowing the value to be passed as a parameter, as a setting.

Time the distance calculation is based on

Why is the time of the answer on the echo-Pin used for distance calculations?? The resulting values are fluctuating strongly.
They are also far worse than calculations based on the runtime of the plus?
This design decision seems to be a "wrong" choice. I noticed this while using the library and couldn't isolate the fluctuating measurements I got while using the sensor because it came from this library with over 1500 uses on Platform IO.
I am somewhat puzzled that the way the time is measured can at all be used for distance calculations!!

Change license

The license is poorly defined.
It is necessary to choose a permissive license, which projects the copyright and stimulates the external contribution.

Commit language

There are many old commits with title and description in Portuguese.
In order to internationalize this project, it is important to translate into English.

Ultrasonic Android on Madsonic Server

Hi! I'm using an older version of Madsonic server, latest free, without activation (MADSONIC 5.1.5260.20150831.0820) and after your latest update your android client can't connect to server. (A network error ocurred. Please check the server address or try again.)
Thank you for all your work!

Create library.properties file

The latest Arduino library specification recommends that there be a library.properties file at the root of the project.
This file should follow the pattern specified here.

Consider suspending the use of classes and adopting structures

Classes are useful, but their performance is less than using structs (given due proportions).
Therefore, it may be interesting to adopt the use of structs where classes are used today. Considering that one of the objectives of this library is to be minimal and optimized, consuming as few resources as possible.

Translate README to PT-BR

Translate README file to Brazilian portuguese

Description
The README.md file is available in English only. To expand the reach of this lib, it is important that it be available in other languages.

No longer use the 'pulseIn()' method

Apparently, when this library is used on a non-Arduino-based device, the pulseIn() method, used to wait the echo, causes incompatibility problems.
To prevent any future problems, is recommended to use another strategy to read the length of the pulse (in microseconds), like using micros().

Update the sample file

There are minor fixes to be made to this file:

  • Line size;
  • Spelling of the author's name;
  • Document that by passing INC as a parameter to the distanceRead() method it will be possible to obtain the distance in inches;
  • Update library site;
  • Document that pins are not necessarily 12 and 13;
  • Define update date (after creation date);

Translate README to ES

Translate README file to Spanish.

Description
The README.md file is available in English only. To expand the reach of this lib, it is important that it be available in other languages.

Add WProgram.h to .h

Old IDEs of Arduino haven't support to Arduino.h library.
To keep the most hight compatibility, is important to use the #include <WProgram.h> code block.

Update documentation comments with shorter texts

The comments are very long, in some cases taking up 10 lines.

To improve readability, I recommend putting only references to the latest update. The history of who created or contributed is already registered on GitHub itself.

Library doesn't work with new Seead Ultrasonic Distance Ranger V2

Describe the bug
Code loads, Serial monitor prints line statements but measurement value is always 0

Code to reproduce

#include <Ultrasonic.h>

Ultrasonic myUltrasonicSensor(5);
int distance;

void setup() {
  Serial.begin(9600);
}

void loop() {
  // Pass INC as a parameter to get the distance in inches
  distance = myUltrasonicSensor.read();
  
  Serial.print("Distance in CM: ");
  Serial.println(distance);
  delay(1000);
}

Wiring
Connected to a Seead Senor Shield

Expected behavior
As Sensor is moved distance value should show distance to object

Error message
none

Context (please complete the following information):

  • OS: [e.g. Windows x64]
  • IDE version: [e.g. Arduino 1.8.5]
  • Sensor: [e.g. HC-SC04]
  • Library version [e.g. 2.1.0]

Update README.md file

  • Add image and description about wiring;
  • Change ultrasound for ultrasonic (to help with library searches)
  • Add link to download of .zip;
  • Stylize text (add bold and italic where necessary, highlighting important words);
  • Update link to twitter of author.

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.