Facebook
From ja, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 370
  1. #define wschLED 6  //obrót na wschód
  2. #define zachLED 5  //obrót na zachód
  3.  
  4.  
  5.  
  6. int analogValue1 = 1;
  7. float voltage1 = 1;
  8. int analogValue = 0;
  9. float voltage = 0;
  10.  
  11. void setup()
  12. {
  13.   Serial.begin(9600);
  14.  pinMode(wschLED,OUTPUT);
  15.  pinMode(zachLED,OUTPUT);
  16. }
  17. void loop() {
  18.  
  19.   analogValue = analogRead(3);
  20.   voltage = 0.0048*analogValue;
  21.  
  22.   analogValue1 =analogRead(1);
  23.   voltage1 = 0.0048*analogValue1;
  24.    Serial.print("wschód = ");
  25.    Serial.println(voltage);
  26.     Serial.print("zachód = ");  
  27.    Serial.println(voltage1);
  28.   if  (voltage < (voltage1+ 0,5)&&voltage>(voltage1+0.4))
  29.  
  30.   {
  31.     digitalWrite(zachLED,LOW);
  32.     delay(100);
  33.     digitalWrite(wschLED,LOW);
  34.   }
  35.    else if (voltage <( voltage1+0,6))
  36.   {
  37.     digitalWrite(zachLED,HIGH);
  38.     delay(100);
  39.     digitalWrite(wschLED,LOW);
  40.    
  41.   }
  42.      if ((voltage1>4)&&(voltage>4))
  43.      {
  44.       digitalWrite(zachLED,LOW);
  45.      
  46.       digitalWrite(wschLED,HIGH);
  47.      }
  48.     if ((voltage1>4)&&(voltage<0.5))
  49.    {
  50.     digitalWrite(zachLED,LOW);
  51.     delay(100);
  52.     digitalWrite(wschLED,LOW);
  53.    }
  54.  
  55.   }
  56.    
  57.  
  58.  

Replies to sterownik pv rss

Title Name Language When
Re: sterownik pv ja text 5 Years ago.