Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Dernière révision Les deux révisions suivantes | ||
projets:matrice_led_24x24 [01/06/2018 17:07] Mathieu Hery |
projets:matrice_led_24x24 [03/12/2018 19:52] Mathieu Hery |
||
---|---|---|---|
Ligne 11: | Ligne 11: | ||
{{projets:ledmatrix_smiley.jpg?400}} | {{projets:ledmatrix_smiley.jpg?400}} | ||
+ | {{projets:ppm_conversion_matrix.png?400}} | ||
+ | {{projets:ppm_conversion_math.png?400}} | ||
+ | {{projets:ppm_read_order.png?400}} | ||
+ | |||
---- | ---- | ||
Ligne 19: | Ligne 23: | ||
*Dans gimp exporter le bitmap 24x24 en image ppm et choisir ASCII. | *Dans gimp exporter le bitmap 24x24 en image ppm et choisir ASCII. | ||
- | *Utiliser ce [[https://github.com/8mh8/ppmconverter|script python]] ci-dessous pour convertir le fichier ppm en deux pavés à copier/coller dans arduino | + | *Utiliser ce [[https://github.com/8mh8/ppmconverter|programme python]] pour convertir le fichier ppm en deux pavés à copier/coller dans arduino |
+ | |||
+ | ==== Code Arduino ==== | ||
+ | |||
+ | ++++ Déclaration de la matrice | | ||
+ | <code c> | ||
+ | #include <Adafruit_GFX.h> | ||
+ | #include <Adafruit_NeoMatrix.h> | ||
+ | #include <Adafruit_NeoPixel.h> | ||
+ | |||
+ | #define PIN 9 | ||
+ | |||
+ | // MATRIX DECLARATION: | ||
+ | // See Adafruit NeoMatrix example > tiletest for more info | ||
+ | Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(8, 8, 3, 3, PIN, | ||
+ | NEO_TILE_BOTTOM + NEO_TILE_RIGHT + NEO_TILE_ROWS + NEO_TILE_PROGRESSIVE + | ||
+ | NEO_MATRIX_BOTTOM + NEO_MATRIX_RIGHT + NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE, | ||
+ | NEO_GRB + NEO_KHZ800); | ||
+ | |||
+ | void setup() { | ||
+ | matrix.setBrightness(15); | ||
+ | matrix.begin(); | ||
+ | } | ||
+ | </code> | ||
+ | ++++ | ||
+ | |||
+ | |||
+ | ++++ Gamma Correction (pour des couleurs plus réalistes !)| | ||
+ | <code c> | ||
+ | // Gamma correction | ||
+ | const uint8_t PROGMEM gamma8[] = { | ||
+ | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
+ | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, | ||
+ | 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, | ||
+ | 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, | ||
+ | 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, | ||
+ | 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, | ||
+ | 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24, 24, 25, | ||
+ | 25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36, | ||
+ | 37, 38, 39, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50, | ||
+ | 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, | ||
+ | 69, 70, 72, 73, 74, 75, 77, 78, 79, 81, 82, 83, 85, 86, 87, 89, | ||
+ | 90, 92, 93, 95, 96, 98, 99, 101, 102, 104, 105, 107, 109, 110, 112, 114, | ||
+ | 115, 117, 119, 120, 122, 124, 126, 127, 129, 131, 133, 135, 137, 138, 140, 142, | ||
+ | 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 167, 169, 171, 173, 175, | ||
+ | 177, 180, 182, 184, 186, 189, 191, 193, 196, 198, 200, 203, 205, 208, 210, 213, | ||
+ | 215, 218, 220, 223, 225, 228, 231, 233, 236, 239, 241, 244, 247, 249, 252, 255 | ||
+ | }; | ||
+ | </code> | ||
+ | ++++ | ||
==== Bitmaps & Code Arduino ==== | ==== Bitmaps & Code Arduino ==== | ||
+ | {{projets:bulbasaur.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/bulbasaur.ppm|Bulbasaur PPM]] | ||
++++ | ++++ | ||
- | Script python | | + | Bulbasaur Arduino| |
- | <code python> | + | <code c> |
- | ''' | + | Copy/Paste this part before your setup(): |
- | mh8 - May 2018 | + | |
- | This program expects a ppm file for a 24x24 pixel image exported in ASCII format | + | // Pixels bulbasaur : |
- | and dumps array list data for writing with arduino to a 24x24 ledmatrix | + | const uint16_t PROGMEM bulbasaur0[] = {513, 514, 47, 55, 63, 96, 97, 98, 107, 108, 109, 110, 111, 115, 122, 125, 168, 169, 178, 179, 188, 196, 197, 198, 203, 206, 211, 215, 219, 220, 221, 222, 227, 234, 242, 250, 257, 260, 261, 272, 273, 275, 282, 290, 291, 292, 301, 310, 311, 319, 325, 333, 340, 341, 348, 349, 356, 363, 371, 376, 379, 387, 396, 397, 406, 414, 423, 455, 461, 462, 466, 467, 468, 474, 480, 481}; |
+ | const uint16_t PROGMEM bulbasaur1[] = {105, 112, 113, 114, 116, 117, 118, 119, 120, 121, 123, 176, 177, 187, 199, 205, 207, 212, 213, 214, 256, 258, 259, 264, 265, 266, 267, 274, 279, 294, 295, 302, 324, 328, 339, 347, 353}; | ||
+ | const uint16_t PROGMEM bulbasaur2[] = {124, 184, 185, 186, 268, 271, 276, 277, 278, 283, 284, 285, 286, 287, 293, 303, 320, 321, 322, 323, 329, 330, 331, 332, 336, 337, 338, 344, 345, 346, 352, 354, 355, 360, 361, 362, 368, 369, 370, 377, 378}; | ||
+ | const uint16_t PROGMEM bulbasaur3[] = {126, 262}; | ||
+ | const uint16_t PROGMEM bulbasaur4[] = {223, 228, 230, 231, 235, 236, 238, 239, 243, 244, 246, 247, 251, 252, 253, 255, 280, 281, 288, 289, 296, 297, 298, 300, 304, 305, 306, 308, 312, 313, 315, 317, 318, 388, 389, 390, 398, 407, 415, 448, 449, 452, 453, 454, 456, 457, 459, 460, 464, 465, 472, 473}; | ||
+ | const uint16_t PROGMEM bulbasaur5[] = {229, 237, 245, 254, 299, 307, 309, 314, 316, 391, 399, 450, 451, 458}; | ||
- | This program is beta. It is barely finished and does not have failsafes. | ||
- | It will return unexpected results if used otherwise than with a 24x24 ascii ppm files which contains exactly : | ||
- | -1732 lines | ||
- | -a 4 line header | ||
- | -values ranging between 0 and 255 | ||
- | At this stage of development the program reads a ppm files, identifies the number of colors used and converts the "ppm" index to "arduino" index : | + | Copy/Paste this part in your loop(): |
- | the ppm is read from top to bottom, left to right | + | |
- | the matrix is read from bottom right to top left, by sub-matrixs of 8x8. 9 of them in total. | + | |
- | It writes a file using the same name as the ppm file name giving two blocks that can be pasted in the arduino code to display the pixel art. | + | |
- | ''' | + | |
- | #Point to desired file here | + | // Draw bulbasaur : |
- | theFile = 'ppm/Papilusion.ppm' | + | for (int i = 0; i < 76; i++){matrix.setPixelColor(pgm_read_word_near(&bulbasaur0[i]), 255, 255, 255);} |
+ | for (int i = 0; i < 37; i++){matrix.setPixelColor(pgm_read_word_near(&bulbasaur1[i]), 0, 87, 168);} | ||
+ | for (int i = 0; i < 41; i++){matrix.setPixelColor(pgm_read_word_near(&bulbasaur2[i]), 135, 192, 234);} | ||
+ | for (int i = 0; i < 2; i++){matrix.setPixelColor(pgm_read_word_near(&bulbasaur3[i]), 255, 0, 0);} | ||
+ | for (int i = 0; i < 52; i++){matrix.setPixelColor(pgm_read_word_near(&bulbasaur4[i]), 149, 185, 11);} | ||
+ | for (int i = 0; i < 14; i++){matrix.setPixelColor(pgm_read_word_near(&bulbasaur5[i]), 0, 153, 0);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
- | #create an array to receive the lines from the file | + | </code> |
- | imageDump = [] | + | ++++ |
- | #the 'with' structure will automatically close the file when it reaches the end | + | ---- |
- | with open(theFile, 'r') as f: | + | {{projets:burger.png?200}} |
- | for line in f: | + | |
- | imageDump.append(line.rstrip('\n'))#The .rstrip() function will remove all the carriage return characters | + | |
- | #Remove the 4-line header | + | [[http://poplab.maisonpop.fr/ressources/ppm/burger.ppm|Burger PPM]] |
- | del imageDump[0:4] | + | ++++ |
+ | Burger Arduino| | ||
+ | <code c> | ||
- | #Create three arrays to receive R, G and B values | + | Copy/Paste this part before your setup(): |
- | pixelRed, pixelGreen, pixelBlue = [], [], [] | + | |
- | #Sort the image dump into the three R,G,B arrays | + | //Pixels burger2 |
- | for i, v in enumerate(imageDump): | + | const uint16_t PROGMEM burger20[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 40, 41, 42, 43, 48, 49, 50, 51, 56, 57, 58, 59, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 163, 164, 165, 166, 167, 172, 173, 174, 175, 180, 181, 182, 183, 188, 189, 190, 191, 192, 193, 194, 200, 201, 202, 203, 208, 209, 210, 216, 217, 218, 224, 225, 226, 227, 232, 233, 234, 235, 240, 241, 242, 243, 248, 249, 250, 251, 252, 325, 326, 327, 332, 333, 334, 335, 341, 342, 343, 349, 350, 351, 356, 357, 358, 359, 364, 365, 366, 367, 372, 373, 374, 375, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 392, 393, 394, 395, 396, 397, 398, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 514, 515, 516, 517, 518, 519, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575}; |
- | if i % 3 == 0: | + | const uint16_t PROGMEM burger21[] = {37, 38, 39, 44, 52, 54, 55, 60, 61, 96, 97, 98, 99, 100, 101, 102, 103, 113, 114, 115, 119, 120, 124, 125, 126, 160, 161, 162, 171, 176, 178, 179, 185, 187, 195, 204, 205, 206, 207, 211, 219, 220, 221, 222, 223, 228, 236, 244, 253, 264, 265, 266, 267, 268, 269, 270, 271, 280, 281, 282, 283, 284, 285, 286, 287, 324, 328, 329, 330, 331, 340, 344, 345, 346, 347, 348, 355, 363, 371, 378, 390, 399, 456, 457, 458, 459, 460, 461, 462, 463, 513, 520}; |
- | pixelRed.append(v) | + | const uint16_t PROGMEM burger22[] = {45, 46, 47, 53, 104, 105, 106, 107, 108, 109, 110, 111, 112, 116, 117, 118, 168, 169, 170, 177, 229, 230, 231, 237, 238, 239, 245, 246, 247, 254, 255, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 301, 302, 303, 306, 307, 308, 309, 314, 315, 316, 317, 352, 353, 354, 360, 361, 362, 368, 369, 370, 376, 377, 391, 448, 449, 450, 451, 452, 453, 454, 455, 512}; |
- | if i % 3 == 1: | + | const uint16_t PROGMEM burger23[] = {62, 63, 121, 122, 123, 127, 184, 186, 196, 197, 198, 199, 256, 257, 258, 259, 260, 261, 262, 263, 320, 321, 322, 323}; |
- | pixelGreen.append(v) | + | const uint16_t PROGMEM burger24[] = {212, 213, 214, 215, 272, 273, 274, 275, 276, 277, 278, 279, 336, 337, 338, 339}; |
- | if i % 3 == 2: | + | const uint16_t PROGMEM burger25[] = {312, 318}; |
- | pixelBlue.append(v) | + | |
- | pixels = zip(pixelRed, pixelGreen, pixelBlue) | + | |
- | #Reverse the array as the ledmatrix starts from the bottom right while the ppm starts from the top left | ||
- | pixels.reverse() | ||
- | #Identify the number of colors | + | Copy/Paste this part in your loop(): |
- | identifiedColors = [] | + | |
- | for i, v in enumerate(pixels): | + | //Draw burger2 |
- | if v == ('0', '0', '0'): | + | for (int i = 0; i < 360; i++){matrix.setPixelColor(pgm_read_word_near(&burger20[i]), 3, 1, 0);} |
- | continue #don't count black pixels | + | for (int i = 0; i < 92; i++){matrix.setPixelColor(pgm_read_word_near(&burger21[i]), 37, 36, 34);} |
- | if v in identifiedColors: | + | for (int i = 0; i < 74; i++){matrix.setPixelColor(pgm_read_word_near(&burger22[i]), 162, 100, 40);} |
- | continue #only identify colors once | + | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&burger23[i]), 71, 172, 48);} |
- | else: | + | for (int i = 0; i < 16; i++){matrix.setPixelColor(pgm_read_word_near(&burger24[i]), 131, 68, 7);} |
- | identifiedColors.append(v) | + | for (int i = 0; i < 2; i++){matrix.setPixelColor(pgm_read_word_near(&burger25[i]), 255, 255, 255);} |
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
- | #Send back some info | + | </code> |
- | print("\nReading file : " + theFile) | + | ++++ |
- | print("\nNumber of colors : " + str(len(identifiedColors))) | + | ---- |
+ | {{projets:carapuce.png?200}} | ||
- | #Create a dictionary to receive the colors and another for the index | + | [[http://poplab.maisonpop.fr/ressources/ppm/carapuce.ppm|Carapuce PPM]] |
- | colors, arduinoIndex = {}, {} | + | ++++ |
+ | Carapuce Arduino| | ||
+ | <code c> | ||
- | #Fill the color dictionary with the identified colors from above | + | Copy/Paste this part before your setup(): |
- | for a in range(len(identifiedColors)): | + | |
- | colors[a] = identifiedColors[a] | + | |
- | #This variable is used as a buffer in the mathematical equations below | + | // Pixels carapuce : |
- | y = 0 | + | const uint16_t PROGMEM carapuce0[] = {517, 524, 532, 539, 544, 545, 546, 63, 97, 98, 99, 104, 108, 112, 113, 115, 116, 117, 121, 125, 126, 127, 184, 199, 206, 214, 222, 230, 237, 238, 243, 244, 245, 247, 250, 252, 255, 257, 263, 266, 267, 268, 269, 274, 278, 286, 287, 292, 293, 299, 321, 328, 337, 338, 344, 345, 347, 354, 355, 364, 373, 376, 381, 385, 388, 393, 395, 399, 401, 407, 410, 414, 419, 420, 421, 448, 457, 458, 460, 467, 468, 477, 478, 487}; |
+ | const uint16_t PROGMEM carapuce1[] = {512, 513, 514, 515, 520, 521, 522, 523, 528, 529, 530, 531, 536, 537, 538, 105, 106, 107, 114, 122, 246, 251, 253, 254, 275, 276, 277, 282, 283, 284, 285, 290, 291, 294, 295, 300, 301, 302, 308, 309, 310, 316, 317, 318, 320, 346, 352, 353, 361, 362, 363, 369, 370, 371, 372, 377, 378, 379, 380, 386, 387, 389, 390, 391, 394, 396, 397, 398, 402, 403, 404, 405, 406, 411, 412, 413, 452, 453, 454, 455, 461, 462, 463, 469, 470, 471, 479}; | ||
+ | const uint16_t PROGMEM carapuce2[] = {123, 124, 258, 259, 260, 261, 262, 270, 271, 279, 336}; | ||
+ | const uint16_t PROGMEM carapuce3[] = {516, 207, 215, 223, 231, 239, 264, 272, 280, 288, 296, 297, 303, 304, 305, 306, 311, 312, 313, 314, 449, 450, 451, 459}; | ||
- | #Associate all colored (non-black) pixels with their colors in the index dictionary | ||
- | #The KEYS will be the index and the VALUES will be the color number as defined in the color dictionary | ||
- | for a in colors: | ||
- | for x, v in enumerate(pixels): | ||
- | if v == colors[a]: | ||
- | #Convert all the ppm index to our specific arduino index | ||
- | #These are 9 mathematical equations, one for each 8x8 sub-matrix of the 24x24 led-matrix | ||
- | if x%24 >= 0 and x%24 <= 7 and x <= 175: | ||
- | y = (x%24 + (x//24)*8) | ||
- | arduinoIndex[y] = a | ||
- | continue | ||
- | elif x%24 >= 8 and x%24 <= 15 and x <= 183: | ||
- | y = (x%24 + 56 + (x//24)*8) | ||
- | arduinoIndex[y] = a | ||
- | continue | ||
- | elif x%24 >=16 and x%24 <= 23 and x <= 191: | + | Copy/Paste this part in your loop(): |
- | y = (x%24 + 112 + (x//24)*8) | + | |
- | arduinoIndex[y] = a | + | |
- | continue | + | |
- | elif x >= 192 and x%24 >= 0 and x%24 <= 7 and x <= 367: | + | // Draw carapuce : |
- | y = (x - ((x//24) -8)*16) | + | for (int i = 0; i < 84; i++){matrix.setPixelColor(pgm_read_word_near(&carapuce0[i]), 255, 255, 255);} |
- | arduinoIndex[y] = a | + | for (int i = 0; i < 87; i++){matrix.setPixelColor(pgm_read_word_near(&carapuce1[i]), 135, 192, 234);} |
- | continue | + | for (int i = 0; i < 11; i++){matrix.setPixelColor(pgm_read_word_near(&carapuce2[i]), 238, 245, 0);} |
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&carapuce3[i]), 102, 51, 0);} | ||
+ | matrix.show(); | ||
+ | delay(10000); | ||
+ | matrix.fillScreen(0); | ||
- | elif x >= 200 and x%24 >= 8 and x%24 <= 15 and x <= 375: | + | </code> |
- | y = (x + 56 - ((x//24)-8)*16) | + | ++++ |
- | arduinoIndex[y] = a | + | ---- |
- | continue | + | |
- | elif x >= 208 and x%24 >=16 and x%24 <= 23 and x <= 383: | + | {{projets:chica.png?200}} |
- | y = (x + 112 - ((x//24)-8)*16) | + | |
- | arduinoIndex[y] = a | + | |
- | continue | + | |
- | elif x >= 384 and x%24 >= 0 and x%24 <= 7 and x <= 559: | + | [[http://poplab.maisonpop.fr/ressources/ppm/chica.ppm|Chica PPM]] |
- | y = (x - ((x//24)-16)*16) | + | ++++ |
- | arduinoIndex[y] = a | + | Chica Arduino| |
- | continue | + | <code c> |
- | elif x >= 392 and x%24 >= 8 and x%24 <= 15 and x <= 567: | + | Copy/Paste this part before your setup(): |
- | y = (x + 56 - ((x//24)-16)*16) | + | |
- | arduinoIndex[y] = a | + | |
- | continue | + | |
- | elif x >= 400 and x%24 >=16 and x%24 <= 23 and x <= 575: | + | // Pixels chica : |
- | y = (x + 112 - ((x//24) - 16)*16) | + | const uint16_t PROGMEM chica0[] = {512, 513, 2, 3, 4, 5, 6, 7, 520, 15, 30, 37, 38, 44, 45, 46, 52, 53, 54, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 79, 127, 128, 129, 130, 131, 132, 160, 168, 169, 176, 177, 178, 184, 185, 186, 187, 195, 196, 197, 198, 199, 203, 204, 211, 212, 219, 220, 227, 228, 229, 235, 236, 237, 238, 239, 244, 245, 246, 247, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 265, 266, 267, 268, 269, 273, 274, 275, 276, 277, 281, 282, 283, 284, 285, 289, 290, 291, 292, 293, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 330, 331, 338, 339, 346, 347, 353, 354, 355, 360, 361, 362, 363, 368, 369, 370, 376, 377, 378, 389, 390, 391, 398, 399, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 473, 474, 475, 476, 482, 483, 484}; |
- | arduinoIndex[y] = a | + | const uint16_t PROGMEM chica1[] = {521, 514, 528, 22, 23, 29, 36, 43, 51, 58, 72, 73, 74, 75, 76, 77, 78, 87, 144, 152, 153, 161, 162, 170, 171, 179, 188, 194, 202, 205, 206, 207, 210, 218, 226, 234, 243, 251, 264, 270, 271, 288, 294, 324, 328, 329, 332, 340, 348, 356, 364, 371, 379, 388, 397, 406, 407, 430, 438, 439, 471, 472, 477, 478, 481, 488, 489, 491, 493, 494, 496, 498, 499}; |
- | continue | + | const uint16_t PROGMEM chica2[] = {31, 39, 47, 55, 80, 81, 82, 83, 84, 85, 86, 95, 96, 97, 98, 99, 100, 101, 102, 103, 111, 119, 120, 121, 122, 123, 124, 125, 126}; |
+ | const uint16_t PROGMEM chica3[] = {88, 89, 90, 91, 92, 93, 94, 104, 105, 106, 107, 108, 109, 110, 115, 116, 117, 118}; | ||
+ | const uint16_t PROGMEM chica4[] = {112, 113, 114}; | ||
+ | const uint16_t PROGMEM chica5[] = {213, 221, 230, 231, 272, 278, 280, 286, 295, 337, 345, 352}; | ||
+ | const uint16_t PROGMEM chica6[] = {214, 222, 223, 287, 336, 344}; | ||
- | else: | ||
- | print("\Warning : an index in the ppm array was not in range (1-576).\nCheck the ppm file.") | ||
- | print("Number of pixels to draw : " + str(len(arduinoIndex))) | ||
- | #This class to dynamically create as many lists as we have colors | + | Copy/Paste this part in your loop(): |
- | class ColorArray: | + | |
- | def __init__(self, id, color, name, index = None): | + | |
- | self.id = id | + | |
- | self.color = color | + | |
- | self.name = name + str(id) | + | |
- | self.index_array = [x for x, y in index.items() if y == id] if index else [] | + | |
- | #This slice only works when pointing on my computer.. static code. | + | // Draw chica : |
- | theName = theFile[4:-4:1] | + | for (int i = 0; i < 186; i++){matrix.setPixelColor(pgm_read_word_near(&chica0[i]), 255, 204, 0);} |
- | print("Using variable name : %s\n" % theName) | + | for (int i = 0; i < 73; i++){matrix.setPixelColor(pgm_read_word_near(&chica1[i]), 230, 184, 0);} |
+ | for (int i = 0; i < 29; i++){matrix.setPixelColor(pgm_read_word_near(&chica2[i]), 224, 148, 0);} | ||
+ | for (int i = 0; i < 18; i++){matrix.setPixelColor(pgm_read_word_near(&chica3[i]), 255, 168, 0);} | ||
+ | for (int i = 0; i < 3; i++){matrix.setPixelColor(pgm_read_word_near(&chica4[i]), 251, 174, 27);} | ||
+ | for (int i = 0; i < 12; i++){matrix.setPixelColor(pgm_read_word_near(&chica5[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 6; i++){matrix.setPixelColor(pgm_read_word_near(&chica6[i]), 131, 215, 204);} | ||
+ | matrix.show(); | ||
+ | delay(10000); | ||
+ | matrix.fillScreen(0); | ||
- | #List comprehension to fill the lists with the values from arduinoIndex dictionary | + | </code> |
- | result = [ColorArray(id, color, theName, arduinoIndex) for id, color in colors.items()] | + | ++++ |
+ | ---- | ||
- | for c in result: | + | {{projets:foxy.png?200}} |
- | print("Color %s : %s - Pixels : %d" % (c.id, c.color, len(c.index_array))) | + | |
- | thePlace = "ppm/" + theName | + | [[http://poplab.maisonpop.fr/ressources/ppm/foxy.ppm|Foxy PPM]] |
+ | ++++ | ||
+ | Foxy Arduino| | ||
+ | <code c> | ||
- | with open(thePlace, 'w') as f: | + | Copy/Paste this part before your setup(): |
- | f.write("Copy/Paste this part before your setup():\n\n") | + | |
- | f.write("//Pixels %s\n" % theName) | + | |
- | for c in result: | + | |
- | f.write("const uint16_t PROGMEM %s[] = {" % c.name) | + | |
- | f.write(str(c.index_array)[1:-1]) | + | |
- | f.write("};") | + | |
- | f.write("\n") | + | |
- | f.write("\n\nCopy/Paste this part in your loop():\n\n") | + | // Pixels foxy : |
- | f.write("//Draw %s" % theName) | + | const uint16_t PROGMEM foxy0[] = {2, 3, 4, 5, 6, 7, 14, 71, 128, 129, 130, 131, 132, 136}; |
- | for c in result: | + | const uint16_t PROGMEM foxy1[] = {15, 22, 536, 537, 29, 546, 36, 43, 51, 564, 58, 573, 64, 65, 66, 67, 68, 69, 70, 78, 79, 118, 119, 125, 144, 153, 162, 171, 179, 185, 188, 194, 196, 197, 198, 199, 202, 210, 218, 220, 226, 233, 234, 241, 256, 257, 555, 260, 267, 275, 283, 289, 290, 291, 297, 301, 302, 303, 305, 307, 308, 312, 315, 322, 332, 339, 340, 347, 348, 354, 356, 360, 361, 365, 391, 398, 406, 413, 420, 427, 433, 434, 441, 450, 451, 457, 458, 465, 466, 467, 468, 469, 470, 471}; |
- | f.write("\nfor (int i = 0; i < %d; i++){matrix.setPixelColor(pgm_read_word_near(&%s[i]), %s);}" % (len(c.index_array), c.name, str(c.color).replace("\'", "").replace("(","").replace(")",""))) | + | const uint16_t PROGMEM foxy2[] = {512, 520, 521, 528, 529, 259, 23, 538, 30, 517, 547, 37, 44, 565, 566, 55, 59, 60, 62, 63, 72, 526, 87, 97, 98, 99, 100, 101, 104, 105, 106, 107, 108, 109, 110, 112, 113, 117, 120, 121, 122, 124, 152, 161, 170, 186, 187, 195, 574, 203, 211, 219, 227, 228, 229, 230, 231, 235, 236, 237, 238, 239, 242, 243, 244, 245, 246, 247, 248, 249, 250, 253, 254, 255, 258, 556, 266, 274, 281, 282, 288, 296, 304, 309, 310, 311, 316, 317, 318, 319, 355, 362, 363, 364, 61, 368, 369, 370, 371, 372, 373, 376, 377, 381, 382, 384, 385, 390, 392, 397, 399, 405, 412, 419, 426, 432, 440, 452, 453, 454, 455, 459, 460, 461, 462, 463, 518}; |
- | f.write("\nmatrix.show();") | + | const uint16_t PROGMEM foxy3[] = {38, 45, 47, 73, 74, 75, 76, 77, 80, 86, 89, 90, 91, 92, 93, 95, 96, 102, 111, 160, 169, 176, 204, 205, 212, 213, 221, 222, 223, 273, 280, 265, 54, 31}; |
+ | const uint16_t PROGMEM foxy4[] = {206, 207, 214, 264, 272}; | ||
+ | const uint16_t PROGMEM foxy5[] = {523, 524, 514, 532, 533, 540, 558, 515, 531, 534, 550, 516, 541, 542, 251, 525, 549, 378, 379, 380, 386, 387, 388, 393, 394, 395, 400, 401, 402, 408, 409, 410, 416, 417, 424}; | ||
+ | const uint16_t PROGMEM foxy6[] = {513, 522, 530, 539, 548, 252, 557, 389, 396, 403, 404, 411, 418, 425}; | ||
- | ''' | ||
- | Improvements to do : | ||
- | - Gamma correction (in arduino or in this script)! | + | Copy/Paste this part in your loop(): |
- | - Improve slicing / naming of file creations | + | |
- | - Replace loop-list creations by list comprehensions when possible | + | |
- | - Prompt user input for pointing to file | + | |
- | - Make the program graphical using an external lib ? | + | |
- | ''' | + | |
- | </code python> | + | // Draw foxy : |
+ | for (int i = 0; i < 14; i++){matrix.setPixelColor(pgm_read_word_near(&foxy0[i]), 213, 90, 0);} | ||
+ | for (int i = 0; i < 94; i++){matrix.setPixelColor(pgm_read_word_near(&foxy1[i]), 240, 102, 0);} | ||
+ | for (int i = 0; i < 127; i++){matrix.setPixelColor(pgm_read_word_near(&foxy2[i]), 255, 108, 0);} | ||
+ | for (int i = 0; i < 34; i++){matrix.setPixelColor(pgm_read_word_near(&foxy3[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 5; i++){matrix.setPixelColor(pgm_read_word_near(&foxy4[i]), 212, 171, 9);} | ||
+ | for (int i = 0; i < 35; i++){matrix.setPixelColor(pgm_read_word_near(&foxy5[i]), 255, 141, 57);} | ||
+ | for (int i = 0; i < 14; i++){matrix.setPixelColor(pgm_read_word_near(&foxy6[i]), 237, 135, 60);} | ||
+ | matrix.show(); | ||
+ | delay(10000); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
++++ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:freddy.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/freddy.ppm|Freddy PPM]] | ||
+ | ++++ | ||
+ | Freddy Arduino| | ||
+ | <code c> | ||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels freddy | ||
+ | const uint16_t PROGMEM freddy0[] = {1, 2, 3, 4, 5, 9, 10, 11, 12, 13, 129, 130, 131, 132, 133, 137, 138, 139, 140, 141}; | ||
+ | const uint16_t PROGMEM freddy1[] = {6, 7, 22, 64, 65, 66, 67, 68, 69, 70, 71, 73, 75, 77, 82, 83, 84, 87, 128, 144, 423, 473, 474, 475, 476, 477, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 496, 497, 498, 499, 500, 502, 504, 505, 506, 507, 508, 510}; | ||
+ | const uint16_t PROGMEM freddy2[] = {14, 15, 23, 30, 31, 72, 74, 76, 78, 79, 80, 81, 85, 86, 94, 95, 136, 152}; | ||
+ | const uint16_t PROGMEM freddy3[] = {36, 37, 38, 39, 43, 44, 50, 51, 57, 58, 59, 88, 89, 90, 91, 92, 93, 96, 97, 98, 99, 100, 101, 102, 103, 160, 161, 162, 170, 171, 179, 180, 187, 188, 189, 193, 194, 195, 196, 201, 202, 203, 204, 205, 210, 211, 212, 213, 214, 215, 218, 219, 220, 226, 227, 228, 234, 235, 236, 237, 242, 243, 244, 245, 246, 247, 251, 252, 253, 272, 273, 274, 275, 276, 277, 278, 279, 281, 282, 283, 284, 285, 289, 290, 291, 292, 293, 296, 297, 298, 299, 300, 301, 302, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 322, 323, 324, 325, 329, 330, 331, 332, 333, 336, 337, 338, 339, 340, 346, 347, 348, 354, 355, 356, 361, 362, 363, 364, 368, 369, 370, 371, 372, 377, 378, 379, 386, 387, 388, 389, 390, 391, 393, 394, 395, 396, 397, 398, 399, 401, 404, 405, 406, 407, 409, 410, 412, 413, 414, 415, 418, 419, 420, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 478, 479, 512, 513, 514, 515, 516, 520, 521, 522, 523, 524, 525, 528, 529, 530, 533, 536, 537, 538, 540, 541, 546, 547, 548}; | ||
+ | const uint16_t PROGMEM freddy4[] = {46, 52, 104, 106, 108, 110, 168, 178, 221, 229, 238, 239, 280, 286, 288, 294, 303, 345, 353, 360}; | ||
+ | const uint16_t PROGMEM freddy5[] = {53, 54, 55, 60, 61, 62, 63, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 176, 177, 184, 185, 186, 197, 198, 199, 206, 207, 256, 257, 258, 260, 261, 262, 263, 264, 265, 269, 270, 271, 320, 321, 328, 402, 403, 411, 531, 532, 539}; | ||
+ | const uint16_t PROGMEM freddy6[] = {222, 230, 231, 295, 344, 352}; | ||
+ | const uint16_t PROGMEM freddy7[] = {501, 509}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw freddy | ||
+ | for (int i = 0; i < 20; i++){matrix.setPixelColor(pgm_read_word_near(&freddy0[i]), 103, 64, 21);} | ||
+ | for (int i = 0; i < 53; i++){matrix.setPixelColor(pgm_read_word_near(&freddy1[i]), 110, 110, 110);} | ||
+ | for (int i = 0; i < 18; i++){matrix.setPixelColor(pgm_read_word_near(&freddy2[i]), 69, 69, 69);} | ||
+ | for (int i = 0; i < 218; i++){matrix.setPixelColor(pgm_read_word_near(&freddy3[i]), 133, 82, 27);} | ||
+ | for (int i = 0; i < 20; i++){matrix.setPixelColor(pgm_read_word_near(&freddy4[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 54; i++){matrix.setPixelColor(pgm_read_word_near(&freddy5[i]), 196, 129, 56);} | ||
+ | for (int i = 0; i < 6; i++){matrix.setPixelColor(pgm_read_word_near(&freddy6[i]), 61, 155, 178);} | ||
+ | for (int i = 0; i < 2; i++){matrix.setPixelColor(pgm_read_word_near(&freddy7[i]), 141, 143, 144);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | {{projets:lucarioriolu.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/LucarioRiolu.ppm|LucarioRiolu PPM]] | ||
+ | ++++ | ||
+ | LucarioRiolu Arduino| | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels LucarioRiolu | ||
+ | const uint16_t PROGMEM LucarioRiolu0[] = {12, 20, 21, 42, 43, 51, 62, 76, 84, 123, 124, 198, 205, 218, 219, 222, 223, 227, 228, 230, 231, 238, 239, 243, 244, 246, 274, 275, 277, 283, 284, 285, 286, 290, 291, 292, 299, 300, 306, 307, 333, 340, 341, 342, 349}; | ||
+ | const uint16_t PROGMEM LucarioRiolu1[] = {36, 39, 46, 47, 63, 89, 92, 96, 101, 104, 105, 110, 113, 115, 116, 118, 119, 125, 126, 145, 146, 153, 168, 169, 184, 185, 199, 206, 207, 214, 226, 229, 235, 236, 237, 245, 256, 257, 258, 261, 262, 263, 276, 278, 282, 293, 295, 296, 312, 314, 330, 332, 334, 339, 346, 347, 348, 352, 357, 448, 449, 451, 457, 459}; | ||
+ | const uint16_t PROGMEM LucarioRiolu2[] = {515, 29, 60, 97, 98, 106, 111, 161, 170, 264, 268, 320, 324, 331, 368, 372, 378, 379, 450, 458, 466, 467, 475}; | ||
+ | const uint16_t PROGMEM LucarioRiolu3[] = {30, 31, 37, 38, 59, 93, 94, 100, 102, 103, 108, 117, 196, 197, 215, 247, 254, 255, 265, 266, 267, 271, 272, 297, 298, 302, 303, 304, 305, 308, 310, 311, 313, 315, 318, 321, 322, 323, 353, 354, 355, 356, 360, 361, 362, 363, 364, 369, 370, 371, 391, 399, 407, 456}; | ||
+ | const uint16_t PROGMEM LucarioRiolu4[] = {50, 280, 336}; | ||
+ | const uint16_t PROGMEM LucarioRiolu5[] = {55, 112, 176, 177}; | ||
+ | const uint16_t PROGMEM LucarioRiolu6[] = {120, 121, 127}; | ||
+ | const uint16_t PROGMEM LucarioRiolu7[] = {288, 328, 338, 344}; | ||
+ | const uint16_t PROGMEM LucarioRiolu8[] = {273, 281, 329, 337}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw LucarioRiolu | ||
+ | for (int i = 0; i < 45; i++){matrix.setPixelColor(pgm_read_word_near(&LucarioRiolu0[i]), 103, 103, 103);} | ||
+ | for (int i = 0; i < 64; i++){matrix.setPixelColor(pgm_read_word_near(&LucarioRiolu1[i]), 65, 65, 65);} | ||
+ | for (int i = 0; i < 23; i++){matrix.setPixelColor(pgm_read_word_near(&LucarioRiolu2[i]), 76, 131, 174);} | ||
+ | for (int i = 0; i < 54; i++){matrix.setPixelColor(pgm_read_word_near(&LucarioRiolu3[i]), 99, 170, 224);} | ||
+ | for (int i = 0; i < 3; i++){matrix.setPixelColor(pgm_read_word_near(&LucarioRiolu4[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 4; i++){matrix.setPixelColor(pgm_read_word_near(&LucarioRiolu5[i]), 208, 200, 77);} | ||
+ | for (int i = 0; i < 3; i++){matrix.setPixelColor(pgm_read_word_near(&LucarioRiolu6[i]), 189, 182, 64);} | ||
+ | for (int i = 0; i < 4; i++){matrix.setPixelColor(pgm_read_word_near(&LucarioRiolu7[i]), 212, 212, 212);} | ||
+ | for (int i = 0; i < 4; i++){matrix.setPixelColor(pgm_read_word_near(&LucarioRiolu8[i]), 244, 110, 29);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:mangle.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/mangle.ppm|Mangle PPM]] | ||
+ | ++++ | ||
+ | Mangle Arduino| | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | // Pixels mangle : | ||
+ | const uint16_t PROGMEM mangle0[] = {3, 4, 5, 6, 7, 22, 23, 37, 38, 44, 45, 46, 47, 53, 54, 55, 57, 58, 61, 62, 64, 65, 69, 70, 71, 74, 75, 76, 80, 81, 82, 84, 85, 86, 87, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 123, 124, 125, 128, 129, 130, 131, 144, 160, 161, 168, 169, 176, 177, 184, 185, 188, 189, 193, 194, 195, 196, 197, 200, 203, 204, 211, 212, 219, 220, 227, 228, 242, 243, 244, 247, 249, 250, 253, 258, 259, 260, 264, 267, 275, 283, 285, 286, 287, 291, 294, 295, 298, 299, 300, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 321, 322, 323, 324, 325, 328, 330, 331, 334, 336, 338, 339, 344, 346, 347, 354, 355, 370, 371, 372, 373, 377, 381, 382, 384, 385, 390, 392, 398, 405, 406, 412, 419, 426, 432, 433, 440, 448, 449, 450, 451, 452, 453, 454, 456, 457, 458, 459, 460, 461, 462, 465, 466, 467, 468, 469, 475, 512, 517, 518, 520, 526, 528, 529, 538, 547, 556, 565, 566}; | ||
+ | const uint16_t PROGMEM mangle1[] = {15, 29, 36, 43, 66, 67, 68, 72, 73, 77, 78, 79, 126, 127, 153, 162, 170, 171, 202, 210, 218, 226, 234, 235, 236, 237, 241, 248, 255, 261, 268, 276, 319, 320, 329, 332, 337, 340, 348, 356, 361, 362, 363, 364, 391, 399, 407, 413, 420, 427, 434, 441, 455, 463, 464, 470, 471, 473, 474, 476, 477, 537, 546, 555, 564, 573, 574}; | ||
+ | const uint16_t PROGMEM mangle2[] = {83, 90, 91, 92}; | ||
+ | const uint16_t PROGMEM mangle3[] = {30, 31, 39, 88, 89, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 109, 110, 152, 221, 229, 230, 238, 239, 251, 252, 282, 284, 289, 290, 292, 293, 296, 297, 301, 302, 303, 345, 352, 353, 360, 378, 379, 380, 386, 387, 388, 389, 393, 394, 395, 396, 397, 400, 401, 402, 403, 404, 408, 409, 410, 411, 416, 417, 418, 424, 425, 513, 514, 515, 516, 521, 522, 523, 524, 525, 530, 531, 532, 533, 534, 539, 540, 541, 542, 548, 549, 550, 557, 558}; | ||
+ | const uint16_t PROGMEM mangle4[] = {51, 52, 60, 178, 179, 187}; | ||
+ | const uint16_t PROGMEM mangle5[] = {59, 186}; | ||
+ | const uint16_t PROGMEM mangle6[] = {262, 263, 269, 271, 277, 278, 279}; | ||
+ | const uint16_t PROGMEM mangle7[] = {245, 246, 254, 368, 369, 376}; | ||
+ | const uint16_t PROGMEM mangle8[] = {567}; | ||
+ | const uint16_t PROGMEM mangle9[] = {575}; | ||
+ | |||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | // Draw mangle : | ||
+ | for (int i = 0; i < 185; i++){matrix.setPixelColor(pgm_read_word_near(&mangle0[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 67; i++){matrix.setPixelColor(pgm_read_word_near(&mangle1[i]), 224, 224, 224);} | ||
+ | for (int i = 0; i < 4; i++){matrix.setPixelColor(pgm_read_word_near(&mangle2[i]), 255, 40, 40);} | ||
+ | for (int i = 0; i < 92; i++){matrix.setPixelColor(pgm_read_word_near(&mangle3[i]), 255, 154, 209);} | ||
+ | for (int i = 0; i < 6; i++){matrix.setPixelColor(pgm_read_word_near(&mangle4[i]), 255, 46, 46);} | ||
+ | for (int i = 0; i < 2; i++){matrix.setPixelColor(pgm_read_word_near(&mangle5[i]), 255, 126, 126);} | ||
+ | for (int i = 0; i < 7; i++){matrix.setPixelColor(pgm_read_word_near(&mangle6[i]), 215, 202, 0);} | ||
+ | for (int i = 0; i < 6; i++){matrix.setPixelColor(pgm_read_word_near(&mangle7[i]), 99, 99, 99);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&mangle8[i]), 5, 5, 5);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&mangle9[i]), 9, 9, 9);} | ||
+ | matrix.show(); | ||
+ | delay(10000); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:mew.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/mew.ppm|Mew PPM]] | ||
+ | ++++ | ||
+ | Mew Arduino| | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels mew | ||
+ | const uint16_t PROGMEM mew0[] = {7, 31, 81, 85, 89, 96, 97, 98, 100, 105, 106, 108, 115, 116, 120, 121, 122, 263, 271, 292, 293, 295, 300, 301, 302, 303, 308, 311, 320, 321, 328, 329, 330, 336, 337, 338, 339, 344, 345, 347, 352, 353, 360, 361, 362, 368}; | ||
+ | const uint16_t PROGMEM mew1[] = {518, 525, 532, 539, 64, 80, 90, 99, 107, 215, 260, 279, 280, 281, 287, 294, 309, 369, 372, 373, 382, 484, 490, 497, 501}; | ||
+ | const uint16_t PROGMEM mew2[] = {15, 23, 50, 58, 72, 88, 91, 102, 110, 114, 117, 123, 124, 184, 185, 195, 204, 213, 214, 259, 261, 262, 268, 275, 283, 322, 346, 354, 370, 377}; | ||
+ | const uint16_t PROGMEM mew3[] = {526, 533, 35, 42, 84, 92, 93, 101, 109, 113, 125, 203, 282, 371, 378, 381}; | ||
+ | const uint16_t PROGMEM mew4[] = {29, 30}; | ||
+ | const uint16_t PROGMEM mew5[] = {538, 544, 545, 36, 43, 485, 486, 487, 491, 492, 493, 494, 498, 499, 500}; | ||
+ | const uint16_t PROGMEM mew6[] = {269, 276, 284, 286}; | ||
+ | const uint16_t PROGMEM mew7[] = {270, 285}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw mew | ||
+ | for (int i = 0; i < 46; i++){matrix.setPixelColor(pgm_read_word_near(&mew0[i]), 255, 190, 190);} | ||
+ | for (int i = 0; i < 25; i++){matrix.setPixelColor(pgm_read_word_near(&mew1[i]), 144, 80, 80);} | ||
+ | for (int i = 0; i < 30; i++){matrix.setPixelColor(pgm_read_word_near(&mew2[i]), 224, 139, 139);} | ||
+ | for (int i = 0; i < 16; i++){matrix.setPixelColor(pgm_read_word_near(&mew3[i]), 74, 74, 74);} | ||
+ | for (int i = 0; i < 2; i++){matrix.setPixelColor(pgm_read_word_near(&mew4[i]), 190, 121, 121);} | ||
+ | for (int i = 0; i < 15; i++){matrix.setPixelColor(pgm_read_word_near(&mew5[i]), 255, 160, 160);} | ||
+ | for (int i = 0; i < 4; i++){matrix.setPixelColor(pgm_read_word_near(&mew6[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 2; i++){matrix.setPixelColor(pgm_read_word_near(&mew7[i]), 0, 102, 255);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:mewtwo.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/mewtwo.ppm|Mew Two PPM]] | ||
+ | ++++ | ||
+ | Mew Two Arduino| | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels mewtwo | ||
+ | const uint16_t PROGMEM mewtwo0[] = {512, 520, 521, 528, 529, 536, 63, 80, 82, 113, 121, 122, 123, 198, 207, 215, 256, 258, 259, 260, 264, 266, 267, 272, 280, 281, 289, 290, 306, 311, 319, 368, 452, 454, 461, 462, 467, 468, 469, 470, 471, 474, 475, 476, 477, 478, 479, 482, 483, 484, 485, 486, 487, 489, 490}; | ||
+ | const uint16_t PROGMEM mewtwo1[] = {544, 62, 81, 83, 107, 116, 120, 125, 127, 177, 197, 205, 212, 219, 235, 257, 261, 265, 268, 273, 274, 282, 283, 291, 297, 302, 308, 312, 318, 320, 328, 337, 352, 377, 449, 460, 494}; | ||
+ | const uint16_t PROGMEM mewtwo2[] = {88, 89, 90, 98, 114, 115, 124, 292, 299, 300, 303, 309, 310, 315, 316, 360, 369, 376, 450, 455, 458, 463, 466, 481, 503}; | ||
+ | const uint16_t PROGMEM mewtwo3[] = {91, 97, 106, 111, 119, 168, 169, 176, 184, 199, 206, 284, 285, 287, 293, 301, 321, 329, 336, 451, 459, 495}; | ||
+ | const uint16_t PROGMEM mewtwo4[] = {61, 126, 195, 196, 202, 203, 204, 209, 210, 211, 217, 218, 225, 226, 234, 243, 263}; | ||
+ | const uint16_t PROGMEM mewtwo5[] = {251, 262, 270, 271, 317, 388, 396, 403, 404, 410, 411, 417, 418, 419, 425, 426}; | ||
+ | const uint16_t PROGMEM mewtwo6[] = {269, 275, 276, 277, 278, 294, 296, 304, 313}; | ||
+ | const uint16_t PROGMEM mewtwo7[] = {338, 345, 346, 353}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw mewtwo | ||
+ | for (int i = 0; i < 55; i++){matrix.setPixelColor(pgm_read_word_near(&mewtwo0[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 37; i++){matrix.setPixelColor(pgm_read_word_near(&mewtwo1[i]), 73, 73, 73);} | ||
+ | for (int i = 0; i < 25; i++){matrix.setPixelColor(pgm_read_word_near(&mewtwo2[i]), 212, 191, 210);} | ||
+ | for (int i = 0; i < 22; i++){matrix.setPixelColor(pgm_read_word_near(&mewtwo3[i]), 164, 146, 163);} | ||
+ | for (int i = 0; i < 17; i++){matrix.setPixelColor(pgm_read_word_near(&mewtwo4[i]), 106, 73, 103);} | ||
+ | for (int i = 0; i < 16; i++){matrix.setPixelColor(pgm_read_word_near(&mewtwo5[i]), 217, 131, 210);} | ||
+ | for (int i = 0; i < 9; i++){matrix.setPixelColor(pgm_read_word_near(&mewtwo6[i]), 196, 164, 193);} | ||
+ | for (int i = 0; i < 4; i++){matrix.setPixelColor(pgm_read_word_near(&mewtwo7[i]), 115, 100, 114);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:mire.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/mire.ppm|Mire PPM]] | ||
+ | ++++ | ||
+ | Mire Arduino| | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | // Pixels mire : | ||
+ | const uint16_t PROGMEM mire0[] = {0, 16, 32, 48, 192, 208, 224, 240, 384, 400, 416, 432}; | ||
+ | const uint16_t PROGMEM mire1[] = {1, 519, 9, 527, 17, 535, 25, 543, 33, 551, 41, 559, 49, 567, 57, 575, 135, 143, 151, 159, 167, 175, 183, 191, 193, 201, 209, 217, 225, 233, 241, 249, 327, 335, 343, 351, 359, 367, 375, 383, 385, 393, 401, 409, 417, 425, 433, 441}; | ||
+ | const uint16_t PROGMEM mire2[] = {3, 11, 19, 27, 35, 43, 51, 59, 195, 203, 211, 219, 227, 235, 243, 251, 387, 395, 403, 411, 419, 427, 435, 443}; | ||
+ | const uint16_t PROGMEM mire3[] = {5, 13, 21, 29, 37, 45, 53, 61, 197, 205, 213, 221, 229, 237, 245, 253, 389, 397, 405, 413, 421, 429, 437, 445}; | ||
+ | const uint16_t PROGMEM mire4[] = {15, 23, 39, 31, 199, 207, 215, 7, 223, 231, 239, 247, 255, 47, 55, 63, 391, 399, 407, 415, 423, 431, 439, 447}; | ||
+ | const uint16_t PROGMEM mire5[] = {65, 73, 81, 89, 97, 105, 113, 121, 257, 265, 273, 281, 289, 297, 305, 313, 449, 457, 465, 473, 481, 489, 497, 505}; | ||
+ | const uint16_t PROGMEM mire6[] = {67, 75, 83, 99, 107, 115, 123, 283, 91, 259, 267, 275, 291, 299, 307, 315, 451, 459, 467, 475, 483, 491, 499, 507}; | ||
+ | const uint16_t PROGMEM mire7[] = {69, 77, 85, 93, 101, 109, 117, 125, 261, 269, 277, 285, 293, 301, 309, 317, 453, 461, 469, 477, 485, 493, 501, 509}; | ||
+ | const uint16_t PROGMEM mire8[] = {71, 79, 87, 95, 103, 111, 119, 127, 263, 271, 279, 287, 295, 303, 311, 319, 455, 463, 471, 479, 487, 495, 503, 511}; | ||
+ | const uint16_t PROGMEM mire9[] = {529, 513, 553, 129, 137, 145, 161, 169, 177, 185, 537, 521, 561, 321, 329, 337, 345, 353, 361, 369, 377, 545, 569, 153}; | ||
+ | const uint16_t PROGMEM mire10[] = {531, 563, 379, 515, 131, 147, 155, 171, 179, 187, 331, 547, 571, 539, 139, 339, 347, 523, 355, 363, 371, 555, 163, 323}; | ||
+ | const uint16_t PROGMEM mire11[] = {549, 573, 133, 533, 141, 149, 157, 165, 517, 173, 181, 189, 557, 325, 333, 341, 349, 357, 365, 373, 541, 381, 565, 525}; | ||
+ | |||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | // Draw mire : | ||
+ | for (int i = 0; i < 12; i++){matrix.setPixelColor(pgm_read_word_near(&mire0[i]), 30, 255, 0);} | ||
+ | for (int i = 0; i < 48; i++){matrix.setPixelColor(pgm_read_word_near(&mire1[i]), 255, 0, 0);} | ||
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&mire2[i]), 255, 84, 0);} | ||
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&mire3[i]), 255, 174, 0);} | ||
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&mire4[i]), 240, 255, 0);} | ||
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&mire5[i]), 150, 255, 0);} | ||
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&mire6[i]), 0, 255, 30);} | ||
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&mire7[i]), 0, 255, 168);} | ||
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&mire8[i]), 0, 192, 255);} | ||
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&mire9[i]), 6, 0, 255);} | ||
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&mire10[i]), 174, 0, 255);} | ||
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&mire11[i]), 252, 0, 255);} | ||
+ | matrix.show(); | ||
+ | delay(10000); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:oneup.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/oneup.ppm|One Up PPM]] | ||
+ | ++++ | ||
+ | One Up Arduino| | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels oneup | ||
+ | const uint16_t PROGMEM oneup0[] = {512, 31, 38, 46, 53, 54, 55, 60, 80, 81, 82, 83, 84, 85, 86, 87, 106, 109, 114, 117, 120, 121, 122, 123, 124, 125, 126, 127, 152, 161, 169, 176, 177, 178, 187, 196, 204, 212, 220, 228, 237, 245, 254, 323, 331, 339, 347, 355, 362, 370, 377, 391, 448, 455, 457, 458, 459, 460, 461, 462}; | ||
+ | const uint16_t PROGMEM oneup1[] = {39, 47, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 107, 108, 110, 111, 112, 113, 115, 116, 118, 119, 160, 168, 186, 198, 199, 205, 206, 207, 213, 214, 215, 222, 223, 238, 239, 246, 247, 255, 264, 267, 268, 269, 270, 272, 274, 275, 276, 277, 278, 279, 282, 283, 284, 285, 286, 287, 290, 291, 292, 293, 294, 295, 296, 299, 300, 301, 302, 304, 305, 312, 313, 314, 319, 321, 322, 329, 330, 338, 361, 368, 369, 376, 449, 450}; | ||
+ | const uint16_t PROGMEM oneup2[] = {61, 62, 63, 184, 185, 197, 221, 229, 256, 257, 258, 259, 260, 261, 262, 263, 320, 346, 354, 451, 452, 453, 454}; | ||
+ | const uint16_t PROGMEM oneup3[] = {230, 265, 266, 271, 311, 315, 316, 317, 318, 328, 337, 345, 353, 360}; | ||
+ | const uint16_t PROGMEM oneup4[] = {231, 273, 280, 281, 288, 289, 297, 298, 303, 306, 307, 308, 309, 310, 336, 344, 352}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw oneup | ||
+ | for (int i = 0; i < 60; i++){matrix.setPixelColor(pgm_read_word_near(&oneup0[i]), 39, 36, 33);} | ||
+ | for (int i = 0; i < 94; i++){matrix.setPixelColor(pgm_read_word_near(&oneup1[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 23; i++){matrix.setPixelColor(pgm_read_word_near(&oneup2[i]), 171, 4, 4);} | ||
+ | for (int i = 0; i < 14; i++){matrix.setPixelColor(pgm_read_word_near(&oneup3[i]), 208, 7, 7);} | ||
+ | for (int i = 0; i < 17; i++){matrix.setPixelColor(pgm_read_word_near(&oneup4[i]), 238, 7, 7);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:papilusion.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/Papilusion.ppm|Papilusion PPM]] | ||
+ | ++++ | ||
+ | Papilusion Arduino| | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels Papilusion | ||
+ | const uint16_t PROGMEM Papilusion0[] = {74, 82, 90, 101, 111, 329, 330}; | ||
+ | const uint16_t PROGMEM Papilusion1[] = {85, 337, 338}; | ||
+ | const uint16_t PROGMEM Papilusion2[] = {46, 47, 52, 53, 60, 63, 89, 91, 92, 93, 97, 98, 99, 104, 106, 113, 114, 115, 124, 126, 127, 195, 196, 203, 205, 210, 211, 214, 215, 217, 222, 225, 228, 229, 230, 231, 233, 234, 235, 241, 249, 256, 257, 259, 261, 264, 267, 274, 275, 282, 283, 291, 292, 300, 301, 303, 309, 311, 320, 322, 460, 475}; | ||
+ | const uint16_t PROGMEM Papilusion3[] = {39, 55, 61, 62, 96, 105, 112, 120, 121, 122, 123, 197, 198, 199, 204, 206, 212, 213, 219, 220, 221, 223, 226, 227, 236, 237, 243, 244, 250, 258, 265, 272, 280}; | ||
+ | const uint16_t PROGMEM Papilusion4[] = {100, 102, 107, 108, 109, 110, 116, 117, 118, 119, 125, 184, 260, 268, 276, 285, 294, 295, 339, 344, 362}; | ||
+ | const uint16_t PROGMEM Papilusion5[] = {54, 207, 218, 238, 239, 242, 299, 306, 307, 308, 314, 315, 316, 450, 451, 452, 458, 459, 466, 467, 474}; | ||
+ | const uint16_t PROGMEM Papilusion6[] = {262, 263, 269, 270, 271, 277, 328, 336, 347}; | ||
+ | const uint16_t PROGMEM Papilusion7[] = {245, 246, 251, 252, 266, 273, 281, 288, 321, 331}; | ||
+ | const uint16_t PROGMEM Papilusion8[] = {278, 279, 286, 287, 355}; | ||
+ | const uint16_t PROGMEM Papilusion9[] = {284, 293, 302, 345, 346, 352, 353, 354, 360, 361}; | ||
+ | const uint16_t PROGMEM Papilusion10[] = {513, 522, 530, 536, 539, 544, 548, 549, 550, 552, 553, 557, 560, 561, 562, 569, 570, 319, 369, 377, 558, 559, 455, 463, 471}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw Papilusion | ||
+ | for (int i = 0; i < 7; i++){matrix.setPixelColor(pgm_read_word_near(&Papilusion0[i]), 78, 194, 190);} | ||
+ | for (int i = 0; i < 3; i++){matrix.setPixelColor(pgm_read_word_near(&Papilusion1[i]), 80, 171, 168);} | ||
+ | for (int i = 0; i < 62; i++){matrix.setPixelColor(pgm_read_word_near(&Papilusion2[i]), 64, 64, 64);} | ||
+ | for (int i = 0; i < 33; i++){matrix.setPixelColor(pgm_read_word_near(&Papilusion3[i]), 167, 167, 167);} | ||
+ | for (int i = 0; i < 21; i++){matrix.setPixelColor(pgm_read_word_near(&Papilusion4[i]), 93, 37, 206);} | ||
+ | for (int i = 0; i < 21; i++){matrix.setPixelColor(pgm_read_word_near(&Papilusion5[i]), 120, 123, 113);} | ||
+ | for (int i = 0; i < 9; i++){matrix.setPixelColor(pgm_read_word_near(&Papilusion6[i]), 224, 79, 55);} | ||
+ | for (int i = 0; i < 10; i++){matrix.setPixelColor(pgm_read_word_near(&Papilusion7[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 5; i++){matrix.setPixelColor(pgm_read_word_near(&Papilusion8[i]), 253, 136, 117);} | ||
+ | for (int i = 0; i < 10; i++){matrix.setPixelColor(pgm_read_word_near(&Papilusion9[i]), 116, 78, 194);} | ||
+ | for (int i = 0; i < 25; i++){matrix.setPixelColor(pgm_read_word_near(&Papilusion10[i]), 48, 48, 48);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:pokeball.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/pokeball.ppm|Pokeball PPM]] | ||
+ | ++++ | ||
+ | Pokeball | | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels pokeball | ||
+ | const uint16_t PROGMEM pokeball0[] = {15, 21, 22, 28, 35, 42, 47, 49, 53, 54, 55, 57, 60, 61, 62, 63, 72, 73, 74, 75, 76, 77, 78, 79, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 136, 145, 146, 155, 164, 168, 173, 176, 177, 178, 182, 184, 185, 186, 187, 190, 192, 196, 197, 198, 199, 200, 204, 205, 206, 207, 208, 212, 213, 214, 215, 216, 220, 221, 222, 223, 224, 232, 240, 248, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 277, 278, 279, 280, 281, 286, 287, 291, 292, 299, 320, 321, 322, 323, 327, 328, 329, 330, 331, 335, 336, 337, 338, 339, 343, 344, 345, 346, 347, 351, 359, 367, 375, 383, 384, 392, 401, 409, 418, 427, 436, 445, 446, 519, 527, 534, 542, 549, 556, 563, 569, 570}; | ||
+ | const uint16_t PROGMEM pokeball1[] = {31, 37, 38, 44, 51, 88, 89, 90, 91, 92, 93, 94, 95, 152, 161, 162, 171, 180, 194, 202, 210, 218, 325, 333, 341, 349}; | ||
+ | const uint16_t PROGMEM pokeball2[] = {39, 45, 46, 52, 59, 96, 97, 98, 99, 100, 101, 102, 103, 160, 169, 170, 179, 188, 195, 203, 211, 219, 300, 324, 332, 340, 348}; | ||
+ | const uint16_t PROGMEM pokeball3[] = {242, 250, 373, 381, 386, 394, 403, 411, 420, 429, 430, 439, 496, 497, 498, 499, 500, 501, 502, 503, 517, 525, 532, 540, 547, 553, 554, 560}; | ||
+ | const uint16_t PROGMEM pokeball4[] = {243, 251, 372, 380, 387, 395, 422, 431, 488, 489, 490, 491, 492, 493, 494, 495, 516, 524, 531, 539, 545, 546, 552}; | ||
+ | const uint16_t PROGMEM pokeball5[] = {244, 245, 246, 247, 252, 253, 254, 255, 304, 305, 310, 311, 312, 313, 314, 317, 318, 319, 368, 369, 370, 371, 376, 377, 378, 379, 388, 389, 390, 391, 397, 398, 399, 405, 406, 407, 413, 414, 415, 423, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 512, 513, 514, 515, 520, 521, 522, 523, 528, 529, 530, 536, 537, 538, 544}; | ||
+ | const uint16_t PROGMEM pokeball6[] = {396, 404, 412, 421}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw pokeball | ||
+ | for (int i = 0; i < 159; i++){matrix.setPixelColor(pgm_read_word_near(&pokeball0[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 26; i++){matrix.setPixelColor(pgm_read_word_near(&pokeball1[i]), 208, 208, 208);} | ||
+ | for (int i = 0; i < 27; i++){matrix.setPixelColor(pgm_read_word_near(&pokeball2[i]), 226, 226, 226);} | ||
+ | for (int i = 0; i < 28; i++){matrix.setPixelColor(pgm_read_word_near(&pokeball3[i]), 217, 0, 0);} | ||
+ | for (int i = 0; i < 23; i++){matrix.setPixelColor(pgm_read_word_near(&pokeball4[i]), 233, 0, 0);} | ||
+ | for (int i = 0; i < 95; i++){matrix.setPixelColor(pgm_read_word_near(&pokeball5[i]), 255, 0, 0);} | ||
+ | for (int i = 0; i < 4; i++){matrix.setPixelColor(pgm_read_word_near(&pokeball6[i]), 255, 178, 178);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:rayquaza.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/Rayquaza.ppm|Rayquaza PPM]] | ||
+ | ++++ | ||
+ | Rayquaza | | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels Rayquaza | ||
+ | const uint16_t PROGMEM Rayquaza0[] = {512, 513, 516, 522, 13, 14, 529, 530, 20, 23, 538, 29, 30, 31, 546, 547, 37, 554, 555, 44, 563, 56, 571, 72, 73, 81, 82, 88, 91, 96, 97, 98, 99, 105, 106, 193, 194, 195, 200, 202, 203, 204, 210, 211, 218, 224, 228, 229, 233, 238, 239, 240, 271, 277, 293, 298, 300, 301, 305, 306, 307, 308, 309, 310, 314, 315, 317, 318, 341, 346, 59, 357, 364, 378, 379, 468}; | ||
+ | const uint16_t PROGMEM Rayquaza1[] = {15, 19, 28, 353, 380, 457}; | ||
+ | const uint16_t PROGMEM Rayquaza2[] = {21, 22, 80, 89, 90, 244, 245, 254, 255, 312, 360, 370, 371, 377, 449}; | ||
+ | const uint16_t PROGMEM Rayquaza3[] = {514, 51, 521, 27, 36, 48, 52, 57, 58, 60, 83, 121, 26, 192, 196, 201, 205, 209, 214, 215, 217, 220, 221, 225, 227, 230, 232, 234, 241, 251, 42, 256, 43, 264, 278, 279, 285, 291, 295, 302, 303, 328, 329, 330, 339, 340, 344, 345, 352, 354, 362, 373, 388, 355, 455, 458, 459, 462}; | ||
+ | const uint16_t PROGMEM Rayquaza4[] = {34, 24, 33, 40, 41, 61, 62, 63, 100, 107, 108, 112, 113, 114, 115, 116, 120, 122, 123, 197, 198, 199, 206, 207, 235, 236, 237, 246, 247, 299, 304, 313, 316, 319, 369, 376, 450, 452}; | ||
+ | const uint16_t PROGMEM Rayquaza5[] = {25, 50, 35, 332}; | ||
+ | const uint16_t PROGMEM Rayquaza6[] = {515, 32, 49, 208, 212, 213, 216, 219, 222, 226, 243, 252, 257, 265, 266, 274, 275, 283, 284, 292, 294, 311, 342, 347, 348, 349, 350, 356, 358, 363, 365, 368, 372, 391, 431, 448, 451, 453, 454, 460, 461, 466, 467, 473, 474, 480, 253}; | ||
+ | const uint16_t PROGMEM Rayquaza7[] = {248, 286, 287, 331, 336, 337, 338}; | ||
+ | const uint16_t PROGMEM Rayquaza8[] = {250, 387, 395, 403}; | ||
+ | const uint16_t PROGMEM Rayquaza9[] = {481, 488}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw Rayquaza | ||
+ | for (int i = 0; i < 76; i++){matrix.setPixelColor(pgm_read_word_near(&Rayquaza0[i]), 80, 140, 100);} | ||
+ | for (int i = 0; i < 6; i++){matrix.setPixelColor(pgm_read_word_near(&Rayquaza1[i]), 215, 174, 10);} | ||
+ | for (int i = 0; i < 15; i++){matrix.setPixelColor(pgm_read_word_near(&Rayquaza2[i]), 255, 204, 0);} | ||
+ | for (int i = 0; i < 58; i++){matrix.setPixelColor(pgm_read_word_near(&Rayquaza3[i]), 64, 64, 64);} | ||
+ | for (int i = 0; i < 38; i++){matrix.setPixelColor(pgm_read_word_near(&Rayquaza4[i]), 67, 112, 82);} | ||
+ | for (int i = 0; i < 4; i++){matrix.setPixelColor(pgm_read_word_near(&Rayquaza5[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 47; i++){matrix.setPixelColor(pgm_read_word_near(&Rayquaza6[i]), 116, 183, 138);} | ||
+ | for (int i = 0; i < 7; i++){matrix.setPixelColor(pgm_read_word_near(&Rayquaza7[i]), 251, 95, 95);} | ||
+ | for (int i = 0; i < 4; i++){matrix.setPixelColor(pgm_read_word_near(&Rayquaza8[i]), 180, 86, 86);} | ||
+ | for (int i = 0; i < 2; i++){matrix.setPixelColor(pgm_read_word_near(&Rayquaza9[i]), 158, 210, 175);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:salameche.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/salameche.ppm|Salamèche PPM]] | ||
+ | ++++ | ||
+ | Salamèche Arduino| | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | // Pixels salameche : | ||
+ | const uint16_t PROGMEM salameche0[] = {516, 523, 531, 538, 544, 545, 55, 62, 63, 89, 90, 91, 96, 100, 104, 105, 107, 108, 109, 112, 118, 119, 127, 176, 185, 197, 199, 204, 207, 212, 215, 219, 222, 227, 229, 234, 235, 237, 241, 246, 249, 254, 259, 260, 269, 272, 276, 279, 280, 289, 298, 306, 315, 320, 328, 336, 337, 346, 347, 356, 365, 373, 376, 381, 385, 390, 394, 397, 402, 405, 411, 413, 420, 451, 460, 468, 477, 486, 487}; | ||
+ | const uint16_t PROGMEM salameche1[] = {512, 513, 514, 515, 520, 521, 522, 528, 529, 530, 536, 537, 98, 106, 113, 114, 115, 120, 121, 122, 123, 198, 205, 206, 213, 214, 220, 221, 228, 252, 256, 257, 258, 264, 265, 266, 267, 268, 273, 274, 275, 277, 278, 281, 282, 283, 284, 285, 286, 287, 290, 291, 292, 293, 294, 295, 299, 300, 301, 302, 307, 308, 309, 310, 316, 317, 318, 344, 345, 352, 353, 354, 355, 361, 362, 363, 364, 369, 370, 371, 372, 377, 378, 379, 380, 387, 452, 453, 454, 455, 461, 462, 463, 469, 470, 471, 478, 479}; | ||
+ | const uint16_t PROGMEM salameche2[] = {116, 117, 124, 125, 126, 236, 243, 244, 251, 261, 262, 263, 270, 271}; | ||
+ | const uint16_t PROGMEM salameche3[] = {242, 245, 250, 253, 386, 388, 389, 395, 396, 403, 404, 412}; | ||
+ | |||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | // Draw salameche : | ||
+ | for (int i = 0; i < 79; i++){matrix.setPixelColor(pgm_read_word_near(&salameche0[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 98; i++){matrix.setPixelColor(pgm_read_word_near(&salameche1[i]), 255, 148, 0);} | ||
+ | for (int i = 0; i < 14; i++){matrix.setPixelColor(pgm_read_word_near(&salameche2[i]), 238, 245, 0);} | ||
+ | for (int i = 0; i < 12; i++){matrix.setPixelColor(pgm_read_word_near(&salameche3[i]), 255, 0, 0);} | ||
+ | matrix.show(); | ||
+ | delay(10000); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:smile.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/smile.ppm|Smiley PPM]] (Siméon - Atelier Bidouille 2017) | ||
+ | ++++ | ||
+ | Smiley Arduino| | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels smile | ||
+ | const uint16_t PROGMEM smile0[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 56, 57, 58, 59, 60, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 92, 95, 109, 110, 116, 119, 124, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 156, 157, 158, 159, 164, 165, 166, 167, 173, 174, 175, 182, 183, 190, 191, 192, 193, 194, 195, 196, 197, 200, 201, 202, 203, 204, 208, 209, 210, 211, 212, 216, 217, 218, 219, 220, 223, 224, 225, 226, 227, 228, 231, 232, 233, 234, 235, 236, 239, 240, 241, 242, 243, 244, 248, 249, 250, 251, 252, 253, 260, 263, 268, 271, 272, 273, 277, 278, 282, 291, 300, 303, 304, 308, 311, 313, 314, 315, 326, 327, 335, 338, 339, 343, 345, 351, 352, 356, 359, 364, 367, 371, 375, 376, 377, 378, 382, 383, 384, 385, 386, 387, 388, 389, 392, 393, 394, 395, 396, 397, 398, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 472, 480, 481, 482, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 518, 519, 525, 526, 527, 532, 533, 534, 535, 539, 540, 541, 542, 543, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575}; | ||
+ | const uint16_t PROGMEM smile1[] = {47, 54, 62, 88, 91, 93, 94, 96, 99, 100, 103, 114, 121, 152, 155, 160, 163, 172, 177, 180, 181, 186, 189, 198, 199, 205, 213, 221, 229, 237, 245, 256, 323, 324, 325, 334, 342, 350, 358, 366, 374}; | ||
+ | const uint16_t PROGMEM smile2[] = {55, 63, 89, 90, 97, 98, 101, 102, 104, 105, 106, 107, 108, 111, 112, 113, 115, 120, 122, 123, 153, 154, 161, 162, 168, 169, 170, 171, 176, 178, 179, 184, 185, 187, 188, 206, 207, 214, 215, 222, 230, 238, 257, 258, 259, 264, 265, 266, 267, 274, 275, 276, 279, 283, 284, 285, 286, 287, 292, 293, 294, 295, 301, 302, 309, 310, 320, 321, 322, 328, 329, 330, 331, 332, 333, 336, 337, 340, 341, 344, 348, 349, 357, 365}; | ||
+ | const uint16_t PROGMEM smile3[] = {117, 118, 125, 126, 261, 262, 269, 270}; | ||
+ | const uint16_t PROGMEM smile4[] = {280, 281, 288, 289, 290, 296, 297, 298, 299, 305, 306, 307, 346, 347, 353, 354, 355, 360, 361, 362, 363, 368, 369, 370}; | ||
+ | const uint16_t PROGMEM smile5[] = {246, 247, 255, 312, 316, 317, 318, 319, 372, 373, 379, 380, 391, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 465, 466, 467, 468, 469, 470, 471, 475, 476, 477, 478, 479, 512, 513, 514, 515, 516, 520, 521, 522, 523, 528, 529, 530, 536}; | ||
+ | const uint16_t PROGMEM smile6[] = {254, 381, 390, 399, 464, 473, 474, 483, 484, 485, 486, 487, 517, 524, 531, 537, 538, 544}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw smile | ||
+ | for (int i = 0; i < 347; i++){matrix.setPixelColor(pgm_read_word_near(&smile0[i]), 1, 1, 1);} | ||
+ | for (int i = 0; i < 41; i++){matrix.setPixelColor(pgm_read_word_near(&smile1[i]), 255, 120, 0);} | ||
+ | for (int i = 0; i < 84; i++){matrix.setPixelColor(pgm_read_word_near(&smile2[i]), 255, 186, 0);} | ||
+ | for (int i = 0; i < 8; i++){matrix.setPixelColor(pgm_read_word_near(&smile3[i]), 255, 0, 0);} | ||
+ | for (int i = 0; i < 24; i++){matrix.setPixelColor(pgm_read_word_near(&smile4[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 54; i++){matrix.setPixelColor(pgm_read_word_near(&smile5[i]), 76, 193, 210);} | ||
+ | for (int i = 0; i < 18; i++){matrix.setPixelColor(pgm_read_word_near(&smile6[i]), 76, 148, 210);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:titofortnite.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/titofortnite.ppm|Tito Fortnite PPM]] (Tito - Atelier Bidouille 2017) | ||
+ | ++++ | ||
+ | Tito Fortnite Arduino | | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels titofortnite | ||
+ | const uint16_t PROGMEM titofortnite0[] = {521, 522, 523, 528, 39, 46, 54, 82, 83, 84, 85, 86, 88, 89, 197, 198, 203, 204, 211, 218, 226, 235, 243, 252, 323, 389, 398, 407, 471, 472, 473, 474, 478, 483, 484, 485}; | ||
+ | const uint16_t PROGMEM titofortnite1[] = {90, 160}; | ||
+ | const uint16_t PROGMEM titofortnite2[] = {55, 91, 98, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 114, 115, 116, 118, 121, 123, 127, 168, 169, 176, 177, 185, 258, 260, 263, 267, 322}; | ||
+ | const uint16_t PROGMEM titofortnite3[] = {92}; | ||
+ | const uint16_t PROGMEM titofortnite4[] = {93, 96}; | ||
+ | const uint16_t PROGMEM titofortnite5[] = {94}; | ||
+ | const uint16_t PROGMEM titofortnite6[] = {512, 517, 524, 95, 152, 161, 170, 178, 187, 220, 221, 222, 231, 264, 273, 291, 296, 299, 305, 308, 314, 317, 319, 331, 339, 347, 354, 362, 369, 370, 371, 376, 380, 450, 453, 454, 455, 459, 461, 467, 468, 469}; | ||
+ | const uint16_t PROGMEM titofortnite7[] = {97}; | ||
+ | const uint16_t PROGMEM titofortnite8[] = {99}; | ||
+ | const uint16_t PROGMEM titofortnite9[] = {100}; | ||
+ | const uint16_t PROGMEM titofortnite10[] = {47, 63, 113, 117, 119, 120, 122, 124, 125, 126, 184, 199, 256, 257, 259, 261, 262, 265, 266, 268, 269, 270, 271, 274, 275, 276, 277, 278, 279, 282, 283, 284, 285, 286, 287, 293, 294, 320, 321, 328, 329, 330, 336, 337, 338, 344, 345, 346, 352}; | ||
+ | const uint16_t PROGMEM titofortnite11[] = {53}; | ||
+ | const uint16_t PROGMEM titofortnite12[] = {61}; | ||
+ | const uint16_t PROGMEM titofortnite13[] = {62}; | ||
+ | const uint16_t PROGMEM titofortnite14[] = {186}; | ||
+ | const uint16_t PROGMEM titofortnite15[] = {513, 514, 515, 516, 520, 205, 206, 212, 213, 214, 215, 219, 223, 227, 228, 229, 230, 236, 237, 238, 239, 244, 245, 246, 247, 253, 254, 255, 272, 280, 281, 288, 289, 290, 297, 298, 304, 306, 307, 312, 313, 315, 316, 377, 378, 379, 390, 391, 399, 448, 449, 451, 452, 456, 457, 458, 460, 462, 463, 464, 465, 466, 470, 475, 476, 477}; | ||
+ | const uint16_t PROGMEM titofortnite16[] = {207}; | ||
+ | const uint16_t PROGMEM titofortnite17[] = {295}; | ||
+ | const uint16_t PROGMEM titofortnite18[] = {353}; | ||
+ | const uint16_t PROGMEM titofortnite19[] = {303, 361}; | ||
+ | const uint16_t PROGMEM titofortnite20[] = {360}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw titofortnite | ||
+ | for (int i = 0; i < 36; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite0[i], 255, 255, 255);} | ||
+ | for (int i = 0; i < 2; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite1[i], 94, 73, 195);} | ||
+ | for (int i = 0; i < 32; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite2[i], 36, 72, 255);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite3[i], 67, 53, 140);} | ||
+ | for (int i = 0; i < 2; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite4[i], 80, 63, 168);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite5[i], 74, 58, 154);} | ||
+ | for (int i = 0; i < 42; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite6[i], 255, 254, 254);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite7[i], 63, 50, 132);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite8[i], 68, 53, 141);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite9[i], 99, 81, 186);} | ||
+ | for (int i = 0; i < 49; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite10[i], 35, 131, 213);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite11[i], 21, 21, 21);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite12[i], 87, 87, 87);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite13[i], 245, 245, 245);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite14[i], 14, 183, 246);} | ||
+ | for (int i = 0; i < 66; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite15[i], 146, 132, 129);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite16[i], 201, 200, 200);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite17[i], 34, 75, 109);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite18[i], 36, 30, 70);} | ||
+ | for (int i = 0; i < 2; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite19[i], 13, 11, 25);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titofortnite20[i], 25, 21, 48);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:titopixel.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/titopixel.ppm|Tito Pixel PPM]] (Tito - Atelier Bidouille 2017) | ||
+ | ++++ | ||
+ | Tito Pixel | | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels titopixel | ||
+ | const uint16_t PROGMEM titopixel0[] = {516, 521, 524, 529, 532, 538, 539, 55, 63, 82, 83, 84, 85, 86, 87, 89, 96, 104, 124, 125, 126, 144, 145, 154, 163, 171, 180, 188, 199, 207, 263, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 283, 286, 288, 291, 294, 296, 299, 302, 304, 307, 308, 309, 311, 312, 315, 324, 328, 332, 336, 337, 340, 345, 348, 353, 356, 361, 364, 368, 369, 372, 377, 380, 448, 451, 456, 459, 464, 467, 473, 474}; | ||
+ | const uint16_t PROGMEM titopixel1[] = {284}; | ||
+ | const uint16_t PROGMEM titopixel2[] = {285}; | ||
+ | const uint16_t PROGMEM titopixel3[] = {513}; | ||
+ | const uint16_t PROGMEM titopixel4[] = {457}; | ||
+ | const uint16_t PROGMEM titopixel5[] = {458}; | ||
+ | const uint16_t PROGMEM titopixel6[] = {522}; | ||
+ | const uint16_t PROGMEM titopixel7[] = {523}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw titopixel | ||
+ | for (int i = 0; i < 81; i++){matrix.setPixelColor(pgm_read_word_near(&titopixel0[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titopixel1[i]), 3, 3, 3);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titopixel2[i]), 5, 5, 5);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titopixel3[i]), 252, 252, 252);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titopixel4[i]), 46, 46, 46);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titopixel5[i]), 50, 50, 50);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titopixel6[i]), 52, 52, 52);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titopixel7[i]), 51, 51, 51);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:titopointer2.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/titopointer2.ppm|Tito Pointer PPM]] (Tito - Atelier Bidouille 2017) | ||
+ | ++++ | ||
+ | Tito Pointer | | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels titopointer2 | ||
+ | const uint16_t PROGMEM titopointer20[] = {513, 258, 260, 262, 520, 215, 345, 152, 281, 283, 286, 288, 161, 289, 347, 294, 170, 299, 300, 301, 302, 463, 179, 310, 187, 318, 63, 324, 454, 199, 329, 333, 207, 81, 82, 291, 84, 85, 86, 87, 89, 91, 348, 223, 97, 337, 104, 361, 106, 108, 338, 110, 353, 112, 369, 114, 116, 118, 377, 122, 124, 298, 126, 341}; | ||
+ | const uint16_t PROGMEM titopointer21[] = {521}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw titopointer2 | ||
+ | for (int i = 0; i < 64; i++){matrix.setPixelColor(pgm_read_word_near(&titopointer20[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titopointer21[i]), 12, 12, 12);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | ---- | ||
+ | |||
+ | {{projets:titosnapchat.png?200}} | ||
+ | |||
+ | [[http://poplab.maisonpop.fr/ressources/ppm/titosnapchat.ppm|Tito Snapchat PPM]] (Tito - Atelier Bidouille 2017) | ||
+ | ++++ | ||
+ | Tito Snapchat | | ||
+ | <code c> | ||
+ | |||
+ | Copy/Paste this part before your setup(): | ||
+ | |||
+ | //Pixels titosnapchat | ||
+ | const uint16_t PROGMEM titosnapchat0[] = {514, 522, 530, 537, 544, 47, 54, 61, 93, 94, 99, 100, 103, 104, 105, 106, 160, 169, 170, 171, 172, 181, 190, 198, 199, 231, 238, 247, 264, 273, 280, 281, 296, 297, 305, 313, 324, 325, 331, 338, 346, 347, 356, 362, 363, 365, 370, 372, 378, 449, 457, 465, 474, 483, 492, 493, 494, 495}; | ||
+ | const uint16_t PROGMEM titosnapchat1[] = {529, 536, 55, 62, 101, 102, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 118, 119, 168, 176, 177, 178, 179, 180, 187, 188, 189, 256, 257, 259, 263, 265, 266, 267, 271, 274, 275, 282, 283, 284, 288, 289, 290, 291, 292, 298, 299, 306, 314, 320, 323, 328, 330, 336, 337, 344, 345, 352, 369, 377, 452, 454, 458, 462, 463, 466, 475, 484, 487}; | ||
+ | const uint16_t PROGMEM titosnapchat2[] = {262}; | ||
+ | const uint16_t PROGMEM titosnapchat3[] = {503}; | ||
+ | const uint16_t PROGMEM titosnapchat4[] = {511}; | ||
+ | |||
+ | |||
+ | Copy/Paste this part in your loop(): | ||
+ | |||
+ | //Draw titosnapchat | ||
+ | for (int i = 0; i < 58; i++){matrix.setPixelColor(pgm_read_word_near(&titosnapchat0[i]), 255, 255, 255);} | ||
+ | for (int i = 0; i < 69; i++){matrix.setPixelColor(pgm_read_word_near(&titosnapchat1[i]), 28, 24, 23);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titosnapchat2[i]), 15, 13, 13);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titosnapchat3[i]), 30, 30, 30);} | ||
+ | for (int i = 0; i < 1; i++){matrix.setPixelColor(pgm_read_word_near(&titosnapchat4[i]), 20, 20, 20);} | ||
+ | matrix.show(); | ||
+ | delay(delay_var); | ||
+ | matrix.fillScreen(0); | ||
+ | |||
+ | </code> | ||
+ | ++++ | ||
+ | |||
+ | |||
+ | |||
+ | |||
Dans arduino on utilisera la méthode matrix.setPixelColor() de la lib NeoMatrix. | Dans arduino on utilisera la méthode matrix.setPixelColor() de la lib NeoMatrix. | ||
Ligne 211: | Ligne 900: | ||
*On peut modifier le script python pour qu'il détecte combien de couleurs sont réellement utilisés et stocker ces données. Ensuite établir une correspondance entre les index de pixel et l'index de la couleur à attribuer. On manipulera plus de arrays, mais ils devraient être nettement moins volumineux que les précédents. | *On peut modifier le script python pour qu'il détecte combien de couleurs sont réellement utilisés et stocker ces données. Ensuite établir une correspondance entre les index de pixel et l'index de la couleur à attribuer. On manipulera plus de arrays, mais ils devraient être nettement moins volumineux que les précédents. | ||
*On peut essayer de reverse-engineer la manière dont l'outil qui convertit les bitmaps en hash fonctionne et utiliser une méthode similaire | *On peut essayer de reverse-engineer la manière dont l'outil qui convertit les bitmaps en hash fonctionne et utiliser une méthode similaire | ||
- | *Pour aller plus loin et rendre le code plus robuste | ||
- | *Lire l'en-tête et vérifier que l'on a bien 24x24, sinon renvoyer une erreur appropriée | ||
- | ==== Code Arduino ==== | ||
- | ++++ Déclaration de la matrice | | ||
- | <code c> | ||
- | Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(8, 8, 3, 3, PIN, | ||
- | NEO_TILE_BOTTOM + NEO_TILE_RIGHT + NEO_TILE_ROWS + NEO_TILE_PROGRESSIVE + | ||
- | NEO_MATRIX_BOTTOM + NEO_MATRIX_RIGHT + NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE, | ||
- | NEO_GRB + NEO_KHZ800); | ||
- | </code> | ||
- | ++++ | ||