Modifications

Sauter à la navigation Sauter à la recherche
2 763 octets ajoutés ,  6 février 2013 à 12:05
aucun résumé de modification
Ligne 2 : Ligne 2 :     
{{traduction}}
 
{{traduction}}
 +
 +
The HT16K33 driver chip on these LED backpacks has a default I2C address of '''0x70'''. Since each device on an I2C bus must have a unique address, its important to avoid collisions or you'll get a lot of strange responses from your electronic devices!
 +
 +
Luckily, the HT16K33 has 2 or 3 address adjust pins, so that the address can be changed! The mini 20mm 8x8 matrix backpack has 2 address adjust pins. The 30mm 8x8, bi-color 8x8 and 4 x 7-segment backpacks have 3 address adjust pins.
 +
 +
That means that you can set the backpacks to these addresses:
 +
 +
* Mini 8x8 20mm: 0x70, 0x71, 0x72, 0x73
 +
* Small 8x8 30mm: 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77
 +
* 4 x 7-segments: 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77
 +
* Bi-color 8x8 30mm: 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77
 +
 +
You can mix-and-match matrices, as long as each one has a unique address!
 +
 +
== Changing Addresses ==
 +
You can change the address of a backpack very easily. Look on the back to find the two or three A0, A1 or A2 solder jumpers. Each one of these is used to hardcode in the address. If a jumper is shorted with solder, that sets the address. '''A0''' sets the lowest bit with a value of '''1''', '''A1''' sets the middle bit with a value of '''2''' and '''A2''' sets the high bit with a value of '''4'''.
 +
 +
The final address is '''0x70 + A2 + A1 + A0'''.
 +
 +
Donc, par exemple:
 +
* if '''A2''' is shorted and '''A0''' is shorted, the address is '''0x70 + 4 + 1 = 0x75'''.
 +
* If only '''A1''' is shorted, the address is '''0x70 + 2 = 0x72'''
 +
 +
{{ambox | text = '''A2''' does not appear on the mini 20mm 8x8 matrix, so you cannot set the address higher than '''0x73''' }}
 +
 +
{{Ambox
 +
| type      = delete
 +
| image      = [[File:StopHand.png|40px|alt=Stop]]
 +
| textstyle  = color: red; font-weight: bold; font-style: italic;
 +
| text      = Sur le backpack de la matrice 8x8 30mm, les libellés A1 et A2 on malheureusement été inversés!
 +
}}
 +
 +
[[Fichier:ADF-LED-BACKPACK-ARD-01.jpg]]
 +
 +
[[Fichier:ADF-LED-BACKPACK-ARD-02.jpg]]
 +
 +
<nowiki>Adafruit_7segment matrix = Adafruit_7segment();
 +
   
 +
    void setup() {
 +
    Serial.begin(9600);
 +
    Serial.println("7 Segment Backpack Test");
 +
   
 +
    matrix.begin(0x70);
 +
    }</nowiki>
 +
 +
And change it to this:
 +
 +
<nowiki>Adafruit_7segment matrix1 = Adafruit_7segment();
 +
Adafruit_7segment matrix2 = Adafruit_7segment();
 +
 +
void setup() {
 +
Serial.begin(9600);
 +
Serial.println("Double 7 Segment Backpack Test");
 +
 +
matrix1.begin(0x70);
 +
matrix2.begin(0x71);
 +
}</nowiki>
 +
 +
That is, instantiate two matrix objects. Then one is called with '''begin(0x70)''' and the other is called with '''begin(0x71)'''. Each one can be used individually. If you need more matrices, just instantiate more objects at the top and '''begin()''' each one with the unique i2c address.
    
{{ADF-LED-BACKPACK-TRAILER}}
 
{{ADF-LED-BACKPACK-TRAILER}}
29 917

modifications

Menu de navigation