samedi 13 juillet 2013

Cube a leds 4x4

Un petit cube animé 4x4 leds

Dans ce montage, j’utilise un Arduino Nano monté sur un support de circuit intégré 30 broches.

Il s'agit là d'un montage des plus simple qu'on puisse trouver, je n'utilise pas de registre a décalage et pas de générateur de courant constant. J'utilise simplement 16 résistances, inconvénient est que la luminosité des leds baisse légèrement lorsque plusieurs leds sont allumées en même temps (cela ne se voit presque pas vous pourrez en juger sur la vidéo. Si vous souhaitez malgré tout avoir une intensité lumineuse constante, il faudra mettre une résistance par leds soit 64 résistances.

Matériel

1 Carte Arduino NANO ici http://cgi.ebay.fr/Arduino-Nano
64 leds au choix a voir ici  http://stores.ebay.fr/LED-Megashop
16 Résistances 100 ohms valeur a définir selon les leds exemple :
Leds 3.2V/ 20mA   R= (5-3.2)/0.02 soit 90 ohms (valeur standard 91 ohms)

Attention de ne pas prendre des leds de plus de 20mA sinon il faudra piloter celles-ci avec un transistor

Les liens que je met ne sont que des exemples et font parti des sites que j'ai trouvé les moins chers

Le typon


L'implantation

Je pense que vu la simplicité il n'est pas vraiment nécessaire de faire un schéma, le circuit imprimé est tellement simple qu'il est facilement réalisable sur un plaque d'essai a pastilles. Le typon a été dessine de elle manière a ce que chaque colonnes soit soudée directement sur la plaque.
La polarité est:
Colonnes = Anodes (+)
Les lignes = Cathode (-)


Le sketch


/***************** cube a leds  ********************
*****************By Jojo Bricolo********************
************www.mon-arduino.blogspot.fr*************
*************13/07/2013*****************************/


#include <avr/pgmspace.h>

#define CUBESIZE 4
#define PLANESIZE CUBESIZE*CUBESIZE
#define PLANETIME 3333 // vitesse affichage -> 100 Hz
#define TIMECONST 20

// Tableau de programmation de l'affichage
prog_uchar PROGMEM PatternTable[] = {

// la valeur 10 a la fin correspond a la durée d'affichage de chaque ligne soit 10ms

B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0011,B0000,B0000,B0000,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0011,B0010,B0000,B0000,B0011,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0011,B0011,B0000,B0000,B0011,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0011,B0011,B0000,B0000,B0011,B0011,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0001,B0011,B0111,B0000,B0001,B0011,B0111,B0000,B0000,B0001,B0011,10,
B0000,B0000,B0000,B0000,B0000,B0011,B0111,B0111,B0000,B0011,B0111,B0111,B0000,B0001,B0011,B0111,10,
B0000,B0000,B0000,B0000,B0000,B0111,B0111,B0111,B0000,B0111,B0111,B0111,B0000,B0011,B0111,B0111,10,
B0000,B0000,B0000,B0000,B0000,B0111,B0111,B0111,B0000,B0111,B0111,B0111,B0000,B0111,B0111,B0111,10,
B0000,B0000,B0000,B0000,B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,10,
B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,B0000,B0000,B0000,B0000,10,
B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,B0000,B1100,B1110,B1110,B0000,B0000,B0000,B0000,10,
B0000,B1110,B1110,B1110,B0000,B1100,B1110,B1110,B0000,B1000,B1100,B1110,B0000,B0000,B0000,B0000,10,
B0000,B1100,B1110,B1110,B0000,B1000,B1100,B1110,B0000,B0000,B1000,B1100,B0000,B0000,B0000,B0000,10,
B0000,B1000,B1100,B1110,B0000,B0000,B1000,B1100,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B1000,B1100,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1110,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1110,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0110,B0000,B0000,B0000,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0010,B0000,B0000,B0000,B0011,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0011,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0001,B0001,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1110,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1100,B0000,B0000,B1000,B1000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B0000,B0000,B1100,B1000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1110,B1000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0111,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0001,B0011,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0001,B0001,B0000,B0001,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0001,B0000,B0000,B0011,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0111,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1110,B1000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1100,B1100,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B1110,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0111,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0011,B0000,B0000,10,
B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,10,
B0001,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0011,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0111,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B0111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0111,B0111,B0111,B0111,B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0011,B0011,B0011,B0011,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,10,
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,10,
B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,10,
B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,10,
B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
B0010,B0001,B0001,B0001,B0010,B0001,B0001,B0001,B0010,B0001,B0001,B0001,B0010,B0001,B0001,B0001,10,
B0100,B0010,B0001,B0001,B0100,B0010,B0001,B0001,B0100,B0010,B0001,B0001,B0100,B0010,B0001,B0001,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0000,B0010,B0100,B0000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0000,B0000,B0000,B0000,B0000,B0010,B0100,B0000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0010,B0100,B0000,B0001,B0010,B0100,B1000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0010,B0100,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B0000,B0010,B0000,B1000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B0000,B0010,B0000,B1000,B0000,B0010,B1000,B0000,10,
B0000,B0000,B0000,B1000,B0000,B0010,B0000,B1000,B0000,B0010,B1000,B0000,B0000,B0000,B1000,B0000,10,
B0000,B0010,B0000,B1000,B0000,B0010,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0010,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0100,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0110,B0110,B0000,B0000,B0100,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1001,B0110,B0110,B1001,B0000,B0110,B0110,B0000,B0000,B0100,B0010,B0000,B0000,B0000,B0000,B0000,10,
B1101,B0111,B1110,B1011,B1001,B0110,B0110,B1001,B0000,B0110,B0110,B0000,B0000,B0100,B0010,B0000,10,
B1111,B1111,B1111,B1111,B1101,B0111,B1110,B1011,B1001,B0110,B0110,B1001,B0000,B0110,B0110,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1101,B0111,B1110,B1011,B1001,B0110,B0110,B1001,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1101,B0111,B1110,B1011,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,

// elements de base, ne pas toucher!!!!
B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 0
};

//définition des broches de sortie

