Animated Trash

The idea of this project was to bring inanimate objects to life an give them a meaning that most people don’t associate them with, such as trash being involved in an ecosystem. this instructable will show you how to attach one piece of recyclable.

Materials:

  • Double male-ended wires (3 per neopixel strip)
  • Neopixel strips
  • Adafruit Circuit Playground
  • Cricket board
  • Some sort of trash or recyclable, preferably a kind of bottle or jug
  • Tape and Glue

Step 1:

  • using a paper clip or sewing needle(something of this size) punch two holes into the copper film of the neo pixel strip
  • then put one end of the male ended wire into each allotted hole
  • apply glue or tape for a stronger hold

Step 2:

  • once the wires are secured to the neopixel strip insert the other ends into the cricket boards neopixel port (make sure voltage goes to positive, ground to negative, and data to middle port)

Step 3:

  • take neopixel strip and attach to recyclable using either electrical tape or hot glue

Step 4:

  • now that the project is assembled all that is left to do is to upload the code
  • I used adafruits makecode programing
input.onLightConditionChanged(LightCondition.Bright, function () {
clock = 0
light.stopAllAnimations()
// light.showRing( “black black black black black
// black black black black black“ )
light.clear()
light.setBrightness(150)
strip.setBrightness(150)
music.magicWand.play()
strip.showAnimation(light.sparkleAnimation, 4000)
light.showAnimation(light.sparkleAnimation,4000)
clock = 1
})
input.onLoudSound(function () {
clock = 0
music.pewPew.play()
for(let counter22 =0; counter22 <=150; counter22++){
light.setAll(0xffffff)
strip.setAll(0xffffff)
light.setBrightness(150- counter22)
strip.setBrightness(150 – counter22)
}
for(let counter =0; counter <=10; counter++){
light.setBrightness(counter)
strip.setBrightness(counter)
light.setAll(0xffffff)
strip.setAll(0xffffff)
pause(10)
}
pause(5000)
clock = 1
})
let strip: light.NeoPixelStrip = null
let clock = 0
light.setBrightness(0)
music.setVolume(43)
clock = 1
let Photon_Color = 158
input.setLightThreshold(LightCondition.Bright, 15)
strip = light.createStrip(pins.A1, 10)
music.playMelody(“- – – – – A D G “, 500)
forever(function () {
if(clock >=1){
while(input.soundLevel()>110&& clock >=1){
light.showRing(
`white white white white white white white white white white`
)
pause(100)
}
for(let counter =0; counter <=150; counter++){
light.setBrightness(counter)
strip.setBrightness(counter)
light.setAll(0xffff00)
strip.setAll(0xffff00)
pause(10)
}
while(input.soundLevel()<110&& clock >=1){
light.setBrightness(150)
strip.setBrightness(150)
for(let i =0; i <light.onboardStrip().length(); i++){
Photon_Color = Photon_Color + 2
light.setPhotonPenHue(Photon_Color)
light.setPhotonMode(PhotonMode.PenDown)
light.photonForward(1)
pause(50)
}
for(let i =0; i < strip.length(); i++){
Photon_Color = Photon_Color + 2
strip.setPhotonPenHue(Photon_Color)
strip.setPhotonMode(PhotonMode.PenDown)
strip.photonForward(1)
pause(50)
}
for(let i =0; i <light.onboardStrip().length(); i++){
Photon_Color = Photon_Color + 2
light.setPhotonPenHue(Photon_Color)
light.photonForward(-1)
// light.photonForward(-1)
pause(50)
}
for(let i =0; i < strip.length(); i++){
Photon_Color = Photon_Color + 2
strip.setPhotonPenHue(Photon_Color)
strip.photonForward(-1)
// light.photonForward(-1)
pause(50)
}
}
}
})