So we’re gonna make ol’ Betty come to life. She’s a librarian now and a pretty cranky one too. Used to work as a crossing guard in my neighborhood, but the sun became too much for her as she got up in age, and the standing all day. But boy did she wave a mean finger in her time, served with an extra of grimace - ooh wee!
She tried to find other work which would let her keep her whistle, of which everyone knew she was so fond, but, alas - she wasn’t in shape enough to be a referee; much too old to be a poilce officer; never played sports a day in her life (so coaching was out) - a lifeguard perhaps?? Lord knows ol’ Betty would sink like a rock before saving anyone else, let alone herself!
So when Betty got the gig at the local library, she retired her beloved whistle and traded it in for a hearty “Shhhh!!!”. It was a good fit in retrospect, but at the time she recalls feeling like one of those old, disgraced sheriffs in the Old West, turning in their badge as they got relieved of duty. “At least she didn’t end up with a hole in the head!” she thought.
But despite the peaceful hours floating by in the library, out of the hot sun and in the AC provided by the taxpayers of area code 11238, Betty developed a blistering case of Type 2 Diabetes, most unfortunately causing her to have to have both her legs and arms amputated. Sad to say, I know, but damned if she didn’t love her Kit Kats and Tab and wasn’t going to let any “medical” doctor tell her what to do. Stubborn old bird she was, stubborn as hell.
So off the appendages came and pretty soon there was nothing left but her head, given that the cancer had eaten her to the bone… Oh! Did I forget to mention that she smoked a lot too? I did, I did! My word did she smoke!! Loved those cigarettes, but unlike most smokers', who had a preferred brand that they stuck to for their whole and often much-shortened lives, Betty would smoke damn-near anything she could find. And she was so cheap you know, she had a habit of taking butts straight out of the ash trays you’d find in most public places, of which the library was one of course. So she was like a pig in u-kno-what. Hell, most times people would wait around for minutes at a time wondering where Betty had gone off too until the smoke cleared and you could just make her figure out again. Never coughed once in her life though, peculiar as that sounds. You can try to add that up yourself I guess!
Goodness me retirement sure was tough for Betty it seems. But now, luckily, with technology pioneered by the great Ray Kurzweil, Betty has been able to port her brain, via a special USB Z adapter (MSRP $2,399), onto a tiny microprocessing chip - hey folks said she was a lot of things but bright was not one of them - with just enough functionality to minimally perform her duties as an assistant librarian. Don’t you worry one bit though about the Dewey Decimal system giving her any trouble. No fancy text recognition software or motorized appendages (as of yet at least). No, the entire contents of the local library where Betty works now consists of half a half-dozen PC’s and a couple of Reagan-era VHS tapes.
Design-wise, Betty will be outfitted with a microphone for ears, an LED strip in the shape of a frown face to be her mouth, an mp3 shield to play a number of different “SHHHshhhh!!” sounds out of a small speaker, which is apropos, given that the throat cancer clear ate up most all of her vocal cords, while still retaining some musicality to her repertoire given the multiple samples. And although she no longer has any eyes, she will have LED placeholders so the children don’t stare too long and bump into a wall or something.
One day it would be nice for her to have a wheel chair with which she could follow you around the library with, especially in the case of trouble makers, but we may still have much to dream!
Here’s to Betty’s surgery - hoping it goes well!
Jim Swiggins
Betty The Librarian Sketch
Pot controlling Neo Pixels LEDs.
I first started out looking online for documentation for the geeetech mp3 shield that I had. These companies are nuts though as they sell mutliple versions of the same board, mutlple names of the same board, different features with not indication and often different pinouts. After much searching of the Arduino forum, I was able to find some links to documentation, although i wasn’t able to load the libraries that came with the docs. This may be something where I get some outside help. I figured I would make some kind of progress and go on to the LED strip…
I wasn’t able to get the LED’s to respond to the piezo input or to me sining through a speaker, the reasons for which weren’t clear to me. So I just used a pot for now to get the LED program right. Then it’s just a matter of reading the mic input (which may require a mic pre now that I think of it?)
I wasn’t quite happy in the end with my programming for the LEDs. There is an insane string of IF statements that should be turned into a FOR loop somehow, but my brain was too fried from looking for mp3 shield libraries to work it out.
You can see from the code that I mapped the values coming in from the analogRead on the pot into a variable I could evaluate in IF statements as I segmented each LED. Check it out below:
#include <Adafruit_NeoPixel.h> // including the Adafruit library #define PIN 12 // defining the PWM pin #define N_LEDS 10 // number of LED units on the strip Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, PIN); //decalred NeoPixel object int fade = 0; boolean turn = false; int level; int levelMap; int nLEDs = 10; void setup() { strip.begin(); Serial.begin(9600); } void loop() { level = analogRead(A0); levelMap = map(level, 50, 1000, 0, 12); if (levelMap > 1) { strip.setPixelColor(0, 0, 10, 0); strip.setPixelColor(1, 0, 0, 0); strip.setPixelColor(2, 0, 0, 0); strip.setPixelColor(3, 0, 0, 0); strip.setPixelColor(4, 0, 0, 0); strip.setPixelColor(5, 0, 0, 0); strip.setPixelColor(6, 0, 0, 0); strip.setPixelColor(7, 0, 0, 0); strip.setPixelColor(8, 0, 0, 0); strip.setPixelColor(9, 0, 0, 0); if (levelMap > 2) { strip.setPixelColor(0, 0, 10, 0); strip.setPixelColor(1, 0, 10, 0); strip.setPixelColor(2, 0, 0, 0); strip.setPixelColor(3, 0, 0, 0); strip.setPixelColor(4, 0, 0, 0); strip.setPixelColor(5, 0, 0, 0); strip.setPixelColor(6, 0, 0, 0); strip.setPixelColor(7, 0, 0, 0); strip.setPixelColor(8, 0, 0, 0); strip.setPixelColor(9, 0, 0, 0); if (levelMap > 3) { strip.setPixelColor(0, 0, 10, 0); strip.setPixelColor(1, 0, 10, 0); strip.setPixelColor(2, 0, 10, 0); strip.setPixelColor(3, 0, 0, 0); strip.setPixelColor(4, 0, 0, 0); strip.setPixelColor(5, 0, 0, 0); strip.setPixelColor(6, 0, 0, 0); strip.setPixelColor(7, 0, 0, 0); strip.setPixelColor(8, 0, 0, 0); strip.setPixelColor(9, 0, 0, 0); if (levelMap > 4) { strip.setPixelColor(0, 0, 10, 0); strip.setPixelColor(1, 0, 10, 0); strip.setPixelColor(2, 0, 10, 0); strip.setPixelColor(3, 0, 10, 0); strip.setPixelColor(4, 0, 0, 0); strip.setPixelColor(5, 0, 0, 0); strip.setPixelColor(6, 0, 0, 0); strip.setPixelColor(7, 0, 0, 0); strip.setPixelColor(8, 0, 0, 0); strip.setPixelColor(9, 0, 0, 0); if (levelMap > 5) { strip.setPixelColor(0, 0, 10, 0); strip.setPixelColor(1, 0, 10, 0); strip.setPixelColor(2, 0, 10, 0); strip.setPixelColor(3, 0, 10, 0); strip.setPixelColor(4, 0, 10, 0); strip.setPixelColor(5, 0, 0, 0); strip.setPixelColor(6, 0, 0, 0); strip.setPixelColor(7, 0, 0, 0); strip.setPixelColor(8, 0, 0, 0); strip.setPixelColor(9, 0, 0, 0); if (levelMap > 6) { strip.setPixelColor(0, 0, 10, 0); strip.setPixelColor(1, 0, 10, 0); strip.setPixelColor(2, 0, 10, 0); strip.setPixelColor(3, 0, 10, 0); strip.setPixelColor(4, 0, 10, 0); strip.setPixelColor(5, 20, 10, 0); strip.setPixelColor(6, 0, 0, 0); strip.setPixelColor(7, 0, 0, 0); strip.setPixelColor(8, 0, 0, 0); strip.setPixelColor(9, 0, 0, 0); if (levelMap > 7) { strip.setPixelColor(0, 0, 10, 0); strip.setPixelColor(1, 0, 10, 0); strip.setPixelColor(2, 0, 10, 0); strip.setPixelColor(3, 0, 10, 0); strip.setPixelColor(4, 0, 10, 0); strip.setPixelColor(5, 20, 10, 0); strip.setPixelColor(6, 20, 10, 0); strip.setPixelColor(7, 0, 0, 0); strip.setPixelColor(8, 0, 0, 0); strip.setPixelColor(9, 0, 0, 0); if (levelMap > 8) { strip.setPixelColor(0, 0, 10, 0); strip.setPixelColor(1, 0, 10, 0); strip.setPixelColor(2, 0, 10, 0); strip.setPixelColor(3, 0, 10, 0); strip.setPixelColor(4, 0, 10, 0); strip.setPixelColor(5, 20, 10, 0); strip.setPixelColor(6, 20, 10, 0); strip.setPixelColor(7, 40, 10, 0); strip.setPixelColor(8, 0, 0, 0); strip.setPixelColor(9, 0, 0, 0); if (levelMap > 9) { strip.setPixelColor(0, 0, 10, 0); strip.setPixelColor(1, 0, 10, 0); strip.setPixelColor(2, 0, 10, 0); strip.setPixelColor(3, 0, 10, 0); strip.setPixelColor(4, 0, 10, 0); strip.setPixelColor(5, 20, 10, 0); strip.setPixelColor(6, 20, 10, 0); strip.setPixelColor(7, 40, 10, 0); strip.setPixelColor(8, 40, 10, 0); strip.setPixelColor(9, 40, 0, 0); } else if (levelMap <= 1) { for (int i = 0; i < 10 ; i++) { strip.setPixelColor(i, 0, 0, 0); } } } } } } } } } } strip.show(); Serial.print("level "); Serial.print(level); Serial.print(": levelMap "); Serial.println(levelMap); }