Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * IRSensorBoard.c
- *
- * Created: 1/08/2017 12:34:02 PM
- * Author : Jon Connor
- */
- #define F_CPU 1000000UL
- #include <avr/io.h>
- #include <util/delay.h>
- /*PINOUTS
- PA0-4 Sensor 1-5 analog inputs
- PA5 Vcc input
- PA6/PA7 Sensor voltage select outputs. Active LOW
- PB0-3 Sensor 1-4 enable outputs. Active HIGH
- PC5 Sensor 5 enable output. Active HIGH
- PC0 indicator LED output.
- PC1/PC4 I2C Clock/Data lines
- */
- int main(void)
- {
- PORTA |= (0<<PORTA7) | (1<<PORTA6); //one power source on for now, doing this before setting outputs
- DDRA |= (1<<PORTA7) | (1<<PORTA6);
- DDRB |= ((1<<PORTB0) | (1<<PORTB1) | (1<<PORTB2) | (1<<PORTB3));
- while (1)
- {
- PORTB &= !(1<<PORTB0);
- PORTB |= (1<<PORTB1);
- _delay_ms(50);
- PORTB &= !(1<<PORTB1);
- PORTB |= (1<<PORTB2);
- _delay_ms(50);
- PORTB &= !(1<<PORTB2);
- PORTB |= (1<<PORTB3);
- _delay_ms(50);
- PORTB &= !(1<<PORTB3);
- PORTB |= (1<<PORTB0);
- _delay_ms(50);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement