Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int value;
- void setup()
- {
- pinMode(A0, INPUT);
- pinMode(11, OUTPUT);
- Serial.begin(9600);
- }
- void loop()
- {
- value = analogRead(A0);
- if(value <= 60){
- value = 0;
- }
- if(value >= 970){
- value = 1023;
- }
- value = map(value, 0, 1023, 0, 255);
- analogWrite(11, value);
- delay(10);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement