keyestudio
www.keyestudio.cc
26
val=analogRead(potpin);// read the analog value from the sensor and assign it to val
Serial.println(val);// display value of val
analogWrite(ledpin,val/4);// turn on LED and set up brightness
(
maximum output of PWM is 255
)
delay(10);// wait for 0.01 second
}
//////////////////////////////////////////////////////////
Result
After downloading the program, when we rotate the potentiometer knob, we can see changes of
the displaying value, also obvious change of the LED brightness on the breadboard.
*******************************************************************************
Summary of Contents for ARDUINO maker learning kit
Page 1: ...keyestudio www keyestudio cc ARDUINO maker learning kit...
Page 23: ...keyestudio www keyestudio cc 21 Connection for 2560 R3...
Page 30: ...keyestudio www keyestudio cc 28 Connection for 2560 R3...
Page 39: ...keyestudio www keyestudio cc 37 Connection for 2560 R3...
Page 43: ...keyestudio www keyestudio cc 41 Connection for 2560 R3...
Page 46: ...keyestudio www keyestudio cc 44 Connection for 2560 R3...
Page 50: ...keyestudio www keyestudio cc 48 Connection for 2560 R3...
Page 58: ...keyestudio www keyestudio cc 56 Connection for 2560 R3...
Page 62: ...keyestudio www keyestudio cc 60 Connection for 2560 R3...
Page 65: ...keyestudio www keyestudio cc 63 Circuit connection Connection for R3...
Page 66: ...keyestudio www keyestudio cc 64 Connection for 2560 R3...
Page 69: ...keyestudio www keyestudio cc 67 Pic 2 Project 15 LM35 temperature sensor...
Page 71: ...keyestudio www keyestudio cc 69 Connection for 2560 R3 Sample program...
Page 74: ...keyestudio www keyestudio cc 72 Schematic diagram...
Page 77: ...keyestudio www keyestudio cc 75 Circuit connection Connection for R3...
Page 78: ...keyestudio www keyestudio cc 76 Connection for 2560 R3...
Page 80: ...keyestudio www keyestudio cc 78 Result...
Page 82: ...keyestudio www keyestudio cc 80 Connection for 2560 R3...
Page 85: ...keyestudio www keyestudio cc 83 Schematic diagram Circuit connection Connection for R3...
Page 91: ...keyestudio www keyestudio cc 89 Circuit connection Connection for R3...
Page 92: ...keyestudio www keyestudio cc 90 Connection for 2560 R3...
Page 95: ...keyestudio www keyestudio cc 93...
Page 96: ...keyestudio www keyestudio cc 94...
Page 104: ...keyestudio www keyestudio cc 102 Connection for 2560 R3...
Page 111: ...keyestudio www keyestudio cc 109 Connection for R3 Connection for 2560 R3...
Page 120: ...keyestudio www keyestudio cc 118 Connection for 2560 R3...
Page 124: ...keyestudio www keyestudio cc 122 Connection for R3 Connection for 2560 R3...
Page 135: ...keyestudio www keyestudio cc 133 Connection for R3 Connection for 2560 R3...
Page 139: ...keyestudio www keyestudio cc 137 Circuit connection Connection for uno R3...
Page 140: ...keyestudio www keyestudio cc 138 Connection for 2560 R3...
Page 144: ...keyestudio www keyestudio cc 142 Circuit connection Connection for R3...
Page 145: ...keyestudio www keyestudio cc 143 Connection for 2560 R3...
Page 148: ...keyestudio www keyestudio cc 146 Connection for 2560 R3 Sample program...
Page 155: ...keyestudio www keyestudio cc 153 Circuit connection Connection for R3...
Page 156: ...keyestudio www keyestudio cc 154 Connection for 2560 R3...
Page 160: ...keyestudio www keyestudio cc 158 Connection for 2560 R3...