SHARE
TWEET

Föld nedvességtartalom mérése Arduinoval

Zoff76 Jan 24th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  int nedv;
  2.  int nyers;
  3.  
  4. void setup() {
  5.  
  6.  pinMode(A0, INPUT);
  7.  Serial.begin(9600);
  8. }
  9.  
  10. void loop() {
  11.  
  12.  nyers=analogRead(A0); //magasabb érték = alacsonyabb nedvességtartalom
  13.  Serial.print("nyers adat: ");
  14.  Serial.println(nyers);
  15.  nedv = map (nyers, 1023, 200, 0, 100); // átalakítás százalékba
  16.  Serial.print("nedvesseg: ");
  17.  Serial.print(nedv);
  18.  Serial.println("%");
  19.  Serial.println(" ");
  20.  delay (60000);
  21.  
  22. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top