For the People

person uses pen on book
Photo by rawpixel.com on Pexels.com

Although the quote goes back into the 1300s, we know best the phrase “of the people, by the people, for the people” from Lincoln’s Gettysburg address.

If we look back to the occasion of the Gettysburg address, you might remember that he was talking that day because they were dedicating the battlefield to the fallen soldiers of the civil war.  He was admonishing those gathered to work hard so that the loss of those fallen would not be in vain.

Just like at Gettysburg, it often feels today that it is uncertain if our democracy will survive.

Just like at Gettysburg, the only way this will happen is if all of us work to ensure we have a democracy “of, by and for” the people.

Of the People-–  This means that the people who make up the government come from the people. That people like you run for office or serve in appointed roles to make the government work.

By the People- This means quite simply, that the people vote. To vote for representation, to vote for leadership, to vote to settle issues.  If the people are not informed and making decisions, democracy fails.

For the People – There is an implied “the benefit of”.  As in “For the benefit of the people”. Too often today, people read “for” and think – “instead of me”.  This is not “here- let me do that for you”.  As the first two clauses try to make clear, the people must act- Sometimes within the government and sometimes outside of the government- to get things accomplished and keep democracy healthy.  This was a warning not to let the interests of other entities come before the interests of the people.  Instead, what has too often evolved out of this means that people have great ideas and then try to find the person/department in the government to do it “for them”, instead of acting themselves.

What steps are you taking this fall to ensure that our democracy thrives and government stays “of the people, by the people, and for the people”?

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…….

MakeVention 2018

Makevention 2018  was another great gathering of Makers.  Bravo to the folks at Bloominglabs who work hard to make this happen.   Here is just a sampling of the makers we visited

 

 

Touch me, touch me, touch me…

Having gotten over a fear of hardware with the early easy success of the Decision Slug, and having proven out the simplicity of even the block interface for software with my Arc Reactor POTS Sensor, I wanted to explore more of the input sensors.  Ever since playing at Meow Wolf in Santa Fe this summer, touch capacitance has been dancing in my brain.   I made some progress on it, but have to tell you that there is something glitchy in getting it going all the way with Adafruit’s Circuit Playground Express (CPE) and this is not yet whole.

The CPE has 7 pads that can act as touch capacitive inputs, there are 7 main colors in a rainbow ( ROYGBIV) and there are 7 notes in a scale.  Seems like it is time to make a rainbox piano.  I should be able to set it up so that there are strips of copper tape that make the inputs conductive, I should be able to build something fun.

It seemed like a super simple coding project- touch input here, change the color, play a sound.  Easy, right?  Sure, unless you try to get all software-y on it. I thought. Hey- have one variable, set the value of the variable according to where the input came from. Then have an evaluation of the variable and do different things depending on the value of the variable.  Perfectly logical software application approach.  The code looked something like this:


let touchMe = 0
input.pinA1.onEvent(ButtonEvent.Click, function () {
touchMe = 1
})
input.pinA2.onEvent(ButtonEvent.Click, function () {
touchMe = 2
})
input.pinA3.onEvent(ButtonEvent.Click, function () {
touchMe = 3
})
input.pinA4.onEvent(ButtonEvent.Click, function () {
touchMe = 4
})
input.pinA5.onEvent(ButtonEvent.Click, function () {
touchMe = 5
})
input.pinA6.onEvent(ButtonEvent.Click, function () {
touchMe = 6
})
input.pinA7.onEvent(ButtonEvent.Click, function () {
touchMe = 7
})
forever(function () {
if (touchMe == 1) {
light.setAll(0xff0000)
music.playTone(262, music.beat(BeatFraction.Half))
touchMe = 0
music.stopAllSounds()
light.clear()
} else if (touchMe == 2) {
light.setAll(0xff8000)
music.playTone(294, music.beat(BeatFraction.Half))
touchMe = 0
music.stopAllSounds()
light.clear()
} else if (touchMe == 3) {
light.setAll(0xffff00)
music.playTone(330, music.beat(BeatFraction.Half))
touchMe = 0
music.stopAllSounds()
light.clear()
} else if (touchMe == 4) {
light.setAll(0x00ff00)
music.playTone(349, music.beat(BeatFraction.Half))
touchMe = 0
music.stopAllSounds()
light.clear()
} else if (touchMe == 5) {
light.setAll(0x00ffff)
music.playTone(392, music.beat(BeatFraction.Half))
touchMe = 0
music.stopAllSounds()
light.clear()
} else if (touchMe == 6) {
light.setAll(0x0000ff)
music.playTone(440, music.beat(BeatFraction.Half))
touchMe = 0
music.stopAllSounds()
light.clear()
} else if (touchMe == 7) {
light.setAll(0x7f00ff)
music.playTone(494, music.beat(BeatFraction.Half))
touchMe = 0
music.stopAllSounds()
light.clear()
} else {
touchMe = 0
light.setAll(0xffffff)
}
})


Lesson One: the hardware and hardware interactions were way faster than the software evaluation of that long if/else statement.  So sometimes it would do the right thing, but sometimes it would miss and sometimes I would get the input from the last touch.  I had to think about code differently for hardware/human interactions. It was direct and so the code needed to be more direct.


forever(function () {
light.setBrightness(107)
music.setVolume(175)
if (input.pinA1.isPressed()) {
music.playTone(262, music.beat(BeatFraction.Half))
light.setPixelColor(6, 0xff0000)
} else if (input.pinA2.isPressed()) {
music.playTone(294, music.beat(BeatFraction.Half))
light.setPixelColor(8, 0xff8000)
} else if (input.pinA3.isPressed()) {
music.playTone(330, music.beat(BeatFraction.Half))
light.setPixelColor(9, 0xffff00)
} else if (input.pinA4.isPressed()) {
music.playTone(349, music.beat(BeatFraction.Half))
light.setPixelColor(1, 0x00ff00)
} else if (input.pinA5.isPressed()) {
music.playTone(392, music.beat(BeatFraction.Half))
light.setPixelColor(2, 0x00ffff)
} else if (input.pinA6.isPressed()) {
music.playTone(440, music.beat(BeatFraction.Half))
light.setPixelColor(3, 0x0000ff)
} else if (input.pinA7.isPressed()) {
music.playTone(523, music.beat(BeatFraction.Half))
light.setPixelColor(4, 0x7f00ff)
} else {
light.setAll(0x000000)
music.stopAllSounds()
}
})

This code does the same thing as the first block, but is much more responsive and gives us a tone and color change correctly every time.

Since I knew the code and hardware were working reliably, I started to build out the actual human interface for the piano.
Lesson 2: Notice the table in that video. Yep.. a metal table. LOL. D’oh. when working with touch inputs, working with leads on a metal table through paper gives interesting mixed up spaghetti results. 

I decided to move the base of the project onto a 6X6 square of polycarb and started marking out and running copper tape and wire where I want the touch spots to be for this handheld rainbow piano.

Debug Issue: Everything is lovely with the first touch sensor or two, but after that, the entire thing goes nuts. Sometimes when you touch pad #3 you get the code for 3 to play, but sometimes it plays 1 or 7 or…    It is like a crazy ghost in the machine.

I banged my head on this for about 20 minutes, and then I hit time for SHAK open house, so it is a pause and then regroup on this in the future.  Note: I got to the bottom of this mystery a few weeks later and wrote it up.

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

Wire Wrapping for MakerMayhem

The layout worked through, now to dream up the wire wrapping design. The big piece is actually shaped and polished Kokomo Opalescent Glass oven slag. #makermayhem (at SHAK Makerspace)

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.