コード例 #1
0
ファイル: Neo_new.py プロジェクト: monicabaluna/willyfog
    def __init__(self):
        self.temp = 0000
        self.Tempscale = 0000
        self.pressure = 0000
        self.Tempress = 000
        self.coms = Command()

        try:
            self.coms.run("rmmod mpl3115")
        finally:
            pass
        try:
            self.coms.run("modprobe mpl3115")
        finally:
            pass
        base = "/sys/class/i2c-dev/i2c-1/device/1-0060/iio:device0/"
        self.mm_temp = MemoryMap(base + "in_temp_raw", "r")
        self.mm_scale = MemoryMap(base + "in_temp_scale", "r")
        self.mm_pressure = MemoryMap(base + "in_pressure_raw", "r")
        self.mm_pressure_scale = MemoryMap(base + "in_pressure_scale", "r")
コード例 #2
0
ファイル: Neo_new.py プロジェクト: monicabaluna/willyfog
 def __init__(self):  # Start temp module on object call
     self.temp = 0000
     self.coms = Command()
     try:
         self.coms.run("rmmod lm75")
     finally:
         pass
     try:
         self.coms.run("modprobe lm75")
     finally:
         pass
     try:
         self.coms.run(
             "sh -c 'echo lm75 0x48 >/sys/class/i2c-dev/i2c-1/device/new_device' 2&>1"
         )
         # easier to run command to black hole using system
     finally:
         pass
     self.mm_temp = MemoryMap(
         "/sys/class/i2c-dev/i2c-1/device/1-0048/temp1_input", "r")