Analog and Digital Address

Hey guys!

Just one question:

In a python where i use all the digitals ports and all the analogs ports i can’t do this :

relay1 = 2 (for D2)
sensor1 = 2 (for A2)

How can i do this ?

relay1 = 2
sensor1 = A2 (This dont work :s)

Thanks.

Hey,
To use the analog ports for digital I/O, you have to specify the digital ports D0-D13 as 0-13 and to use the analog ports, you specify A0-A6 as 14-19.

You should read the discussion here: http://www.dexterindustries.com/forum/?topic=ports-newbie-question for more details on how ports work.

-Karan

Thanks you for your answer, it’s work verry well for A0->A2 = 14->16 but what is A3 A4 A5 A6 ? i2C ?

What is I2C connection ?
Can you make a list of materials which can be already compatible with I2C grovepi ? its sensors? other boad ?

Thanks you for your fast answers .

Hey,
The pin number from A3-A5 are 17-19. A6 and A7 are analog only and cannot be used as digital ports. They are also not being used right now because we ran out of space for the Grove connectors on the board.

A4 and A5 are right now being used for I2C byt which GrovePi communicates with the Raspberry Pi and other I2C sensors so these port cannot be used for analog stuff. Read more about I2C here: https://learn.sparkfun.com/tutorials/i2c.

GrovePi is compatible with most of Grove Sensors listed here: http://www.seeedstudio.com/wiki/Grove_System and we have code for these http://www.dexterindustries.com/GrovePi/supported-sensors/ available but adding code for otehr sensors is pretty easy too.

-Karan