Posted on

Touch me, touch me, touch me Pt 2.

A couple of weeks ago I got stymied by misbehaving TouchCapacitance with the Adafruit Circuit Playground Express.

There are a small handful of videos out on youtube where people have been playing with this feature – all with slightly different code approaches- but none of them seemed to have the “wrong input” problem I was having.  I thought maybe my else was just still too long but found examples that pretty much matched what I did and were working in their video.

And then, at 3:30 into this video on using CircuitPython to do a touch capacitance piano,  the host hit on the issue of false inputs.  ta-dah!  Seems like just keeping the wires straight was going to be the answer.  I got out a clipboard and did the layout on a wider surface and sure enough, with no wires touching ( even though they are insulated wires) everything plays lovely.

I got out some paper to start sketching out a new layout and design with this in mind…  but then got interrupted by Dave’s brainstorm and need for collaboration on glowing glass necklaces…

I have an ultimate goal to be able to use this for a much larger art install project so I will come back to this smaller version in a week or two to test and learn more about the touch surfaces..

to be continued…….

Posted on

A Marvel-ous POTS Alarm

ColorTempIndicatorIn playing with the MakeCode Interface last week to write some Javascript for the Decision Slug, I was excited to see that it also had an interface where code could be written with a block interface, instead of text.

I figured this was potentially helpful for two reasons:  1) it lowered the bar of entry for anyone who wanted to build with hardware, and 2) it was a great code learning exercise because you can build in blocks and then flip over to text.  For this week’s project, I wanted to work just in the Block interface and see if I could do some interesting things, and I wanted to play with the thermistor built into the Adafruit Circuit Playground Express (CPE) board I have been learning with.

For me, the Thermistor was interesting because one of the side impacts of my Ehlers Danlos is a solid case of NeuroCardio Syncope and POTS.

For me, this hits when the temperature rises. I get

iron-man-arc-reactor-shirthot and then I topple over- it is a grand adventure.  I thought.. what if we could have some visual feedback on the ambient temperature but still make it fun.   The neopixels on the CPE pretty instantly make you think of Tony Stark’s arc

20180815_165811.jpgreactor, so that seemed a place to start.


I found art of the arc reactor in the Cricut DesignCenter, cut some metallic red iron – on and prepped a shirt to receive the CPE.   You can see it here, with the CPE in place.  Because I am a human female, I chose to put it on the left side, over my heart rather than dead center  and buried in cleavage.   I measured out the CPE so that I knew the board would fit correctly in the middle of the iron on.  I attached a pin back to the board, so it was removeable ( I will try magents next time) and cut a small hole in the shirt under the board for the wire to the battery pack.  I used velcro to attach the battery pack to the inside of the shirt.

The code ended up being very simple – block image above is the actual code.  Here is the Javascript if you want a Cut/Paste, or you can download the utf file.


 

 

forever(function () {
if (input.temperature(TemperatureUnit.Fahrenheit) >= 80) {
light.showAnimation(light.theaterChaseAnimation, __internal.__timePicker(500))
light.setAll(0xff0000)
} else if (input.temperature(TemperatureUnit.Fahrenheit) <= 45) {
light.showAnimation(light.colorWipeAnimation, __internal.__timePicker(500))
light.setAll(0x0000ff)
} else {
light.setAll(0x00ff00)
}
})

The lights turn red if the temperature is 80 F, Blue if it is below 45F and green the rest of the time.  The picture above where the lights are green is after I had chilled it in a fridge to test the thermistor.   Here is the video of the final project:

As I was experimenting with outputs from the thermistor on the board, I also played with the graph() function, which allows us to map ranges of values to the neopixels built in. The block code for this is below, and you can download the utf file as well.

thermometerblocks.png

Posted on

Decision Slug

Decision Slug at SHAK Makerspace         
Some days, you are just too much of a slug to make a decision.

When that happens, the decision slug is the project for you.

This slug was laid out with a 4 option grid, but you could build yours with any number of choices.

This was the first project I did in my August Month of MakerMayhem-  my personal locked out time to explore and build with hardware.   I have a long history with software and programming- but it has always been applications or web pages.  I had historically sidestepped making the step into hardware controls, maybe because I was Certain I was going to just explode expensive hardware, it seemed safe to stick to words on a screen.  When I decided to block off large chunks of time in August to make at SHAK Makerspace , this seemed like the right challenge to include.

Luckily, the Adafruit Circuit Playground Express is a super easy and reasonably low-cost board to start with- this took most of the trepidation out of the mix.

For the first project, I wanted to play with the accelerometer, built-in sound, the included neoPixels, and also with conductive thread and some connected LEDs ( I put those in the slug eyespots).

Although the Circuit Playground express can be programmed in a multitude of languages ( including CircuitPython and Arduino), I did this first project in Javascript.  I wanted to focus on the hardware and hardware calls, not learning a new language.

I kept track of every iteration of the code, just to see how many experimental rounds and tweaks it took me to get the results I had decided on.  12 iterative saves and about an hour later I had functioning code that I liked how it behaved both in the Microsoft MakeCode simulator and on the board itself.

You can see the code here, feel free to copy/paste and mutate for your own use.

let LED = 0
input.onGesture(Gesture.Shake, function () {
music.playSound(music.sounds(Sounds.PowerUp))
// Pick a random number, there are 10 LEDS on the CPE
LED = Math.randomRange(0, 9)
light.showAnimation(light.sparkleAnimation, __internal.__timePicker(2000))
// Blink the LED Eyes that are sewn in at outputs A7
// and A0
pins.A7.digitalWrite(true)
pins.A0.digitalWrite(true)
pins.A7.digitalWrite(false)
pins.A0.digitalWrite(false)
pins.A7.digitalWrite(true)
pins.A0.digitalWrite(true)
music.playSound(music.sounds(Sounds.BaDing))
light.setPixelColor(LED, 0x00ff00)
// Turn the eyes back off
pins.A7.digitalWrite(false)
pins.A0.digitalWrite(false)
})

Most of the iterations were because I  layered in the effects one at a time so I could learn and debug ( not really much to debug here) and then playing with order and timing to give the results I wanted.   If you like exactly this action, you can download the compiled code.

I then spent most of the rest of the day… sewing. I used scraps and bits we had around the space and made a goofy looking slug.
I think this would be fun to bastardize an existing stuffed animal and embed it into the animal, as a next level redo.