Hey guys,
I've been following your build guide for the space x helmet - https://learn.adafruit.com/spacex-helmet/assemble
Its awesome and everything seems to be working, however the link to the suggested makecode code doesnt load...
Is it possible to refresh the link so I can see the code you used?
Many thanks in advance!
Will
Code for space x helmet
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- not_so_fast_punk
- Posts: 7
- Joined: Thu Nov 12, 2020 6:07 pm
Re: Code for space x helmet
maybe someone else here can help me with the makecode? I'm new to the maker world but I'm very keen to learn...
Basically ive mounted my circuit playground inside the outer shell of the helmet - when the shell/visor is down, i would like the neopixels to pulse white, and when i raise the visor (changing the orientation of the CPG) I would like the neopixels to pulse in a different colour or trigger an animation like a ripple effect....
I have it all working so everything lights up but i would like to introduce some logic inputs to create different effects when I interact with the helmet. I've tried uploading various attempts and the animations seem to play for a split second before reverting to the original state...
If anyone can provide some suggestions it would be most appreciated - I suspect I am running into trouble with the 'forever' state makecode block since it seems to revert back to this statealmost immediately..
thanks in advance! =)
Will
Basically ive mounted my circuit playground inside the outer shell of the helmet - when the shell/visor is down, i would like the neopixels to pulse white, and when i raise the visor (changing the orientation of the CPG) I would like the neopixels to pulse in a different colour or trigger an animation like a ripple effect....
I have it all working so everything lights up but i would like to introduce some logic inputs to create different effects when I interact with the helmet. I've tried uploading various attempts and the animations seem to play for a split second before reverting to the original state...
If anyone can provide some suggestions it would be most appreciated - I suspect I am running into trouble with the 'forever' state makecode block since it seems to revert back to this statealmost immediately..
thanks in advance! =)
Will
- johnpark
- Posts: 985
- Joined: Wed Mar 25, 2009 2:15 pm
Re: Code for space x helmet
Please post a link to your code or a screenshot.
- not_so_fast_punk
- Posts: 7
- Joined: Thu Nov 12, 2020 6:07 pm
Re: Code for space x helmet
Thanks John! reallyappreciate your help!- johnpark
- Posts: 985
- Joined: Wed Mar 25, 2009 2:15 pm
Re: Code for space x helmet
The Forever loop is battling the on face up loop. You'll probably want to have the pixels turn red in the on start loop and then use the on face up to turn them purple and an on face down to turn them back to red, this way you have two distinct states.
- not_so_fast_punk
- Posts: 7
- Joined: Thu Nov 12, 2020 6:07 pm
Re: Code for space x helmet
Awesome, thanks so much John.
Is there any easy way to the make the leds pulse (increase then decrease brightness)?
Is there any easy way to the make the leds pulse (increase then decrease brightness)?
- johnpark
- Posts: 985
- Joined: Wed Mar 25, 2009 2:15 pm
Re: Code for space x helmet
Here's one way https://makecode.com/_40LieUXbWco1
It increases the value by 1 over and over until it reaches 255, then decreases by 1 over and over until it reaches 0, then repeats. If you need to do other things in your code you can put this in a Control > run in parallel block so the timing doesn't get screwy.
It increases the value by 1 over and over until it reaches 255, then decreases by 1 over and over until it reaches 0, then repeats. If you need to do other things in your code you can put this in a Control > run in parallel block so the timing doesn't get screwy.
Please be positive and constructive with your questions and comments.