A pulsing light with the illumination rate of a sinus curve.
Code:
unsigned char light_puls_val = 0;
..
(loop of some kind)
light_pulse_val = (255/2)*sin((light_pulse_n*M_PI/128)-M_PI/2)+(255/2);
setPWM('A',light_pulse_val);
light_puls_n = light_puls_n+1%255; // OR light_puls_n++;
Programmed on a ATmega128 using USBtinyISP and avrdude. AVR Studio 4.
Link to this comment:
All Comments (0)