コード例 #1
0
ファイル: Ampli.py プロジェクト: thibaut-fagart/domotique
#bus1.setPortDirection(0, 0x00)
#bus1.setPortDirection(1, 0x00)
#bus2.setPortDirection(0, 0x00)
#bus2.setPortDirection(1, 0x00)


def AmpliOn():
    bus1.writePin(pinCuisine, 1)
    time.sleep(1)
    bus1.writePin(pinChambre, 1)
    time.sleep(1)
    bus1.writePin(pinSdb, 1)

def AmpliOff():
    bus1.writePin(pinCuisine, 0)
    time.sleep(1)
    bus1.writePin(pinChambre, 0)
    time.sleep(1)
    bus1.writePin(pinSdb, 0)

if __name__ == "__main__":
  if (bus1.readPin(pinCuisine) or bus1.readPin(pinCuisine) or bus1.readPin(pinCuisine)):
    AmpliOff()
    print "Ampli set to Off"
  else:
    AmpliOn()
    print "Ampli set to On"
   
  time.sleep(0.5)