Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main (void)
- {
- int adc_in;
- DDRB |= (1<<PB1);
- // LED is an output.
- DDRB |= (1 << LED);
- DDRB |= (1<<PB0);
- adc_setup();
- pwm_setup();
- PB1 == 0;
- while (1) {
- if(!(PINB&(1<<PB0)))
- {
- if(!(PINB&(1<<PB0)))
- {
- PB1==0 ;
- _delay_ms(20);
- // Get the ADC value
- adc_in = adc_read();
- // Now write it to the PWM counter
- pwm_write(adc_in);
- _delay_ms(50);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement