byte led_pwm=3;
void setup()
{
// put your setup code here, to run once:
pinMode(led_pwm,OUTPUT);
randomSeed(analogRead(0));
Serial.begin(9600);
}
void loop()
{
int val;
analogWrite(led_pwm,val=random(135)+120);
Serial.println(val);
delay(random(100));
// put your main code here, to run repeatedly:
}
沒有留言:
張貼留言