daily pastebin goal
14%
SHARE
TWEET

Potméteres LEDvillogtatás Arduinoval

Zoff76 Jan 24th, 2018 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // potméters led villogtatás
  2.  
  3. int led = 13;
  4. int potpin = A0;
  5. int pot = 0;
  6.  
  7. void setup() {
  8.   // put your setup code here, to run once:
  9.  
  10.   pinMode (led, OUTPUT);
  11.   Serial.begin(9600);
  12.  
  13. }
  14.  
  15. void loop() {
  16.   // put your main code here, to run repeatedly:
  17.  
  18.   pot = analogRead(potpin);
  19.  
  20.   Serial.println(pot);
  21.   digitalWrite (led, HIGH);
  22.   delay (pot);
  23.  
  24.   digitalWrite (led, LOW);
  25.   delay (pot); //a poti adja a villogások közti időt
  26.  
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top