Guest User

Untitled

a guest
Aug 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. Problems in AVR C combining ADC readings to generate PWM output
  2. OCR2A = (sine_0 + sine_1) & 0xFF;
  3.  
  4. uint8_t sine_0 = (pgm_read_byte(&sinewave_data[sample_0]) >> 5) * (adc_readings[1] >> 5);
  5. uint8_t sine_1 = (pgm_read_byte(&sinewave_data[sample_1]) >> 5) * (adc_readings[2] >> 5);
  6. OCR2A = (sine_0 >> 1) + (sine_1 >> 1);
Add Comment
Please, Sign In to add comment