Want two extra A/D ports - they're there for the taking!


While looking at the GoPiGo-3 schematic, (looking for something else), I noticed an interesting fact about the A/D connectors - they have two signal pins.

Of course, both of the signal pins on a particular A/D connector are used for the software i2c interface, if you’re using it.

However, if you’re just using the connector as an independent A/D connector, there’s an extra signal pin you can use.  And unlike the “normal” Grove A/D input, all four A/D input pins are completely independent of each other, making all of them fair game for whatever you want to do with them.  (That’s assuming that you’re not using them for something else, like software i2c.)

For example, I use AD-1 on the A/D 1 connector for Charlie’s front bumper and both signal pins on A/D 2 for the Inertial Measurement Unit.  I could use the other, (unused), pin on A/D 1 for a rear bumper, or as a measurement input for something.

Exactly how to get to that extra pin, I do not know.  However I would not be surprised if the EasyGoPiGo library doesn’t give access to it.


GoPiGo-3 AD connectors

So, if you have a project, (or a 'bot), that’s crying for an extra A/D input or two, here they are!


You have to get familiar with the set_grove type, mode, state, pwm_duty, pwm_freq functions,
and get_grove value, state, voltage, and analog functions, in gogpgo3.py

and use


for port, and


for type,

and the various gopigo3 constants …


as appropriate to the function

or get familiar with the easysensors package:

easysensors.Sensor.set_pin (pin) Selects one of the 2 available pins of the grove connector.
easysensors.Sensor.get_pin () Tells us which pin of the grove connector is used.
easysensors.Sensor.set_port (port) Sets the port that’s going to be used by our new device.
easysensors.Sensor.get_port () Gets the current port our device is connected to.
easysensors.Sensor.get_port_ID () Gets the ID of the port we’re set to.
easysensors.Sensor.set_pin_mode (pinmode) Sets the pin mode of the port we’re set to.
easysensors.Sensor.get_pin_mode () Gets the pin mode of the port we’re set to.

Word to the wise from Mother…

Read every def xxx(): in gopigo3.py, easygopigo3.py , and easysensors.py to “know” what your GoPiGo3 can do!
and there are examples for most things in ~/Dexter/GoPiGo3/Software/Python/Examples/
(I think there is a one pin active at a time limit because there is an easysensors.set_pin() function.)