int ColPin[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; // colonnes anodes
int LignePin[] = {16, 17, 18, 19}; // lignes cathode

void setup()
{
int pin;

for (pin=0; pin<PLANESIZE; pin++) {
pinMode( ColPin[pin], OUTPUT );
}

for (pin=0; pin<CUBESIZE; pin++) {
pinMode( LignePin[pin], OUTPUT );
}
}

void loop()
{
// declare variables
byte PatternBuf[PLANESIZE];
int PatternIdx;
byte AffichageTime;
unsigned long TimeFin;
int Lignes;
int patbufidx;
int ledlig;
int ledcol;
int ledpin;


PatternIdx = 0;

do {

memcpy_P( PatternBuf, PatternTable+PatternIdx, PLANESIZE );
PatternIdx += PLANESIZE;

AffichageTime = pgm_read_byte_near( PatternTable + PatternIdx++ );

TimeFin = millis() + ((unsigned long) AffichageTime) * TIMECONST;


while ( millis() < TimeFin ) {
patbufidx = 0;

for (Lignes=0; Lignes<CUBESIZE; Lignes++) {

if (Lignes==0) {
digitalWrite( LignePin[CUBESIZE-1], HIGH );
} else {
digitalWrite( LignePin[Lignes-1], HIGH );
}


ledpin = 0;
for (ledlig=0; ledlig<CUBESIZE; ledlig++) {
for (ledcol=0; ledcol<CUBESIZE; ledcol++) {
digitalWrite( ColPin[ledpin++], PatternBuf[patbufidx] & (1 << ledcol) );
}
patbufidx++;
}


digitalWrite( LignePin[Lignes], LOW );

delayMicroseconds( PLANETIME );
}
}
} while (AffichageTime > 0);
}



Le tableau de données est configuré de la manière suivante:

B  0    0   0    0
=
B Ligne1, Ligne2, Ligne 3, Ligne4

et

B0000,      B0000,      B0000,       B0000,    .................B0000,
=
colonne1   colonne2   colonne3   colonne4..................colonne16


La réalisation

Le circuit





Montage des leds


1° Préparer un panneau bois ou autre avec les trous du diamètre des leds, ici j'ai utilisé des 3mm mais rien n'empêche de prendre des 5mm.

Les leds doivent être des diffusantes et non des haute luminosité sinon celle-ci risquent d'éclairer les leds éteintes.






2° Pliage des leds




3° Mise en place






4° 1 étage terminé




A faire 4 fois. J'ai également mis un fil de renfort qu'on voit a droite sur la photo.

5° Le montage terminé


Je ne me suis pas foulé pour les leds, c'était du vite fait pour le blog.
Remarquez les fils alimentant les lignes.

6° En vidéo





L' animation sur la vidéo n'est qu'un exemple, a vous de le modifier selon vos gouts.


Nouveau Sketch un peu plus complet

/***************** cube a leds  ********************
*****************By Jojo Bricolo********************
************www.mon-arduino.blogspot.fr*************
*************19/07/2013*****************************/


#include <avr/pgmspace.h>

#define CUBESIZE 4
#define PLANESIZE CUBESIZE*CUBESIZE
#define PLANETIME 100
#define TIMECONST 10


prog_uchar PROGMEM PatternTable[] = {


//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16

B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,5,
B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,5,
B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,5,
B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,5,
B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,10,
B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0000,5,
B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,5,
B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,5,
B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,10,
//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16
B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,5,
B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,5,
B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,5,
B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,5,
B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,10,
B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0000,5,
B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,5,
B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,5,
B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,10,
//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16    
B0000,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,10,
//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16
B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,20,
B0000,B0000,B0000,B0000,B0011,B0000,B0000,B0000,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,20,
B0000,B0000,B0000,B0000,B0011,B0010,B0000,B0000,B0011,B0010,B0000,B0000,B0000,B0000,B0000,B0000,20,
B0000,B0000,B0000,B0000,B0011,B0011,B0000,B0000,B0011,B0011,B0000,B0000,B0000,B0000,B0000,B0000,20,
B0011,B0011,B0000,B0000,B0011,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,20,
B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,20,
B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,20,
B0000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0011,B0011,B0000,B0000,B0011,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0001,B0011,B0111,B0000,B0001,B0011,B0111,B0000,B0000,B0001,B0011,B0000,B0000,B0000,B0000,10,
B0000,B0011,B0111,B0111,B0000,B0011,B0011,B0111,B0000,B0001,B0011,B0111,B0000,B0000,B0000,B0000,10,
B0000,B0111,B0111,B0111,B0000,B0111,B0111,B0111,B0000,B0011,B0111,B0111,B0000,B0000,B0000,B0000,10,
B0000,B0111,B0111,B0111,B0000,B0111,B0111,B0111,B0000,B0111,B0111,B0111,B0000,B0000,B0000,B0000,20,
B0000,B0000,B0000,B0000,B0000,B0111,B0111,B0111,B0000,B0111,B0111,B0111,B0000,B0111,B0111,B0111,10,
B0000,B0000,B0000,B0000,B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,10,
B0000,B0000,B0000,B0000,B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,B0000,B1100,B1110,B1110,10,
B0000,B0000,B0000,B0000,B0000,B1100,B1110,B1110,B0000,B1100,B1100,B1110,B0000,B1000,B1100,B1110,10,
B0000,B0000,B0000,B0000,B0000,B1000,B1100,B1110,B0000,B1000,B1100,B1110,B0000,B0000,B1000,B1100,10,
B0000,B0000,B0000,B0000,B0000,B0000,B1100,B1100,B0000,B0000,B1100,B1100,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1100,B1100,B0000,B0000,B1100,B1100,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B1100,B0000,B0000,B1100,B1100,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B0000,B0000,B1000,B1100,10,
//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1100,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1110,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0111,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0011,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0011,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0010,B0011,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0010,B0010,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0110,B0010,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0110,B0100,B0100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0100,B0100,B1100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B1000,B0000,B0000,B0100,B1100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B1000,B1000,B0000,B0000,B0000,B1100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B1000,B1000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1100,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1100,B1100,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1100,B1100,B1100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1100,B1100,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1100,B1110,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1110,B1110,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1110,B1110,B1110,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1110,B1110,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1110,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0111,B0111,B0111,B0111,B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0011,B0011,B0011,B0011,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,10,
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,10,
B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,10,
//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16
B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,10,
B0010,B0010,B0010,B0010,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
B1000,B1000,B1000,B1000,B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0001,B0001,B0001,B0001,10,
B0000,B0000,B0000,B0000,B1000,B1000,B1000,B1000,B0100,B0100,B0100,B0010,B0011,B0011,B0011,B0011,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B1000,B1000,B0100,B0111,B0111,B0111,B0111,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,B1111,B1111,10,
B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,B1111,10,
B1111,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,10,
B0000,B1111,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B1111,10,
B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B1111,10,
B0000,B0000,B0000,B1111,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B1111,B0000,B0000,B1111,B0000,10,
B0000,B0000,B0000,B1111,B0000,B0000,B0000,B1111,B0000,B0000,B1111,B0000,B0000,B1111,B0000,B0000,10,
B0000,B0000,B0000,B1111,B0000,B0000,B1111,B0000,B0000,B1111,B0000,B0000,B1111,B0000,B0000,B0000,10,
B0000,B0000,B1111,B1111,B0000,B1111,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
                                                                                                  
B0111,B0111,B0111,B0111,B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0011,B0011,B0011,B0011,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,10,
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,10,
B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,10,
//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16
B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,10,
B0010,B0010,B0010,B0010,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
B1000,B1000,B1000,B1000,B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0001,B0001,B0001,B0001,10,
B0000,B0000,B0000,B0000,B1000,B1000,B1000,B1000,B0100,B0100,B0100,B0010,B0011,B0011,B0011,B0011,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B1000,B1000,B0100,B0111,B0111,B0111,B0111,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,B1111,B1111,10,
B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,B1111,10,
B1111,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,10,
B0000,B1111,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B1111,10,
B0000,B0000,B0000,B1111,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B1111,10,
B0000,B0000,B0001,B1110,B0000,B0000,B0001,B1110,B0000,B0000,B0001,B1110,B0000,B0000,B0001,B1110,10,
B0000,B0001,B0010,B1100,B0000,B0001,B0010,B1100,B0000,B0001,B0010,B1100,B0000,B0001,B0010,B1100,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16
B0001,B0001,B0010,B0100,B0001,B0001,B0010,B0100,B0001,B0001,B0010,B0100,B0001,B0001,B0010,B0100,10,
B0001,B0001,B0001,B0010,B0001,B0001,B0001,B0010,B0001,B0001,B0001,B0010,B0001,B0001,B0001,B0010,10,
B0010,B0010,B0010,B0010,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
B1000,B1000,B1000,B1000,B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0001,B0001,B0001,B0001,10,
B0000,B0000,B0000,B0000,B1100,B1100,B1100,B1100,B0011,B0011,B0011,B0011,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0011,B0011,B0011,B0011,B1100,B1100,B1100,B1100,B0000,B0000,B0000,B0000,10,
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,10,
B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
B0000,B0000,B0000,B0000,B1100,B1100,B1100,B1100,B0011,B0011,B0011,B0011,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0011,B0011,B0011,B0011,B1100,B1100,B1100,B1100,B0000,B0000,B0000,B0000,10,
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,10,
B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
B0000,B0000,B0000,B0000,B1100,B1100,B1100,B1100,B0011,B0011,B0011,B0011,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0011,B0011,B0011,B0011,B1100,B1100,B1100,B1100,B0000,B0000,B0000,B0000,10,
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,10,
B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
B0000,B0000,B0000,B0000,B1100,B1100,B1100,B1100,B0011,B0011,B0011,B0011,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0011,B0011,B0011,B0011,B1100,B1100,B1100,B1100,B0000,B0000,B0000,B0000,10,
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,10,
B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
B0000,B0000,B0000,B0000,B1100,B1100,B1100,B1100,B0011,B0011,B0011,B0011,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0011,B0011,B0011,B0011,B1100,B1100,B1100,B1100,B0000,B0000,B0000,B0000,10,
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,10,
B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
B0000,B0000,B0000,B0000,B1100,B1100,B1100,B1100,B0011,B0011,B0011,B0011,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0011,B0011,B0011,B0011,B1100,B1100,B1100,B1100,B0000,B0000,B0000,B0000,10,
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,10,
B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
B0000,B0000,B0000,B0000,B1100,B1100,B1100,B1100,B0011,B0011,B0011,B0011,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0011,B0011,B0011,B0011,B1100,B1100,B1100,B1100,B0000,B0000,B0000,B0000,10,
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,10,
//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
B0010,B0001,B0001,B0001,B0010,B0010,B0001,B0001,B0001,B0001,B0010,B0010,B0001,B0001,B0001,B0010,10,
B0100,B0010,B0001,B0001,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0001,B0001,B0010,B0100,10,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,10,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,10,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,10,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,10,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,10,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,10,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,10,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,10,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,10,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,10,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,10,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,10,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,10,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,10,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,10,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,10,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,10,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,10,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,10,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,10,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,10,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,10,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,10,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,10,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,10,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,10,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,10,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,10,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,10,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,10,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,10,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,10,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,10,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,10,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,10,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,10,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,5,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,5,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,5,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,5,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,5,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,5,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,5,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,5,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,5,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,5,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,5,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,5,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,5,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,5,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,5,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,5,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,5,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,5,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,5,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,5,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,5,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,5,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,5,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,5,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,5,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,5,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,5,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,5,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,5,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,5,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,10,
B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,10,
B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,10,
B0001,B0010,B0100,B1000,B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,10,
B0000,B0011,B1100,B0000,B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,10,
B0000,B1100,B0011,B0000,B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,10,
B1000,B0100,B0010,B0001,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0001,B0010,B0100,B1000,10,
B1000,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B1000,10,
B1000,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B1000,10,
B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,10,
B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,10,
B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B0000,B1000,B1000,B1000,10,
B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B0000,B1000,B1000,B1000,B0000,B0000,B1000,B1000,10,
B1000,B1000,B1000,B1000,B0000,B1000,B1000,B1000,B0000,B0000,B1000,B1000,B0000,B0000,B0000,B1000,10,
B0000,B1000,B1000,B1000,B0000,B0000,B1000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B1000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16
B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1100,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1100,B1100,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1100,B1100,B1100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1100,B1100,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1100,B1110,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1100,B1110,B1110,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1110,B1110,B1110,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1110,B1110,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1110,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0000,B0000,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0000,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0011,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B0111,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16
B1111,B1111,B1111,B1111,B1111,B1001,B1001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1001,B1001,B1001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1001,B1001,B1101,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1001,B1101,B1101,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1101,B1101,B1101,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1101,B1101,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1101,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0000,B0010,B0010,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0010,B0010,B0010,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0010,B0010,B0010,B0010,B0000,B0000,B0000,B0000,10,
//1   //2   //3   //4   //5   //6   //7   //8   //9   //10  //11  //12  //13  //14  //15  //16
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0110,B0010,B0010,B0010,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0110,B0110,B0010,B0010,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0110,B0110,B0110,B0010,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0110,B0110,B0110,B0110,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0111,B0110,B0110,B1110,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0111,B0111,B1110,B1110,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0111,B1111,B1111,B1110,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1000,B0000,B0000,B0001,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1100,B0000,B0000,B0011,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1110,B0000,B0000,B0111,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0000,B1111,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0001,B1000,B1111,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1001,B1001,B1111,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1101,B1011,B1111,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,1000,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0110,B0110,B0000,10,
B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,10,
B1111,B1111,B1111,B1111,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,10,
B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,10,
B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,4000,
// elements de base, ne pas toucher!!!!
B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 0
};

//définition des broches de sortie

int ColPin[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; // colonnes anodes
int LignePin[] = {16, 17, 18, 19}; // lignes cathode

void setup()
{
int pin;

for (pin=0; pin<PLANESIZE; pin++) {
pinMode( ColPin[pin], OUTPUT );
}

for (pin=0; pin<CUBESIZE; pin++) {
pinMode( LignePin[pin], OUTPUT );
}
}

void loop()
{
// declare variables
byte PatternBuf[PLANESIZE];
int PatternIdx;
byte AffichageTime;
unsigned long TimeFin;
int Lignes;
int patbufidx;
int ledlig;
int ledcol;
int ledpin;


PatternIdx = 0;

do {

memcpy_P( PatternBuf, PatternTable+PatternIdx, PLANESIZE );
PatternIdx += PLANESIZE;

AffichageTime = pgm_read_byte_near( PatternTable + PatternIdx++ );

TimeFin = millis() + ((unsigned long) AffichageTime) * TIMECONST;


while ( millis() < TimeFin ) {
patbufidx = 0;

for (Lignes=0; Lignes<CUBESIZE; Lignes++) {

if (Lignes==0) {
digitalWrite( LignePin[CUBESIZE-1], HIGH );
} else {
digitalWrite( LignePin[Lignes-1], HIGH );
}


ledpin = 0;
for (ledlig=0; ledlig<CUBESIZE; ledlig++) {
for (ledcol=0; ledcol<CUBESIZE; ledcol++) {
digitalWrite( ColPin[ledpin++], PatternBuf[patbufidx] & (1 << ledcol) );
}
patbufidx++;
}


digitalWrite( LignePin[Lignes], LOW );

delayMicroseconds( PLANETIME );
}
}
} while (AffichageTime > 0);
}

Si cela vous intéresse, je suis en mesure de vous faire un kit ou même vous réaliser ce montage ( concernant les leds, je ne fais que les fournir, a vous de les souder) !!!
N'hésitez pas a me contacter.

Commande Bluetooth et Android




Contrairement aux modules RF433Mhz évoqué dans un autre sujet, le module Bluetooth peut dialoguer dans les deux sens. Ici nous allons l'utiliser pour communiquer avec des appareils sous Android.
Les spécifications matérielles sont les suivantes

    Sensibilité typique-80dBm
    Jusqu'à +4 dBm puissance d'émission RF
    Portée environ 30m en champ libre et 10m dans une maison (pour ma part j'ai testé en intérieur
     et  n'ai a part un ralentissement pas eu de soucis dans ma maison de 3 étages)
    Antenne PCB intégrée.

Il s'agit d'un appareil à 3,3 volts  que je fais fonctionner en 5V!!!!!

Je vais tenter de vous proposer un code simple que vous pourrez aisément adapter a vos applications.

Ce montage vas vous permettre dans un premier temps  de contrôler des sortie d'une carte Arduino avec un téléphone mobile ou une tablette sous Android qui dispose d'une connectivité Bluetooth. Et de pouvoir lire l'état de ces sortie sur l'écran de l'appareil utilisé.
Pour cela j'utilise une application de terminal sur le périphérique Android, dans cet  exemple il s'agit de "BlueTerm" qui peut être téléchargé à partir de Google Play



1 Téléphone sous Android
1 Carte Arduino Unoa trouver ici  http://cgi.ebay.fr/Official-Arduino-UNO-Rev3
1 Carte Bluetooth a trouver ici  http://www.ebay.fr/itm/Arduino-Wireless-Bluetooth
 Les liens que je met ne sont que des exemples et font parti des sites que j'ai trouvé les moins chers


Le module Bluetooth






Câblage du module bluetooth






RX se câble sur TX (borne 0) de l'arduino et TX sur RX de l' arduino (borne 1)




Le câblage

Encore une fois, c'est très simple.





Lors de la programmation de l' Arduino, il faudra veiller a débrancher les connexions RX et TX sinon il y a conflit entre la communication USB et Bluetooth ce qui génère un plantage du logiciel Arduino.

Le Sketch:

ICI



Une petite vidéo de démonstration.






Si cela vous intéresse, je suis en mesure de vous faire un kit ou même vous réaliser ce montage !!!
N'hésitez pas a me contacter.

mercredi 10 juillet 2013

Telecommande radio 433Mhz


Je cherchais un moyen de communiquer sans fil entre deux cartes Arduino. Je n'avais besoin que d'un sens de communication car j'envoie des mesures vers un module maitre.
Cette solution a quelques contraintes par rapport au Xbee mais est nettement moins cher.


Quelques inconvénients


1) Dialogue a sens unique
2) pas de possibilité de programmer des ES sur le module (les Xbee possèdent quelques entrées sorties ce qui les rends plus autonomes)
3) Bruit de fond possible ce qui  peut générer des erreurs de codes (cela ne m'est jamais arrivé)
4) consommation importante de l'émetteur 20 a 30mA ce qui peut être gênant pour un fonctionnement sur piles ou accus.

    Bande passante plafonne à 2400 bps pour des petites applications. La portée peut aller jusqu’à 150m suivant la tension d'alimentation de l'émetteur qui peut aller de 3 a 12Volts


