14,7 → 14,6 |
|
|
#include <avr/io.h> |
#include <util/delay.h> |
|
#define TX_High PORTA |= 1 << PORTA0 // Set TX-Pin High |
#define TX_Low PORTA &= ~(1 << PORTA0) // Set TX-Pin Low |
27,8 → 26,9 |
{ |
if (sync == 0) SYNC_High; else SYNC_Low; // Send Sync |
if (data == 0) TX_High; else TX_Low; // Send Data |
_delay_ms(22); // Don't be too fast (Spektrum DX7 updates every 22ms) |
} // (For DX7se set it to 11ms!!) |
while ( PIND & (1<<PD5) ); // Wait for DX7-Sync goes low |
while ( !(PIND & (1 << PD5)) ); // Wait for DX7-Sync goes high |
} |
|
|
|
36,9 → 36,9 |
{ |
char i,Parity; // Bit-Counter and Parity Bit |
DDRA = 0b011; // PORT A INPUT: RESET; OUTPUT: Sync+Data |
DDRD = 0b0000000; // PORT D INPUT: Switches |
DDRD = 0b0000000; // PORT D INPUT: Switches + DX7-Sync |
PORTA = 0b111; // Pull-Up for /RESET, High for Sync+Data |
PORTD = 0b1111111; // Pull-Up for Switches |
PORTD = 0b0011111; // Pull-Up for Switches |
|
while(1) // Main-Loop (Sending data all the time) |
{ |