Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Using Atmega48PA*/
- #include <avr/io.h>
- int main(void)
- {
- PORTC = 0×00; //disabling Pull-Up
- DDRC = 0xFF;
- DDRB = DDRB & 0b11111100;
- unsigned char driveBuffer=0;
- while(1)
- {
- if(PINB & 0b11111100)
- {
- driveBuffer = 0xFE;
- }
- else if(PINB & 0xFD)
- {
- driveBuffer = 0xFD;
- }
- else if(PINB & 0xFE)
- {
- driveBuffer= 0xFC;
- }
- else if(PINB == 0b11111111)
- {
- driveBuffer = 0xFB;
- }
- PORTC = driveBuffer;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement