Hardware Reference
In-Depth Information
2. Adafruit provides libraries to write to the 7-Segment display. In order to write to
the 7-Segment display, we declare a 7-Segment object:
Adafruit_7segment matrix_7segment = Adafruit_7segment();
We initialize the I2C port address of the device in the Arduino
setup() function:
matrix_7segment.begin(0x70);
Now, we can call the object and write data on the display
(code borrowed from Adafruit LED backpack libraries):
matrix_7segment.clear();
matrix_7segment.print(temp, DEC);
matrix_7segment.writeDisplay();
8x8 LED matrix
1. The Adafruit 8x8 matrix is used to display the mood of the current weather
condiion using a smiley. (The setup tutorial can be found at https://learn.
adafruit.com/adafruit-led-backpack/0-8-8x8-matrix ).
2. If the current weather condiion is fair, a smile is displayed and a frown is displayed
for impending danger.
3. The write process is similar to the 7-Segment display. The 7-Segment display and the
8x8 display matrix use the MAX7219 chip. Hence, it is necessary to use a different
address for the LED matrix. The Adafruit tutorial ( https://learn.adafruit.com/
adafruit-led-backpack/connecting-multiple-backpacks ) clearly explains
how to change I2C port addresses on the LED backpack. You are welcome to switch
the address if both the 7-Segment display and the LED matrix are being used in
the project.
4. It is also possible to write strings to the 8x8 matrix and scroll like a marquee.
Similar to the 7-Segment display, we will iniialize the object to communicate
with the LED matrix:
Adafruit_8x8matrix matrix = Adafruit_8x8matrix();
We initialize the I2C port address of the device in the Arduino
setup() function:
matrix_7segment.begin(0x73);
Adafruit tutorials also explain the creation of bitmaps for the smileys to
be displayed:
static uint8_t __attribute__ ((progmem)) smile_bmp[]={0x3C,
0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};
static uint8_t __attribute__ ((progmem)) frown_bmp[]={0x3C,
0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};
 
Search WWH ::




Custom Search