L'émetteur






Matériel

1 ATMEGA 328 a trouver ici  http://www.ebay.fr/itm/ATMEGA328P-PU-ARDUINO
1 Module émetteur et récépteur  a trouver ici  http://www.ebay.fr/itm/433Mhz-RF-transmitter-and-receiver

Le schéma 

Je ne suis pas parti d'un module arduino tout fait, j'ai utilisé et programmé un ATM 328 que j'ai acheté avec le bootoader arduino. Je vous montrerai comment faire cette programmation dans une autre page.

Le schéma avec une carte Uno





Le code émetteur


//Emetteur de telecommande
// By Jojo Bricolo
//  mon-arduino.blogspot.com
// 09/07/2013


#include <VirtualWire.h>

void setup()
{
    Serial.begin(9600);   
  

  
    vw_set_ptt_inverted(true);
    vw_setup(2000);   
        vw_set_tx_pin(12);
       
        pinMode(2, INPUT);
        pinMode(3, INPUT);
        pinMode(4, INPUT);
        pinMode(5, INPUT);
        pinMode(6, INPUT);
        pinMode(7, INPUT);
        pinMode(8, INPUT);
        pinMode(9, INPUT);
        pinMode(10, INPUT);
         pinMode(11, INPUT);
       
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
digitalWrite(11, HIGH);

}

void loop()
{
  char *msg;
 
  if(digitalRead(2) == LOW){
    char *msg = "1";
      digitalWrite(13, true);
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx();
    digitalWrite(13, false);
  }
   
  if(digitalRead(3) == LOW)
  {
    char *msg = "2";
      digitalWrite(13, true);
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx();
    digitalWrite(13, false);
  }
 
  if(digitalRead(4) == LOW)
  {
    char *msg = "3";
      digitalWrite(13, true);
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx();
    digitalWrite(13, false);
  }
 
  if(digitalRead(5) == LOW)
  {
    char *msg = "4";
      digitalWrite(13, true);
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx();
    digitalWrite(13, false);
  }
 
 
  if(digitalRead(6) == LOW)
  {
    char *msg = "5";
      digitalWrite(13, true);
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx();
    digitalWrite(13, false);
  }
 
  if(digitalRead(7) == LOW)
  {
    char *msg = "6";
      digitalWrite(13, true);
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx();
    digitalWrite(13, false);
  }
 
  if(digitalRead(8) == LOW)
  {
    char *msg = "7";
      digitalWrite(13, true);
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx();
    digitalWrite(13, false);
  }
 
 
  if(digitalRead(9) == LOW)
  {
    char *msg = "8";
      digitalWrite(13, true);
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx();
    digitalWrite(13, false);
  }
  if(digitalRead(10) == LOW)
  {
    char *msg = "9";
      digitalWrite(13, true);
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx();
    digitalWrite(13, false);
  }
 
 if(digitalRead(11) == LOW)
  {
    char *msg = "10";
      digitalWrite(13, true);
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx();
    digitalWrite(13, false);
  }
 
  }


