keyestudio
www.keyestudio.cc
50
for(val=255; val>0; val--)
{
analogWrite(11, val);
analogWrite(10, 255-val);
analogWrite(9, 128-val);
delay(1);
}
for(val=0; val<255; val++)
{
analogWrite(11, val);
analogWrite(10, 255-val);
analogWrite(9, 128-val);
delay(1);
}
Serial.println(val, DEC);
}
//////////////////////////////////////////////////////////
Result
Directly copy the above code into arduino IDE, and click upload
, wait a few seconds, you
can see a full-color LED
*******************************************************************************
Project 11: Analog value reading
Introduction
In this experiment, we will begin the learning of analog I/O interfaces. On an Arduino, there are 6
analog interfaces numbered from 0 to 5. These 6 interfaces can also be used as digital ones
numbered as 14-19. After a brief introduction, let's begin our project. Potentiometer used here is a
typical output component of analog value that is familiar to us.
Hardware required
Potentiometer *1
Breadboard*1
Breadboard jumper wires * several
Circuit connection
In this experiment, we will convert the resistance value of the potentiometer to analog ones and
display it on the screen. This is an application we need to master well for our future experiments.
Содержание ARDUINO maker learning kit
Страница 1: ...keyestudio www keyestudio cc ARDUINO maker learning kit...
Страница 23: ...keyestudio www keyestudio cc 21 Connection for 2560 R3...
Страница 30: ...keyestudio www keyestudio cc 28 Connection for 2560 R3...
Страница 39: ...keyestudio www keyestudio cc 37 Connection for 2560 R3...
Страница 43: ...keyestudio www keyestudio cc 41 Connection for 2560 R3...
Страница 46: ...keyestudio www keyestudio cc 44 Connection for 2560 R3...
Страница 50: ...keyestudio www keyestudio cc 48 Connection for 2560 R3...
Страница 53: ...keyestudio www keyestudio cc 51 Connection circuit as below Connection for R3 Connection for 2560 R3...
Страница 58: ...keyestudio www keyestudio cc 56 Connection for 2560 R3...
Страница 62: ...keyestudio www keyestudio cc 60 Connection for 2560 R3...
Страница 65: ...keyestudio www keyestudio cc 63 Circuit connection Connection for R3...
Страница 66: ...keyestudio www keyestudio cc 64 Connection for 2560 R3...
Страница 69: ...keyestudio www keyestudio cc 67 Pic 2 Project 15 LM35 temperature sensor...
Страница 71: ...keyestudio www keyestudio cc 69 Connection for 2560 R3 Sample program...
Страница 74: ...keyestudio www keyestudio cc 72 Schematic diagram...
Страница 77: ...keyestudio www keyestudio cc 75 Circuit connection Connection for R3...
Страница 78: ...keyestudio www keyestudio cc 76 Connection for 2560 R3...
Страница 80: ...keyestudio www keyestudio cc 78 Result...
Страница 82: ...keyestudio www keyestudio cc 80 Connection for 2560 R3...
Страница 85: ...keyestudio www keyestudio cc 83 Schematic diagram Circuit connection Connection for R3...
Страница 91: ...keyestudio www keyestudio cc 89 Circuit connection Connection for R3...
Страница 92: ...keyestudio www keyestudio cc 90 Connection for 2560 R3...
Страница 95: ...keyestudio www keyestudio cc 93...
Страница 96: ...keyestudio www keyestudio cc 94...
Страница 104: ...keyestudio www keyestudio cc 102 Connection for 2560 R3...
Страница 111: ...keyestudio www keyestudio cc 109 Connection for R3 Connection for 2560 R3...
Страница 120: ...keyestudio www keyestudio cc 118 Connection for 2560 R3...
Страница 124: ...keyestudio www keyestudio cc 122 Connection for R3 Connection for 2560 R3...
Страница 135: ...keyestudio www keyestudio cc 133 Connection for R3 Connection for 2560 R3...
Страница 139: ...keyestudio www keyestudio cc 137 Circuit connection Connection for uno R3...
Страница 140: ...keyestudio www keyestudio cc 138 Connection for 2560 R3...
Страница 144: ...keyestudio www keyestudio cc 142 Circuit connection Connection for R3...
Страница 145: ...keyestudio www keyestudio cc 143 Connection for 2560 R3...
Страница 148: ...keyestudio www keyestudio cc 146 Connection for 2560 R3 Sample program...
Страница 155: ...keyestudio www keyestudio cc 153 Circuit connection Connection for R3...
Страница 156: ...keyestudio www keyestudio cc 154 Connection for 2560 R3...
Страница 160: ...keyestudio www keyestudio cc 158 Connection for 2560 R3...