lines too long, trailing whitespace
This commit is contained in:
parent
e39fb888d1
commit
345c281c06
1 changed files with 14 additions and 12 deletions
|
|
@ -26,21 +26,23 @@ def hex2rgb(hex_code):
|
|||
return rgb
|
||||
|
||||
# This array contains digitized data for a heartbeat wave scaled to between 0 and 1.0
|
||||
# It is used to create the "beat" mode
|
||||
# It is used to create the "beat" mode. Ensure each line is <78 characters for Travis-CI
|
||||
beatArray = [0.090909091,0.097902098,0.104895105,0.118881119,0.132867133,0.146853147,
|
||||
0.153846154,0.160839161,0.181818182,0.181818182,0.195804196,0.181818182,0.188811189,
|
||||
0.188811189,0.181818182,0.174825175,0.174825175,0.160839161,0.167832168,0.160839161,0.167832168,
|
||||
0.167832168,0.167832168,0.160839161,0.146853147,0.146853147,0.153846154,0.160839161,0.146853147,
|
||||
0.153846154,0.13986014,0.153846154,0.132867133,0.146853147,0.13986014,0.13986014,0.146853147,
|
||||
0.146853147,0.146853147,0.146853147,0.160839161,0.146853147,0.160839161,0.167832168,0.181818182,
|
||||
0.202797203,0.216783217,0.20979021,0.202797203,0.195804196,0.195804196,0.216783217,0.160839161,
|
||||
0.13986014,0.13986014,0.13986014,0.118881119,0.118881119,0.111888112,0.132867133,0.111888112,
|
||||
0.132867133,0.104895105,0.083916084,0.020979021,0,0.230769231,0.636363636,1,0.846153846,
|
||||
0.188811189,0.181818182,0.174825175,0.174825175,0.160839161,0.167832168,0.160839161,
|
||||
0.167832168,0.167832168,0.167832168,0.160839161,0.146853147,0.146853147,0.153846154,
|
||||
0.160839161,0.146853147,0.153846154,0.13986014,0.153846154,0.132867133,0.146853147,
|
||||
0.13986014,0.13986014,0.146853147,0.146853147,0.146853147,0.146853147,0.160839161,
|
||||
0.146853147,0.160839161,0.167832168,0.181818182,0.202797203,0.216783217,0.20979021,
|
||||
0.202797203,0.195804196,0.195804196,0.216783217,0.160839161,0.13986014,0.13986014,
|
||||
0.13986014,0.118881119,0.118881119,0.111888112,0.132867133,0.111888112,0.132867133,
|
||||
0.104895105,0.083916084,0.020979021,0,0.230769231,0.636363636,1,0.846153846,
|
||||
0.27972028,0.048951049,0.055944056,0.083916084,0.090909091,0.083916084,0.083916084,
|
||||
0.076923077,0.076923077,0.076923077,0.090909091,0.06993007,0.083916084,0.076923077,
|
||||
0.076923077,0.06993007,0.076923077,0.083916084,0.083916084,0.083916084,0.076923077,
|
||||
0.090909091,0.076923077,0.083916084,0.06993007,0.076923077,0.062937063,0.06993007,
|
||||
0.062937063,0.055944056,0.055944056,0.048951049,0.041958042,0.034965035,0.041958042,0.027972028]
|
||||
0.062937063,0.055944056,0.055944056,0.048951049,0.041958042,0.034965035,0.041958042,
|
||||
0.027972028]
|
||||
|
||||
# When we start up, make the LED black
|
||||
black = (0, 0, 0)
|
||||
|
|
@ -133,7 +135,7 @@ while True:
|
|||
if mode == "wheel":
|
||||
mode="solid"
|
||||
else:
|
||||
# If no text availble, update the color according to the mode
|
||||
# If no text available, update the color according to the mode
|
||||
if mode == 'blink':
|
||||
if curColor == black:
|
||||
curColor = targetColor
|
||||
|
|
@ -153,8 +155,8 @@ while True:
|
|||
pixels.show()
|
||||
elif mode == 'beat':
|
||||
pos = (pos + 5 ) % 106
|
||||
scaleAvg = (beatArray[(pos-2)%106] + beatArray[(pos-1)%106] + beatArray[pos] + beatArray[(pos+1)%106] +
|
||||
beatArray[(pos+2)%106])/5
|
||||
scaleAvg = (beatArray[(pos-2)%106] + beatArray[(pos-1)%106] + beatArray[pos] +
|
||||
beatArray[(pos+1)%106] + beatArray[(pos+2)%106])/5
|
||||
beatColor = tuple(int(scaleAvg*x) for x in targetColor)
|
||||
pixels.fill(beatColor)
|
||||
sleep(.025)
|
||||
|
|
|
|||
Loading…
Reference in a new issue