// Simulador de gerador de onda senoidal
int saidaPWM;
int x, valor;
float seno;
#define saidaPWM 3
void setup() {
Serial.begin(9600);
pinMode (saidaPWM, OUTPUT);
}
void loop () {
for (x=0; x<255; x++) {
seno = 100+(100*(sin(x*(2*PI/255))));
valor = int(seno);
analogWrite(saidaPWM, valor);
Serial.println(valor);
delay(10);
}
}