Skip to content

Commit

Permalink
Merge pull request #1917 from kattni/lime-update
Browse files Browse the repository at this point in the history
Lime update
  • Loading branch information
TheKitty authored Nov 10, 2021
2 parents dcd5ce3 + f59de93 commit c32ccda
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 54 deletions.
5 changes: 3 additions & 2 deletions Piano_In_The_Key_Of_Lime/NeoPixel0/code.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from adafruit_circuitplayground.express import cpx
from adafruit_circuitplayground import cp

cpx.pixels[0] = ((0, 0, 3))
while True:
cp.pixels[0] = (0, 0, 3)
5 changes: 3 additions & 2 deletions Piano_In_The_Key_Of_Lime/NeoPixelAll/code.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from adafruit_circuitplayground.express import cpx
from adafruit_circuitplayground import cp

cpx.pixels.fill((0, 0, 3))
while True:
cp.pixels.fill((0, 0, 3))
60 changes: 30 additions & 30 deletions Piano_In_The_Key_Of_Lime/PianoInTheKeyOfLime/code.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
from adafruit_circuitplayground.express import cpx
from adafruit_circuitplayground import cp

while True:
if cpx.switch:
if cp.switch:
print("Slide switch off!")
cpx.pixels.fill((0, 0, 0))
cpx.stop_tone()
cp.pixels.fill((0, 0, 0))
cp.stop_tone()
continue
if cpx.touch_A4:
if cp.touch_A4:
print('Touched A4!')
cpx.pixels.fill((15, 0, 0))
cpx.start_tone(262)
elif cpx.touch_A5:
cp.pixels.fill((15, 0, 0))
cp.start_tone(262)
elif cp.touch_A5:
print('Touched A5!')
cpx.pixels.fill((15, 5, 0))
cpx.start_tone(294)
elif cpx.touch_A6:
cp.pixels.fill((15, 5, 0))
cp.start_tone(294)
elif cp.touch_A6:
print('Touched A6!')
cpx.pixels.fill((15, 15, 0))
cpx.start_tone(330)
elif cpx.touch_A7:
cp.pixels.fill((15, 15, 0))
cp.start_tone(330)
elif cp.touch_A7:
print('Touched A7!')
cpx.pixels.fill((0, 15, 0))
cpx.start_tone(349)
elif cpx.touch_A1:
cp.pixels.fill((0, 15, 0))
cp.start_tone(349)
elif cp.touch_A1:
print('Touched A1!')
cpx.pixels.fill((0, 15, 15))
cpx.start_tone(392)
elif cpx.touch_A2 and not cpx.touch_A3:
cp.pixels.fill((0, 15, 15))
cp.start_tone(392)
elif cp.touch_A2 and not cp.touch_A3:
print('Touched A2!')
cpx.pixels.fill((0, 0, 15))
cpx.start_tone(440)
elif cpx.touch_A3 and not cpx.touch_A2:
cp.pixels.fill((0, 0, 15))
cp.start_tone(440)
elif cp.touch_A3 and not cp.touch_A2:
print('Touched A3!')
cpx.pixels.fill((5, 0, 15))
cpx.start_tone(494)
elif cpx.touch_A2 and cpx.touch_A3:
cp.pixels.fill((5, 0, 15))
cp.start_tone(494)
elif cp.touch_A2 and cp.touch_A3:
print('Touched "8"!')
cpx.pixels.fill((15, 0, 15))
cpx.start_tone(523)
cp.pixels.fill((15, 0, 15))
cp.start_tone(523)
else:
cpx.pixels.fill((0, 0, 0))
cpx.stop_tone()
cp.pixels.fill((0, 0, 0))
cp.stop_tone()
4 changes: 2 additions & 2 deletions Piano_In_The_Key_Of_Lime/SingleTone/code.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from adafruit_circuitplayground.express import cpx
from adafruit_circuitplayground import cp

cpx.play_tone(440, 1)
cp.play_tone(440, 1)
4 changes: 2 additions & 2 deletions Piano_In_The_Key_Of_Lime/SlideSwitch/code.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from adafruit_circuitplayground.express import cpx
from adafruit_circuitplayground import cp

while True:
if cpx.switch:
if cp.switch:
print("Slide switch off!")
else:
print("Slide switch on!")
12 changes: 6 additions & 6 deletions Piano_In_The_Key_Of_Lime/StartStopTone/code.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from adafruit_circuitplayground.express import cpx
from adafruit_circuitplayground import cp

while True:
if cpx.touch_A1:
cpx.start_tone(262)
elif cpx.touch_A2:
cpx.start_tone(294)
if cp.touch_A1:
cp.start_tone(262)
elif cp.touch_A2:
cp.start_tone(294)
else:
cpx.stop_tone()
cp.stop_tone()
4 changes: 2 additions & 2 deletions Piano_In_The_Key_Of_Lime/TouchA1/code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from adafruit_circuitplayground.express import cpx
from adafruit_circuitplayground import cp

while True:
if cpx.touch_A1:
if cp.touch_A1:
print('Touched 1!')
16 changes: 8 additions & 8 deletions Piano_In_The_Key_Of_Lime/TouchAll/code.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from adafruit_circuitplayground.express import cpx
from adafruit_circuitplayground import cp

while True:
if cpx.touch_A1:
if cp.touch_A1:
print('Touched 1!')
elif cpx.touch_A2:
elif cp.touch_A2:
print('Touched 2!')
elif cpx.touch_A3:
elif cp.touch_A3:
print('Touched 3!')
elif cpx.touch_A4:
elif cp.touch_A4:
print('Touched 4!')
elif cpx.touch_A5:
elif cp.touch_A5:
print('Touched 5!')
elif cpx.touch_A6:
elif cp.touch_A6:
print('Touched 6!')
elif cpx.touch_A7:
elif cp.touch_A7:
print('Touched 7!')

0 comments on commit c32ccda

Please sign in to comment.