With Beaglebone Green - SeeedStudio Grove-I2C ADC Manual

Table of Contents

Advertisement

5.2

With Beaglebone Green

To begin editing programs that live on BBG, you can use the Cloud9 IDE.
As a simple exercise to become familiar with Cloud9 IDE, creating a simple application to blink one of the 4
user programmable LEDs on the BeagleBone is a good start.
If this is your first time to use Cloud9 IDE, please follow this link.
Step1: Set the Grove - UART socket as a Grove - GPIO Socket, just follow this link.
Step2: Click the "+" in the top-right to create a new file.
Step3: Copy and paste the following code into the new tab.
from Adafruit_I2C import Adafruit_I2C
import time
ADDR_ADC121
=
0x50
REG_ADDR_RESULT
=
REG_ADDR_ALERT
=
0x01
REG_ADDR_CONFIG
=
REG_ADDR_LIMITL
=
REG_ADDR_LIMITH
=
REG_ADDR_HYST
=
0x05
REG_ADDR_CONVL
=
0x06
REG_ADDR_CONVH
=
0x07
i2c
= Adafruit_I2C(ADDR_ADC121)
class
I2cAdc:
def
__init__(self):
0x00
0x02
0x03
0x04
9

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Grove-I2C ADC and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents