Advertisement
ossipee

DFR moisture code sample

May 26th, 2014
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. /*
  2.  
  3.   # Example code for the moisture sensor
  4.  
  5.   # Editor     : Lauren
  6.  
  7.   # Date       : 13.01.2012
  8.  
  9.   # Version    : 1.0
  10.  
  11.   # Connect the sensor to the A0(Analog 0) pin on the Arduino board
  12.  
  13.  
  14.  
  15.   # the sensor value description
  16.  
  17.   # 0  ~300     dry soil
  18.  
  19.   # 300~700     humid soil
  20.  
  21.   # 700~950     in water
  22.  
  23. */
  24.  
  25.  
  26.  
  27. void setup(){
  28.  
  29.  
  30.  
  31.   Serial.begin(57600);
  32.  
  33.  
  34.  
  35. }
  36.  
  37.  
  38.  
  39. void loop(){
  40.  
  41.  
  42.  
  43.   Serial.print("Moisture Sensor Value:");
  44.  
  45.   Serial.println(analogRead(0));  
  46.  
  47.   delay(100);
  48.  
  49.  
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement