LED Array Jacket

From NYC Resistor Wiki
Jump to: navigation, search

Jacket.png


About[edit]

This starts out as an LED Array Integrated into an old Jacket I have. The driver IC is a max6952. The LED Array itself is pretty straightforward. Arduino will be used to control the output, as well as integrate future hardware

See it here:

http://www.nycresistor.com/2008/05/19/led-jacket-test/

Status[edit]

* LED Arrays Completed.
* LED Arrays wired to driver IC.
* Arduino was wired to the driver IC, until the TSA decided to unwire it.
* Rewired again, could use some cleanup.
* Rebuilt Left Array due to LED burnout as result of defective resistor on current ref.
* Bluetooth module has been acquired, but I have not had time to work with it yet.
> Working on Scrolling Code for Display

Test Code for MAX6952 on Arduino[edit]

 0 // Max 6952 Example Code For Arduino
 1 // Tested on Boarduino
 2 // Matt Joyce @ NYC Resistor
 3 
 4 #define DATAOUT 11//MOSI
 5 #define DATAIN 12//MISO - not used, but part of builtin SPI
 6 #define SPICLOCK  13//sck
 7 #define SLAVESELECT 10//ss
 8 
 9 char spi_transfer(volatile char data)
10 {
11   SPDR = data;
12   // Start the transmission
13   while (!(SPSR & (1<<SPIF)))     // Wait the end of the transmission
14   {
15   };
16   return SPDR;                    // return the received byte
17 }
18 
19 void setup()
20 {
21   byte i;
22   byte clr;
23   pinMode(DATAOUT, OUTPUT);
24   pinMode(DATAIN, INPUT);
25   pinMode(SPICLOCK,OUTPUT);
26   pinMode(SLAVESELECT,OUTPUT);
27   digitalWrite(SLAVESELECT,HIGH); //disable device
28   // SPCR = 01010000
29   //interrupt disabled,spi enabled,msb 1st,master,clk low when idle,
30   //sample on leading edge of clk,system clock/4 (fastest)
31   SPCR = 0b01010010;  
32   clr=SPDR;
33   delay(32);
34      // Configure Register
35      write_led_twice(0x04,0x01);
36      // Intensity Pane 1 and Pane 2
37      write_led_twice(0x01,0xFF);
38      write_led_twice(0x02,0xFF);
39      // Scan Limit
40      write_led_twice(0x03,0x01);
41      
42 }
43 
44 byte write_led(int address, int value)
45 {
46   digitalWrite(SLAVESELECT,LOW);
47   //2 byte opcode
48   spi_transfer(address);
49   spi_transfer(value);
50   
51   delay(36);
52   digitalWrite(SLAVESELECT,HIGH); //release chip, signal end transfer
53 }
54 
55 // Write n times for n chips daisy chained.
56 byte write_led_twice(int address, int value)
57 {
58   digitalWrite(SLAVESELECT,LOW);
59   //2 byte opcode
60   spi_transfer(address);
61   spi_transfer(value);
62   spi_transfer(address);
63   spi_transfer(value);
64   delay(36);
65   digitalWrite(SLAVESELECT,HIGH); //release chip, signal end transfer
66 }
67 
68 void loop()
69 {
70      // Testing ROM Character Set
71      write_led_twice(0x20,0x5e);
72      write_led_twice(0x21,0x5e);
73      write_led_twice(0x22,0x5e);
74      write_led_twice(0x23,0x5e);
75      delay(4000);
76      // Testing Programmable RAM Space
77      write_led_twice(0x05,0x80);
78      write_led_twice(0x05,0x42);
79      write_led_twice(0x05,0x61);
80      write_led_twice(0x05,0x51);
81      write_led_twice(0x05,0x49);
82      write_led_twice(0x05,0x46);
83      write_led_twice(0x20,0x80);
84      write_led_twice(0x21,0x80);
85      write_led_twice(0x22,0x80);
86      write_led_twice(0x23,0x80);
87      delay(4000);
88      // Gred Test Register Call
89      write_led_twice(0x07,0x01);
90      
91      delay(1000);     
92      // Turn off Test Register
93      write_led_twice(0x07,0x00);
94 }

Creator[edit]

Matt Joyce Thanks to all of NYC resistor for support.