- Thread starter
- #16
Now i have all the gear needed, now to start coding it all together
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Latest Update from 2017,any update on this project Alec
//Send DMX on usart0
UCSR0B = (1 << TXEN0); // Enable transmitter
UCSR0A |= (1 << U2X0); // Double transmission speed
while ( ! (UCSR0A & (1 << UDRE0)) ); // Wait for buffer to empty
// Send break and mark after break
UBRR0H = 0; UBRR0L = 17; // Set baud to 100,000bps @ 16Mhz clock
UCSR0C = (3 << UCSZ00) | (2 << UPM00); // Set 8 data bits, E parity and 1 stop bit.
UDR0 = 0x00; // load data into usart buffer and send
UCSR0A |= (1 << TXC0); // Clear transmit complete flag
while ( ! (UCSR0A & (1 << TXC0)) ); // Wait for transmit complete flag
// Send start code 0x00
UBRR0H = 0; UBRR0L = 7; // Set baud to 250,000bps @ 16Mhz clock
UCSR0C = (1 << USBS0) | (3 << UCSZ00); // Set 8 data bits, no parity and 2 stop bits
UDR0 = 0x00; // Load data into usart buffer and send
// Send data
for (int n = 126; n < 638; n++) { // Loop 512 times
while ( ! (UCSR0A & (1 << UDRE0)) ); // Wait for buffer to empty
UDR0 = data[n]; // load data into usart buffer and send
}
UCSR0C = 0xC0; // Set MSPI data mode 1.
UCSR0B = (1 << TXEN0); // Enable transmitter
UCSR0A |= (1 << U2X0); // Double transmission speed
UBRR0H = 0; UBRR0L = 1; // Set baud to 4,000,000bps @ 16Mhz clock
// Send data
cli();
for (int n = 126; n < 638; n++) { // Loop 512 times
op1 = B01111011; // set values to zero pixel
if (data[n] & B10000000) op1 &= B10011111; // mask as 1 if pixel data bit is a 1
if (data[n] & B01000000) op1 &= B11111100; // mask as 1 if pixel data bit is a 1
while ( ! (UCSR0A & (1 << UDRE0)) ); // Wait for buffer to empty
UDR0 = op1; // write to output buffer
op2 = B11011110; // set values to zero pixel
if (data[n] & B00100000) op2 &= B11100111; // mask as 1 if pixel data bit is a 1
while ( ! (UCSR0A & (1 << UDRE0)) ); // Wait for buffer to empty
UDR0 = op2; // write to output buffer
op3 = B11110111; // set values to zero pixel
if (data[n] & B00010000) op3 &= B00111111; // mask as 1 if pixel data bit is a 1
if (data[n] & B00001000) op3 &= B11111001; // mask as 1 if pixel data bit is a 1
while ( ! (UCSR0A & (1 << UDRE0)) ); // Wait for buffer to empty
UDR0 = op3; // write to output buffer
op4 = B10111101; // set values to zero pixel
if (data[n] & B00000100) op4 &= B11001111; // mask as 1 if pixel data bit is a 1
if (data[n] & B00000010) op4 &= B11111110; // mask as 1 if pixel data bit is a 1
while ( ! (UCSR0A & (1 << UDRE0)) ); // Wait for buffer to empty
UDR0 = op4; // write to output buffer
op5 = B11101111; // set values to zero pixel
if (data[n] & B00000010) op5 &= B01111111; // mask as 1 if pixel data bit is a 1
if (data[n] & B00000001) op5 &= B11110011; // mask as 1 if pixel data bit is a 1
while ( ! (UCSR0A & (1 << UDRE0)) ); // Wait for buffer to empty
UDR0 = op5; // write to output buffer
}
sei();
What about using a raspberry Pi? In built support for LCD screens and inputs, no analog inputs though.
Richard