La librairie virtualWire est a télécharger
https://github.com/m0/Updated-Arduino-VirtualWire-Library

Sur la page a droite il y a un bouton Download zip, celui-ci vous permet de télécharger le dossier complet.
Cette librairie servira également au récepteur.

 Le typon






L'implantation

J'ai utilisé des résistances et des condensateurs CMS 1206 pour gagner de la place

L’émetteur




Le module comporte 4 broches :
+ 5V, GND  et 2 data (qui sont en parallèle.).

Le schéma


Le code

        ---------------------------------------------------------------------------------------
//Recepteur de telecommande
// By Jojo Bricolo
//  mon-arduino.blogspot.com
// 09/07/2013

#include <VirtualWire.h>

void setup()
{
    Serial.begin(9600);  
 

 
    vw_set_ptt_inverted(true);
    vw_setup(2000);    
    vw_set_rx_pin(12);
    vw_rx_start();     

pinMode(2, OUTPUT);
digitalWrite (2,LOW);
pinMode(3, OUTPUT);
digitalWrite (3,LOW);
pinMode(4, OUTPUT);
digitalWrite (4,LOW);
pinMode(5, OUTPUT);
digitalWrite (5,LOW);
pinMode(6, OUTPUT);
digitalWrite (6,LOW);
pinMode(7, OUTPUT);
digitalWrite (7,LOW);
pinMode(8, OUTPUT);
digitalWrite (8,LOW);
pinMode(9, OUTPUT);
digitalWrite (9,LOW);
pinMode(10, OUTPUT);
digitalWrite (10,LOW);
pinMode(11, OUTPUT);
digitalWrite (11,LOW);

}

