Modifications

Sauter à la navigation Sauter à la recherche
4 167 octets ajoutés ,  3 février 2013 à 20:43
aucun résumé de modification
Ligne 2 : Ligne 2 :     
{{traduction}}
 
{{traduction}}
 +
 +
== Bi-Color 8x8 Matrix ==
    
{{bloc-etroit
 
{{bloc-etroit
Ligne 10 : Ligne 12 :  
{{Ambox
 
{{Ambox
 
| type      = delete
 
| type      = delete
| image      = [[File:Attention.png|40px|alt=Stop]]
+
| image      = [[File:StopHand.png|40px|alt=Stop]]
 
| textstyle  = color: red; font-weight: bold; font-style: italic;
 
| textstyle  = color: red; font-weight: bold; font-style: italic;
 
| text      = Pay close attention to the instructions for positioning the matrix. It must be oriented correctly to work and is almost impossible to remove it once it has been soldered to the backpack!
 
| text      = Pay close attention to the instructions for positioning the matrix. It must be oriented correctly to work and is almost impossible to remove it once it has been soldered to the backpack!
 
}}
 
}}
 +
 +
{{asm-begin}}
 +
 +
{{asm-row|img=ADF-LED-BACKPACK-MATRICE-BI-02.jpg}}
 +
{{asm-text}}  When you buy a pack from Adafruit, it comes with the fully tested and assembled backpack as well as a 8x8 matrix. You'll need to solder the matrix onto the backpack but its an easy task.
 +
 +
 +
{{asm-row|img=ADF-LED-BACKPACK-MATRICE-BI-03.jpg}}
 +
{{asm-text}} Remove the parts from packaging and place the LED matrix OVER the silkscreen side.
 +
 +
'''The matrix must be soldered on the correct orientation or it will not work! Check for the side of the matrix that has printing on it. Then look for the front of the PCB that has a circle instead of a square in the corner and line those up as shown on the left'''
 +
 +
Do not solder the matrix over the chip on the back of the backpack - it will not work then!
 +
 +
{{asm-row|img=ADF-LED-BACKPACK-MATRICE-BI-04.jpg}}
 +
{{asm-text}} Turn the backpack over so its sitting flat on the matrix.
 +
 +
{{asm-row|img=ADF-LED-BACKPACK-MATRICE-BI-05.jpg}}
 +
{{asm-text}} Solder all 24 pins.
 +
 +
{{asm-row|img=ADF-LED-BACKPACK-MATRICE-BI-06.jpg}}
 +
{{asm-img|img=ADF-LED-BACKPACK-MATRICE-BI-07.jpg}}
 +
{{asm-text}} Clip the long pins
 +
 +
{{asm-row|img=ADF-LED-BACKPACK-MATRICE-BI-08.jpg}}
 +
{{asm-text}} Now you're ready to wire it up to a microcontroller. We'll assume you want to use a 4pin header. You can also of course solder wires directly. Place a 4-pin piece of header with the LONG pins down into the breadboard.
 +
 +
{{asm-row|img=ADF-LED-BACKPACK-MATRICE-BI-09.jpg}}
 +
{{asm-text}} Place the soldered backpack on top of the header.
 +
 +
{{asm-row|img=ADF-LED-BACKPACK-MATRICE-BI-10.jpg}}
 +
{{asm-text}} Solder 'em!
 +
 +
{{asm-end}}
 +
 +
== Bi-Color 8x8 LED Backpack Firmware ==
 +
 +
We wrote a basic library to help you work with the bi-color 8x8 matrix backpack. The library is written for the Arduino and will work with any Arduino as it just uses the I2C pins. The code is very portable and can be easily adapted to any I2C-capable micro.
 +
 +
Wiring to the matrix is really easy
 +
 +
* Connect '''CLK''' to the I2C clock - on Arduino UNO thats Analog #5, on the Leonardo its Digital #3, on the Mega its digital #21
 +
* Connect '''DAT''' to the I2C data - on Arduino UNO thats Analog #4, on the Leonardo its Digital #2, on the Mega its digital #20
 +
* Connect '''GND''' to common ground
 +
* Connect '''VCC+''' to power - 5V is best but 3V also seems to work for 3V microcontrollers.
 +
 +
Next, download the Adafruit LED Backpack library from github . To download click the DOWNLOADS button in the top right corner, rename the uncompressed folder '''Adafruit_LEDBackpack'''. Check that the '''Adafruit_LEDBackpack''' folder contains '''Adafruit_LEDBackpack.cpp''' and '''Adafruit_LEDBackpack.h''' Place the Adafruit_LEDBackpack library folder your ''arduinosketchfolder/'''libraries'''/'' folder. You may need to create the libraries subfolder if its your first library. You'll also need to download the Adafruit GFX library that provides the graphics drawing routines. Restart the IDE.
 +
 +
Once you've restarted you should be able to select the '''File->Examples->Adafruit_LEDBackpack->bicolor88''' example sketch. Upload it to your Arduino as usual. You should see a basic test program that goes through a bunch of different drawing routines
 +
 +
[[Fichier:ADF-LED-BACKPACK-MATRICE-BI-01.jpg]]
 +
 +
Once you're happy that the matrix works, you can write your own sketches. The 8x8 matrix supports everything the Adafruit GFX library - drawing pixels, lines, rectangles, circles, triangles, roundrects, and small bitmaps. For more details [Tutoriel Librairie Adafruit GFX check out the GFX page which will detail all of the GFX routines].
 +
 +
All the drawing routines only change the display memory kept by the Arduino. Don't forget to call '''writeDisplay()''' after drawing to 'save' the memory out to the matrix via I2C.
 +
 +
There are also a few small routines that are special to the matrix:
 +
* '''setBrightness(brightness)''' - will let you change the overall brightness of the entire display. 0 is least bright, 15 is brightest and is what is initialized by the display when you start
 +
* '''blinkRate(rate)''' - You can blink the entire display. 0 is no blinking. 1, 2 or 3 is for display blinking.
 +
    
{{ADF-LED-BACKPACK-TRAILER}}
 
{{ADF-LED-BACKPACK-TRAILER}}
29 917

modifications

Menu de navigation