Reading I2C sensor port on arduino

Hi

I am trying to read my distance sensor using arduino from my IMU board. I have connected my sonar in the pitot tube port and I have writtten code to read from the sensor. However i do not know which pin I should use to read.

Anyone that can help me would be great.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Such is defining inputs according to architecture. If it is analog then scale accordingly.

  • Ok, a MaxBotics EZ0. I have played with the EZ1; same interface. It doesn't support I2C at all. It supports asynch TTL Serial, as well as Analog and pulse width timing.

    Let's go back to the analog interface you were pursuing. You need to read an analog value from some pin. You don't know what pin name to use in your code.

    On this page, you might notice that the left side of the IMU shield (below) has silkscreen labels on a row of otherwise unconnected pin header holes. I wonder what those labels say... (hint)

    IMG_4803.JPG?width=300

    Analog (ADC) pins may sometimes be labeled ADCx or ANx where x is, say 0 thru 15. (hint)

    Suppose you were to connect the MaxBotics analog pin (see datasheet pdf) to one of the exposed analog pins on the  board... In Arduino analog pins are also given names as you know. And you'd reference them as indicated when using analogRead()

    Hope the hints help point you in the right direction.

  • Which arduino? or which board? On the 168/328P the I2C peripheral is fixed on pin 27/28 (SDA, SCL). http://arduino.cc/it/Hacking/PinMapping168

This reply was deleted.

Activity