Doctorado

Artifact [4c2008c9af]
Login

Artifact 4c2008c9af9c917509a050545c0d900f2ed00562:


//CS 08
int pin10 = 10;
int input=0;

void setup () {
 
 Serial.begin(9600);//starts serial at 9600
 
  }

void loop () {
  
  if (Serial.available() > 0)  // if serial is higher than 0 then serial read = input value
  
  {
		
  input = Serial.read();
  
analogWrite(pin10,input);  // we write the value from input into pin 10 pwm 

Serial.print(input); // print what you get 
delay(20); // wait 20 milliseconds
}
}