old_contents: #soil moisture sensor.
  #VCC 
  #GND
  #DO <--> GPIO(Y12)  Digital data
  #AO <--> ADC Port(Y11) Analog data
  #if value is low than defined data, DO value is 0, 
  #if value is high than defined data, DO value is 1.
  #AO is the specific value.
  from pyb import Pin
  p_in = Pin('Y12', Pin.IN, Pin.PULL_UP)
  p_in.value
  
  
  adc = pyb.ADC(Pin('Y11'))       # create an analog object from a pin
  adc = pyb.ADC(pyb.Pin.board.Y11)
  # read an analog value
  def getMoisAo:
    Ao = adc.read()                
    print('moisture Ao:')
    print(Ao)
    return Ao
  
  # read an digital value
  def getMoisDo:
    Do = p_in.value             
    print('moisture Do:')
    print(Do)
    return Do
  
new_contents: #soil moisture sensor.
  #VCC 
  #GND
  #DO <--> GPIO(Y12)  Digital data
  #AO <--> ADC Port(Y11) Analog data
  #if value is low than defined data, DO value is 0, 
  #if value is high than defined data, DO value is 1.
  #AO is the specific value.
  import pyb
  from pyb import Pin
  p_in = Pin('Y12', Pin.IN, Pin.PULL_UP)
  p_in.value
  
  
  adc = pyb.ADC(Pin('Y11'))       # create an analog object from a pin
  adc = pyb.ADC(pyb.Pin.board.Y11)
  # read an analog value
  def getMoisAo():               
    print('moisture Ao')
    return adc.read()
  
  # read an digital value
  def getMoisDo():             
    print('moisture Do')
    return p_in.value
  
subject: Update moisture.py