Giter VIP home page Giter VIP logo

change-address-gp2y0e03's Introduction

Change Address of GP2Y0E03 Sensor Arduino Code

Arduino code for changing GP2Y0E03's address over I2C

This code is heavily based on dbaba's version of code the changer I just ported it to run on the arduino enviroment, so all the credits to the main code go to him, please give him all the love for this over at his repo HERE!

How to do the modification

Solder a wire to the VPP pad on your sensor

Follow the diagram on page 28 of SHARP's Application Note.

Change the #defines to your match your setup

Open the code and go to the first lines to change the define of the VPP pin to the one you connected on your system, and the desired Data for the NEW_ADRESS define to be programmed into the sensor according to the following table:

Possible NEW_ADDRESS data

This instructions were also written by dbaba on his repo so go there to checkout more!

Choose the NEW_ADDRESS on the Data column value of the following table.

Slave ID 7-bit Address Data
0x00 0x00 0x00
0x10 0x08 0x01
0x20 0x10 0x02
0x30 0x18 0x03
0x40 0x20 0x04
0x50 0x28 0x05
0x60 0x30 0x06
0x70 0x38 0x07
0x80 0x40 DEFAULT! 0x08
0x90 0x48 0x09
0xA0 0x50 0x0A
0xB0 0x58 0x0B
0xC0 0x60 0x0C
0xD0 0x68 0x0D
0xE0 0x70 0x0E
0xF0 0x78 DO NOT USE

Please do NOT choose 0x08 as the corresponding Salve ID is the default value.

Updating Slave ID to 0xF0 broke his sensors (He broke 3 sensors...). So he highly recommends you not to use the address 0xF0 (data for 0x0F)

Flash the code and open the Serial Monitor on baudrate 115200 to see the process

If the monitor is displaying dot after dot that means that the operation is complete.

change-address-gp2y0e03's People

Contributors

joaopedrovbs avatar

Stargazers

Pedro H Birais avatar

Watchers

James Cloos avatar  avatar

change-address-gp2y0e03's Issues

it does nothing

i have an arduino pro micro 8mhz / 3.3 volt board.
solderd the vpp pin to pin 7.
set in the code the vpp pin to 7.
but no change in adress.

result :
15:11:51.313 -> stage 9
15:11:51.313 -> Check 0x27[4:0] => 4
15:11:51.313 -> e_fuse_stage9():result => 0
15:11:51.313 -> ...........................

question

I'm chinese,I change address not effect, VPP is directly connected to D3,but D3 is 5V,can? May I contact you? facebook, thank thank thank!!!!

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.