本文整理汇总了Python中PiStorms.PiStorms.isF3Pressed方法的典型用法代码示例。如果您正苦于以下问题:Python PiStorms.isF3Pressed方法的具体用法?Python PiStorms.isF3Pressed怎么用?Python PiStorms.isF3Pressed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PiStorms.PiStorms
的用法示例。
在下文中一共展示了PiStorms.isF3Pressed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PiStorms
# 需要导入模块: from PiStorms import PiStorms [as 别名]
# 或者: from PiStorms.PiStorms import isF3Pressed [as 别名]
#mindsensors.com invests time and resources providing this open source code,
#please support mindsensors.com by purchasing products from mindsensors.com!
#Learn more product option visit us @ http://www.mindsensors.com/
import os,sys,inspect,time,thread,random
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
from PiStorms import PiStorms
psm = PiStorms()
color = (255, 255, 255)
while True:
if psm.isKeyPressed():
break
if psm.isF1Pressed():
color = (255, 0, 0)
if psm.isF2Pressed():
color = (255, 255, 0)
if psm.isF3Pressed():
color = (0, 255, 0)
if psm.isF4Pressed():
color = (0, 0, 255)
if psm.screen.isTouched():
x = psm.screen.TS_To_ImageCoords_X(psm.screen.x, psm.screen.y)
y = psm.screen.TS_To_ImageCoords_Y(psm.screen.x, psm.screen.y)
psm.screen.fillRect(x-1, y-1, 2, 2, fill=color)