Giter VIP home page Giter VIP logo

arduino-srf's Introduction

arduino-srf's People

Contributors

leocolomb avatar phiamo avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

arduino-srf's Issues

SRF08 is restrained to 1m

The library need to be aware of gain and location to add a delay between ping and and listener.

  • Let the sensor get the length
  • Avoid echo error

Implement ANN mode readings for SRF08

From https://www.robot-electronics.co.uk/htm/srf08tech.html

ANN mode (Artificial Neural Network) is designed to provide the multi echo data in a way that is easier to input to a neural network, at least I hope it is - I've not actually done it yet. ANN mode provides a 32 byte buffer (locations 4 to 35 inclusive) where each byte represents the 65536uS maximum flight time divided into 32 chunks of 2048uS each - equivalent to about 352mm of range. If an echo is received within a bytes time slot then it will be set to no-zero, otherwise it will be zero. So if an echo is received from within the first 352mm, location 4 will be non-zero. If an object is detected 3m away the location 12 will be non-zero (3000/352 = 8) (8+4=12). Arranging the data like this should be better for a neural net than the other formats. The input to your network should be 0 if the byte is zero and 1 if its non-zero. I have a SOFM (Self Organizing Feature Map) in mind for the neural net, but will hopefully be useful for any type.

Location 4 Location 5 Location 6 Location 7 Locations 8 - 35
0 - 352mm 353 - 705mm 706 - 1057mm 1058 - 1410mm and so on

Locations 2,3 contain the range of the nearest object converted to inches, cm or uS and is the same as for Ranging Mode.

Testing v1.0 and v2.1

Hi,

As I said, I tested the two versions. I give you the results :

v1.0 : Arduino doesn't compile the file. I have tried to modify .cpp and .h files, I just removed "//" which were in front of commands, but it gave the same result :

SRF08.ino: In function 'void setup()':

SRF08:30: error: no matching function for call to 'SonarSRF08::connect()'
C:\Program Files (x86)\Arduino\libraries\ArduinoSRF21/SonarSRF.h:30: note: candidates are: void SonarSRF::connect(int)

SRF08:31: error: no matching function for call to 'SonarSRF08::changeAddress(int, int&, int, int)'
C:\Program Files (x86)\Arduino\libraries\ArduinoSRF21/SonarSRF.h:34: note: candidates are: void SonarSRF::changeAddress(int)

SRF08.ino: In function 'void loop()':
SRF08:42: error: 'class SonarSRF08' has no member named 'setUnit'
SRF08:46: error: 'class SonarSRF08' has no member named 'setRegister'
SRF08:48: error: 'class SonarSRF08' has no member named 'readData'

v2.1 : Arduino compile the files but it does'nt seem to work good. With the resistors, the serial monitor only prints

"Left SRF02 US-Sensor ".

Without them, it prints :

Left SRF02 US-Sensor
-1
Right SRF02 US-Sensor
11
Main SRF08 US-Sensor
-1

I precise I made EEPROM clear before testing each program. I tried these programs with an arduino uno and a srf 08 sonar.

Thank you for your help,

auguste95.

Compilation error

Hello,

I have a problem with my srf 08 sonar and your program. I copy the Arduino-SRF-Master in the "libraries" file of arduino, otherwise it didn't want to compile the example you give at all. So I retried to compile your example after copying, but I received some errors :

C:\Program Files (x86)\Arduino\libraries\ArduinoSRFmaster\SonarSRF08.cpp:26: error: no 'void SonarSRF08::setUnit(int, int, char, int, int)' member function declared in class 'SonarSRF08'

C:\Program Files (x86)\Arduino\libraries\ArduinoSRFmaster\SonarSRF08.cpp:44: error: no 'void SonarSRF08::setRegister(int, int)' member function declared in class 'SonarSRF08'

C:\Program Files (x86)\Arduino\libraries\ArduinoSRFmaster\SonarSRF08.cpp:54: error: no 'int SonarSRF08::readData(int, int)' member function declared in class 'SonarSRF08'

Did I make forget something I had to do before compiling ?
Please, could you help me ?

Thank you very much,

auguste95.

No need to wait after `Wire.requestFrom()`

In the file "Arduino-SRF/src/SonarSRF.cpp" there is a while (Wire.available() < length); after the Wire.requestFrom(). That line can be removed, because there is nothing to wait for.

When the Wire.requestFrom() returns, the I2C transaction on the bus has completely finished and the received data is waiting in a buffer in the Wire library.

Unable to connect with sensor

I have tried to use this library with a SRF08, and tested the corresponding example, but I don't even get the "Sensor X not connected..." message on the serial monitor.

Am I missing something?

I checked the I2C address of my sensor and then changed it on the code but nothing happens.

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.