本文整理汇总了Python中Data.getSensors方法的典型用法代码示例。如果您正苦于以下问题:Python Data.getSensors方法的具体用法?Python Data.getSensors怎么用?Python Data.getSensors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data.getSensors方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Data
# 需要导入模块: import Data [as 别名]
# 或者: from Data import getSensors [as 别名]
# main.py
from pygame import *
from Data import *
import RPi.GPIO as GPIO
import os
library = Data()
# Setup dunny display to run Raspberry Pi headless
os.environ["SDL_VIDEODRIVER"] = "dummy"
display.set_mode((1, 1))
# Setup main loop controls
running = True
clock = time.Clock()
while running:
for e in event.get():
"Keep event loop going"
axes = library.getSensors().getJoyAxes()
library.getControls().changeAltitude(axes)
clock.tick(60)
quit()
示例2: Data
# 需要导入模块: import Data [as 别名]
# 或者: from Data import getSensors [as 别名]
import sys
import time
import os
import RPi.GPIO as GPIO
from pygame import *
from Data import *
# setup classes
library = Data()
controls = library.getControls()
sensors = library.getSensors()
brains = library.getAI()
running = True
while running:
for e in event.get():
if e.type == QUIT:
running = False
controls.flashLed(controls.getRedPWM(), controls.getGreenPWM())
controls.move(sensors.getAxis())
quit()