Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // I christian cook did this on my own and did not copy anyone elses work
- /*
- * btn_hold_main2.c.c
- *
- * Created: 10/9/2019 3:06:47 PM
- * Author : ccook4
- */
- #include <avr/io.h>
- #define F_CPU 16000000 // need to tell delay.h the CPU frequency
- #include <util/delay.h> // needed for _delay_ms() routines
- int main(void)
- {
- DDRC = DDRC & 0b11000111;
- PORTC = PORTC | 0b00111000;
- PORTB = PORTB | 0b00011110;
- DDRB = 0b00011110;
- /* Replace with your application code */
- while (1)
- {
- if(PINC ==( PINC & 0b11011111))
- {
- PORTB = 0b00010111;
- }
- else
- {
- PORTB = 0b00011110;
- }
- if(PINC ==(PINC & 0b11101111))
- {
- PORTB = 0b00011011;
- }
- else
- {
- PORTB = 0b00011110;
- }
- if(PINC ==( PINC & 0b11110111))
- {
- PORTB = 0b00011101;
- }
- else
- {
- PORTB = 0b00011111;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement