esc

“Sorry, I have to take this”

I got really excited about last week’s IFTTT discovery and decided to make something I need–– a physical escape key for when I want to *gracefully* leave a conversation. Instead of asking a friend to come rescue you, just click a button to get a phone call you’ll have to excuse yourself for.

Given the urgency of the situation, I thought that a the trigger should be a simple push of a button– think big red world destruction button!

I programmed the Arduino to detect the state of the button (switch) so that if it’s pressed down, it will write an emergencyLevel of 100 onto the feed (see the three spikes towards the end of the feed line) and then built out a recipe on IFTTT that prompts a call to my number when it detects a value above 10.

I also wrote a script for my important caller

Video to follow!

Lucky Cat Wave

I simplified my original plan and instead created a cat that waves to grant your wishes! For my setup, the microcontroller (server) returns a physical response (the cat waving) upon the browser’s (client) request.

Just submit your wish through the form on the browser UI and the lucky cat will wave for each character in your wish to grant it 🙂

In terms of the interaction, the command “Make a wish!” would prompt the user to enter his/her wish. Upon clicking the “Wish it” button (which affords clicking/pressing), the prompt returns a feedback “Wishing for _______ ?”. In addition to this, the “bell” attached to the cat’s collar would light up while its right paw waves. Once the waving is done, the light goes out.

The light as a signifier was helpful when I was first testing the servo on the cat. Because I put the ledOn and ledOff commands before and after the servo command, I could tell whether the servo was responding without waiting on it forever. As for the physical cat, I used a combination of modeling clay (everything but the arm) and Play Doh (just the arm). My guess is that the servo wouldn’t move because the clay arm was too heavy.

It works 🙂
let url = "http://192.168.1.106/"; // string to hold URL
let servoVal = 0; // variable that holds the servoVal
let input = "";
let button, greeting, wish;

//function preload() {
//  // Ensure the .ttf or .otf font stored in the assets directory
//  // is loaded before setup() and draw() are called
//  font = loadFont('assets/MADE Evolve Sans Bold (PERSONAL USE).otf');
//}

function setup() {
  createCanvas(windowWidth, windowHeight);
  frameRate(10);
  
  input = createInput();
  input.position(300, 405);

  button = createButton('Wish it');
  button.position(input.x + input.width + 5, 405);

  greeting = createElement('h1', 'Make a wish!'); // works because of the p5 dom library!
  greeting.position(300, 345);

  textSize(120);
  
  button.mousePressed(load);
  const wish = input.value();

}

function draw() {
  background(255, 204, 0);
}

function load() {
  let ledMode = "mode/4/o";
  console.log(url+ledMode);
  httpGet(url+ledMode, 'json');

  wish = input.value();
  console.log(wish);
  if (wish!=""){
    let ledOn = "digital/4/1";
    console.log(url+ledOn);
    httpGet(url+ledOn, 'json');
    greeting.html('Wishing for ' + wish + ' ?');
    input.value('');
    servoPos();
  }
  else {
      greeting.html('Make a wish!');
  }
}

function servoPos() {
  console.log('servoPos function works');
  servoVal= wish.length;
  let cmd;
  servoCmd ="servo?params=";
  httpGet(url+servoCmd+servoVal, 'json');
  console.log(url+servoCmd+servoVal);
  let ledOff = "digital/4/0";
  console.log(url+ledOff);
  httpGet(url+ledOff, 'json');
}

Observation – MAGNET doors

I’ve made some observations about an interface that everyone in this class has used: the MAGNET doors. There are some problems with the way they unlock both for people entering and leaving. If you’re entering, you have to tap your ID on the card reader to unlock the doors. However, the glass doors, which allow you to see inside, also make it so the card reader has to be farther away from the doors. Additionally, even if your card won’t open the door, the light on the reader still goes green, and in most people’s minds, green = go. The distance also means that if your card didn’t work, you have to walk a couple steps back to re-tap or, as many people do, just ask whoever’s at the desk to let you in so you can get to class.

Then, once class is over and you’re on your way out, there’s a proximity sensor and a button to unlock the doors. The sensor is supposed to automatically unlock the doors when someone approaches, but it’s aimed poorly and only detects you if you’re either very tall, waving at it, or walking straight at it from a distance. Given that most Magnet classrooms are around the corner from the door, most people don’t walk straight at the door, instead staying close to the wall, and in the sensor’s blind spot. Therefore, most people go for the button, which suffers from the same problem as the card reader on the other side: it has to be on the wall, so it can’t be within arm’s length from the door. A few people I’ve talked to didn’t even know the sensor was there and always went for the button. I only figured out about the sensor because my apartment building growing up had an automatic side-entrance door with a similar problem: it wouldn’t detect me unless I waved at the sensor to open the door. That one didn’t even have a button, and the door was HEAVY so good luck getting it open without the machine’s cooperation. If these doors are this much of a pain to get through for me I can only imagine how difficult it would be for someone in a wheelchair or someone with limited use of their arms or hands.