本文整理汇总了Python中display.Display.singleChar方法的典型用法代码示例。如果您正苦于以下问题:Python Display.singleChar方法的具体用法?Python Display.singleChar怎么用?Python Display.singleChar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类display.Display
的用法示例。
在下文中一共展示了Display.singleChar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: NuimoTimer
# 需要导入模块: from display import Display [as 别名]
# 或者: from display.Display import singleChar [as 别名]
class NuimoTimer(Nuimo):
def __init__(self, macAddress):
Nuimo.__init__(self, macAddress)
self.display = Display()
self.font = ValidFonts()
self.timerValue = 0
def fly(self, flyValue):
print(flyValue)
def swipe(self, swipeValue):
print(swipeValue)
# Left
if swipeValue == 0:
#self.timer.Start()
self.displayLedMatrix(self.display.singleChar("2", "clb8x8"), 1.0)
# Right
elif swipeValue == 1:
self.displayLedMatrix(self.display.singleChar("1", "clb8x8"), 1.0)
# Up
elif swipeValue == 2:
self.displayLedMatrix(self.display.icon("start"), 1.0)
# Pause Timer
elif swipeValue == 3:
#self.timer.Pause()
self.displayLedMatrix(self.display.icon("pause"), 1.0)
else:
pass
def rotate(self, rotateValue):
print(int(rotateValue))
if rotateValue < 0:
if self.timerValue <= 0:
self.timerValue = 0
else:
self.timerValue = self.timerValue-1
else:
self.timerValue = self.timerValue + 1
self.displayTimer()
def displayTimer(self):
if self.timerValue <= 9:
self.displayLedMatrix(self.display.singleChar(str(self.timerValue),"clb8x8"),0.5)
else:
self.displayLedMatrix(self.display.icon(str(self.timerValue)),0.5)
def button(self, buttonValue):
if buttonValue == 0:
#self.selfTestFont()
self.displayLedMatrix(self.display.icon("88"), 1.0)
def selfTestFont(self):
chars = ["99","88","1","2","3","4","5","6","7","8","9","0","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for x in range(0, len(chars)):
self.displayLedMatrix(self.display.singleChar(chars[x], "clb8x8"), 0.5)
print(chars[x])
time.sleep(0.75)
def getNuimoBatteryLevel(self):
pass