void loop()
{
 
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen))
    {
    int i;

        digitalWrite(13, true);
  
    for (i = 0; i < buflen; i++)
    {
        if(buf[i] == '1')
      {
        digitalWrite(2, HIGH);
        delay(10);
    }
else
{}
        if(buf[i] == '2')
      {
      digitalWrite(3, HIGH);
delay(10);
    }
else
{}         if(buf[i] == '3')
      {
      digitalWrite(4, HIGH);
     delay(10);
    }
    else
    {}         if(buf[i] == '4')
      {
      digitalWrite(5, HIGH);
   delay(10);
    }
   else
    {}       if(buf[i] == '5')
      {
      digitalWrite(6, HIGH);
   delay(10);
    }
   else
   {}       if(buf[i] == '6')
      {
      digitalWrite(7, HIGH);
delay(10);
    }
else
{}     if(buf[i] == '7')
      {
      digitalWrite(8, HIGH);
delay(10);
    }
     else
     {}       if(buf[i] == '8')
      {
      digitalWrite(9, HIGH);
    delay(10);
    }
    else
     {}      if(buf[i] == '9')
      {
      digitalWrite(10, HIGH);
     delay(10);
    }
      else
     {}      if(buf[i] == '10')
      {
      digitalWrite(11, HIGH);
     delay(10);
    }
    else
   {}     }
        digitalWrite(13, false);
   }
}

         ---------------------------------------------------------------------------------


Le typon




L'implantation




* Dans ces sketch, les sorties sont actives durant 10 millisecondes
pour avoir des sorties fixes, il faut supprimer toutes les lignes
delay(10);  dans le code récepteur.
Une fois sélectionnées, les sorties resteront actives, il faudra donc affecter des boutons et rajouter des lignes d’extinction.
La sortie 13 permet de mettre une leds qui clignote lors de l'émission du signal

Il ne faut pas oublier de mettre une antenne sur les bornes prévues a cet effet. Celle-ci peut être un simple bout de fil d'environ 25cm.


J'ai testé le code a environ 50m et ça fonctionne très bien. Il est facilement modifiable afin de rajouter des commandes.
Pour un dialogue dans les deux sens, il faut deux émetteurs et deux récepteurs mais cela coûtera encore moins cher que des Xbee a environ 30Euros pièce.