当前位置: 首页>>代码示例>>Python>>正文


Python ADC0832.setup方法代码示例

本文整理汇总了Python中ADC0832.setup方法的典型用法代码示例。如果您正苦于以下问题:Python ADC0832.setup方法的具体用法?Python ADC0832.setup怎么用?Python ADC0832.setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ADC0832的用法示例。


在下文中一共展示了ADC0832.setup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def setup():
	ADC0832.setup()				# Setup ADC0832
	GPIO.setmode(GPIO.BOARD)	# Numbers GPIOs by physical location
	GPIO.setup(btn, GPIO.IN, pull_up_down=GPIO.PUD_UP)	# Setup button pin as input an pull it up
	GPIO.add_event_detect(btn, GPIO.FALLING, callback=button_pressed, bouncetime=100)
	global state
	state = ['up', 'down', 'left', 'right']	
开发者ID:DarrenGansberg,项目名称:Adeept_RFID_Learning_Kit_Python_Code_for_RPi,代码行数:9,代码来源:25_joystick.py

示例2: readPhotoSens

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def readPhotoSens(chn=0):
  print "Reading light from channel: %d" % chn
  ADC0832.setup()
  photores = ADC0832.getResult(chn) - 80
  if photores < 0:
    photores = 0
  if photores > 100:
    photores = 100
  print 'Relative light = %d' % photores
  time.sleep(0.2)
开发者ID:froggleston,项目名称:scripts,代码行数:12,代码来源:led_dht_test.py

示例3: setup

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def setup():
	GPIO.setmode(GPIO.BOARD)
	# Buzzer setup:
	GPIO.setup(Buzzer, GPIO.OUT)
	GPIO.output(Buzzer, 1)
	# RGB setup:
	GPIO.setup(LedRed, GPIO.OUT)
	GPIO.setup(LedGreen, GPIO.OUT)
	GPIO.setup(LedBlue, GPIO.OUT)
	GPIO.output(LedRed, 1)
	GPIO.output(LedGreen, 1)
	GPIO.output(LedBlue, 1)
	# DS18B20 setup:
	ds18b20Init()
	# Joystick setup:
	GPIO.setup(btn, GPIO.IN)
	GPIO.add_event_detect(btn, GPIO.FALLING, callback=joystickbtn, bouncetime=200)
	# ADC0832 setup:
	ADC0832.setup()
开发者ID:DigiTempReader,项目名称:Sunfounder_SensorKit_Python_code_for_RaspberryPi,代码行数:21,代码来源:30_expand02.py

示例4: init

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def init():
	ADC0832.setup()
开发者ID:adeept,项目名称:Adeept_Sensor_Kit_for_RPi_Python_Code,代码行数:4,代码来源:31_soilMoisture.py

示例5: setup

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def setup():
	ADC.setup()
开发者ID:stevenvo,项目名称:rpi-gpio-scripts,代码行数:4,代码来源:10_thermistor.py

示例6: destory

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
screen = i2c_lcd1602.Screen(bus=1, addr=0x27, cols=16, rows=2)

def destory():
	GPIO.cleanup()

def loop():
	while True:
		screen.cursorTo(0, 0)
		screen.println(line)
		t = ADC0832.getResult()
		vol = 5.0/255 * t
		vol = round(vol, 2)
		vol = '%f' %vol
		vol = vol[:4]
		screen.cursorTo(1, 0)
		screen.println(' Voltage: ' + vol + 'V ')
		screen.clear()
		time.sleep(0.2)      

if __name__ == '__main__':
	print 'www.adeept.com'
	line = " www.adeept.com "
	screen.enable_backlight()
	screen.clear()
	try:
		ADC0832.setup()
		loop()
	except KeyboardInterrupt:
		destory()
开发者ID:adeept,项目名称:Adeept_Sensor_Kit_for_RPi_Python_Code,代码行数:31,代码来源:main.py

示例7: setup

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def setup():
	ADC.setup()
	GPIO.setup(Beep, GPIO.OUT)
开发者ID:stevenvo,项目名称:rpi-gpio-scripts,代码行数:5,代码来源:14_tempMonitor.py

示例8: ADC0832Init

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def ADC0832Init():
	ADC0832.setup()
开发者ID:DarrenGansberg,项目名称:Adeept_RFID_Learning_Kit_Python_Code_for_RPi,代码行数:4,代码来源:ledBar.py

示例9: adcInit

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def adcInit():
	ADC0832.setup()
开发者ID:alexmihaila64,项目名称:Sunfounder_BaseKit_Python_Code_for_RaspberryPi,代码行数:4,代码来源:13_tempMonitor.py

示例10: setup

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def setup():
	global p
	ADC.setup()
	GPIO.setup(LED, GPIO.OUT)
	p = GPIO.PWM(LED, 2000)
	p.start(100)
开发者ID:stevenvo,项目名称:rpi-gpio-scripts,代码行数:8,代码来源:13_illumCtrl.py

示例11: len

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
            cl.append(self)
            print len(cl)
            
    def on_message(self, message):
        for c in cl:
            # c.write_message(u"" + message)
            if c != self:
                c.write_message(u"" + message)
        
    def on_close(self):
        if self in cl:
            cl.remove(self)

app = tornado.web.Application([
    # (r'/', IndexHandler),
    (r'/ws', SocketHandler),
    (r'/voice', EchoSocketHandler),
    # (r'/api', ApiHandler),
    # (r'/(favicon.ico)', web.StaticFileHandler, {'path': '../'}),
    # (r'/(rest_api_example.png)', web.StaticFileHandler, {'path': './'}),
], autoreload=True)

if __name__ == '__main__':
    ADC.setup()
    server = tornado.httpserver.HTTPServer(app, ssl_options = {
        "certfile": "/etc/nginx/ssl/nginx.crt",
        "keyfile": "/etc/nginx/ssl/nginx.key",
    })
    server.listen(options.port)
    tornado.ioloop.IOLoop.instance().start()
开发者ID:scareface972,项目名称:smart-mirror-1,代码行数:32,代码来源:app.py

示例12: init

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def init():
	GPIO.setmode(GPIO.BOARD)	
	GPIO.setup(FlamePin_S, GPIO.IN, pull_up_down=GPIO.PUD_UP)
	GPIO.add_event_detect(FlamePin_S, GPIO.FALLING, callback=myISR)
	ADC0832.setup()
开发者ID:adeept,项目名称:Adeept_Sensor_Kit_for_RPi_Python_Code,代码行数:7,代码来源:17_flame.py

示例13: setup

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def setup():
	GPIO.setmode(GPIO.BOARD)		# Numbers GPIOs by physical location
	GPIO.setup(BEEP, GPIO.OUT)		# Set pins' mode is output
	ADC0832.setup()					# Setup ADC0832
开发者ID:DigiTempReader,项目名称:Sunfounder_SensorKit_Python_code_for_RaspberryPi,代码行数:6,代码来源:mq-2.py

示例14: setup

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def setup():
	segment.TM1638_init()
	ADC0832.setup()
开发者ID:adeept,项目名称:Adeept_Sensor_Kit_for_RPi_Python_Code,代码行数:5,代码来源:main.py

示例15: init

# 需要导入模块: import ADC0832 [as 别名]
# 或者: from ADC0832 import setup [as 别名]
def init():
	GPIO.setmode(GPIO.BOARD)	
	GPIO.setup(MIC_DO_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
	ADC0832.setup()
开发者ID:DigiTempReader,项目名称:Sunfounder_SensorKit_Python_code_for_RaspberryPi,代码行数:6,代码来源:24_microphone.py


注:本文中的ADC0832.setup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。