Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define F_CPU 4800000UL
- #include <avr/io.h>
- #include <util/delay.h>
- #define LED_LOW_PIN PB0
- #define LED_HIGH_PIN PB1
- int main(void)
- {
- // set the two AMC7135 channels as output
- DDRB = (1 << LED_LOW_PIN) | (1 << LED_HIGH_PIN);
- // loop forever
- while(1) {
- PORTB = (1 << LED_LOW_PIN); // Low channel on
- _delay_ms(3000); // wait 3 seconds
- PORTB = (1 << LED_HIGH_PIN); // High channel on
- _delay_ms(3000); // wait 3 seconds
- PORTB = (1 << LED_LOW_PIN) | (1 << LED_HIGH_PIN); // Both channels on
- _delay_ms(3000); // wait 3 seconds
- }
- return 0; // Standard Return Code
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement