Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team Pixels Project #4

Merged
merged 1 commit into from Oct 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 60 additions & 0 deletions code.py
@@ -0,0 +1,60 @@
# Write your code here :-)
from adafruit_circuitplayground.express import cpx
from time import sleep
cpx.pixels.brightness=.3
while True:
x,y,z = cpx.acceleration
print((x, y, z))
sleep(.2)

if y <10 and y>7 :
cpx.pixels[3] = (120, 2, 90)
cpx.pixels[4] = (120, 2, 90)
cpx.pixels[5] = (120, 2, 90)
cpx.pixels[6] = (120, 2, 90)
cpx.pixels[1] = (0,0,0)
cpx.pixels[2] = (0,0,0)
cpx.pixels[7] = (0,0,0)
cpx.pixels[8] = (0,0,0)
cpx.pixels[9] = (0,0,0)
cpx.pixels[0] = (0,0,0)

if y < 5 and y>1 :
cpx.pixels[3] = (120, 2, 90)
cpx.pixels[4] = (120, 2, 90)
cpx.pixels[5] = (120, 2, 90)
cpx.pixels[2] = (120, 2, 90)
cpx.pixels[1] = (0,0,0)
cpx.pixels[6] = (0,0,0)
cpx.pixels[7] = (0,0,0)
cpx.pixels[8] = (0,0,0)
cpx.pixels[9] = (0,0,0)
cpx.pixels[0] = (0,0,0)

if y < 0 and y>-2 :

cpx.pixels[3] = (120, 2, 90)
cpx.pixels[4] = (120, 2, 90)
cpx.pixels[2] = (120, 2, 90)
cpx.pixels[1] = (120, 2, 90)
cpx.pixels[5] = (0,0,0)
cpx.pixels[6] = (0,0,0)
cpx.pixels[7] = (0,0,0)
cpx.pixels[8] = (0,0,0)
cpx.pixels[9] = (0,0,0)
cpx.pixels[0] = (0,0,0)
if y < -4 and y>-8 :

cpx.pixels[3] = (120, 2, 90)
cpx.pixels[0] = (120, 2, 90)
cpx.pixels[2] = (120, 2, 90)
cpx.pixels[1] = (120, 2, 90)
cpx.pixels[5] = (0,0,0)
cpx.pixels[6] = (0,0,0)
cpx.pixels[7] = (0,0,0)
cpx.pixels[8] = (0,0,0)
cpx.pixels[9] = (0,0,0)
cpx.pixels[4] =(0,0,0)