Last active
August 29, 2015 14:25
-
-
Save JulioAlexanderAguilarAngulo/4673acbd2bab505e91f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void SendData_4094(uint8_t sel,uint8_t data) | |
{ | |
#define DAT_4094 1<<4 | |
#define CLK_4094 1<<5 | |
#define ENA_4094 1<<6 | |
#define STB_4094 1<<7 | |
uint8_t LOOP, FLAG; | |
PORTA &= ~ ( ENA_4094 | STB_4094 ) ; PORTB &= ~ ( CLK_4094 ); PORTA |= ENA_4094; | |
for (LOOP=0; LOOP<8; LOOP++) { PORTB &= ~ ( CLK_4094 ); FLAG=sel&0x80; | |
if(FLAG==0){ PORTB &= ~ ( DAT_4094 );} | |
else { PORTB |= DAT_4094 ;} | |
sel <<= 1; PORTB |= ( CLK_4094 ); } | |
for (LOOP=0; LOOP<8; LOOP++) { PORTB &= ~ ( CLK_4094 ); FLAG=data&0x80; | |
if(FLAG==0){ PORTB &= ~ ( DAT_4094 );} | |
else { PORTB |= DAT_4094 ;} | |
data <<= 1; PORTB |= ( CLK_4094 );} | |
PORTB &= ~ ( CLK_4094 ); PORTA |= STB_4094; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment