Can I light up only one bargraph?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- lbkulinski
- Posts: 116
- Joined: Wed May 07, 2014 4:41 pm
Can I light up only one bargraph?
I just ordered two 24-Bar Bargraph w/I2C Backpack Kits for my project and I was wondering if I could only light up one of the two bars with some code while it is on the backpack. Thanks.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Can I light up only one bargraph?
You will need to select two different I2C addresses, one for each bargraph display. For instance, 0x70 and 0x71.
https://learn.adafruit.com/adafruit-led ... 2c-address
In your sketch, declare two instances of the bargraph object
Call begin on each instance, and supply the I2C address for each:
Now you can control each bargraph separately
https://learn.adafruit.com/adafruit-led ... 2c-address
In your sketch, declare two instances of the bargraph object
Code: Select all
Adafruit_24bargraph bar_1 = Adafruit_24bargraph();
Adafruit_24bargraph bar_2 = Adafruit_24bargraph();
Call begin on each instance, and supply the I2C address for each:
Code: Select all
bar_1.begin(0x70); // pass in the address of the first bargraph
bar_2.begin(0x71); // pass in the address of the second bargraph
Please be positive and constructive with your questions and comments.