4-labaratoriya ishi
Guruh: EBS002_L2
Bajardi: Muhiddinov Ziyodulla
Tekshirdi: Arabboev Muxriddin
ISHNING MAQSADI: Potensiometr. Arduino orqali yorug‘lik diodini yorug‘lik darajasini o‘zgartirishini namoyish etishni loyihalash.
9-variant
Led_PIN=6; Potensiometr pin=A2;
int LED_PIN=6;
void setup()
{ Serial.begin(9600);
pinMode(LED_PIN,OUTPUT); }
void loop()
{ int analogValue=analogRead(A2);
int brightness=map(analogValue,0,1023,0,254);
analogWrite(LED_PIN,brightness);
Serial.print("Analog");
Serial.print(analogValue);
Serial.print("Brightness:)");
Serial.println(brightness); delay(100);}
Do'stlaringiz bilan baham: |