The Jump to Universality – Response

‘A small change in a system to meet a parochial purpose just happened to make the system universal as well.’

This sentence especially memorable for me because I had always wondered how intelligent the people that developed the universal ideas in the ancient times must have been and whether they expected us, people living in 2018, to continue to use those ideas. To find out that it was not in their intentions to create a system fit for everyone across all cultures and time is a little disappointing but I think that makes a lot more sense.

I also liked the examples the writer used to explain symbols, ‘sun’ and ‘tree’, because although no puns intended, I thought it was quite clever when ‘treason’ came up as the example for the limitations of symbols as I had assumed that ‘sun’ and ‘tree’ were random examples.

Week 2 Project: tic tack toe

My goal with this project was to create a light-up version of tick tack toe, where a light would display whenever a piece was placed and display the lights for the winning set at the end. Making the physical board was not too much of an issue, and wiring appeared to go well, but after only a small amount of testing I realized that my design was fundamentally flawed.

<iframe allowFullScreen frameborder=”0″ height=”564″ mozallowfullscreen src=”https://player.vimeo.com/video/254331930″ webkitAllowFullScreen width=”640″></iframe>

(This video was taken at an early stage and simply shows that the program logic could accurately store and use my switches, while simultaneously powering the light on the same circuit)

I was attempting to complete the project with 9/10 pins, which did not work for the simple reason that current flows between two arduino pins set to  output at the same level if connected. My design was to have a single output pin that provided 5 v to 9 parallel series. Each series contained a switch and an LED bulb, and then ended in an arduino pin with pulldown to ground. The idea was the the receiving pin would, upon receiving a signal, output the same voltage as the main pin, and so set the voltage drop over the circuit to zero. Unfortunately, this is not a function arduino is capable of from what I could determine. The issue was not the fact that the circuit was still connected to ground, as the LEDs were far to bright to be in series with a 10k resistor. (The version I have described above is not the very first design, it is simpler and more elegant, and does not require that the lights be able to function with current flow from either direction).

To make the circuits work with an arduino I separated each of the 9 parallel circuits and gave them their own power pin, all of which were initiated to on. Now each light would turn on when the corresponding piece was placed, and at the end of the game when a winning line was determined only the LEDs that belonged to that line would keep their power, the rest would be shut off. This design works from an electronics perspective, though the game logic of my software contains bugs. Specifically, the winning line is improperly identified. However, all the lights during the game work correctly, and when the game detects a winning line, even though it is incorrect, it propagates that error correctly into a single line of powered lights. I am content at the moment, however, since both the game lights and the winning lights work correctly, it is only the game logic the determines which lights are part of the winning line that is bugged.

int board[9] = { -1, -1, -1, -1, -1, -1, -1, -1, -1};
int mapping[9] = {11, 12, A0, A1, A2, A3, A4, A5, 13};
//int winners[3] = { -1, -1, -1};
int winners[3] = {6, 7, 8};
int turn = 0;
void setup() {
  // put your setup code here, to run once:
  initialize();
}
void loop() {
  // put your main code here, to run repeatedly:
  //displayWinner();
  play();
  //initialize();
}
void initialize() {
  for (int i = 0; i <= 8; i++) {
    pinMode(i + 2, INPUT);
    pinMode(mapping[i], OUTPUT);
    digitalWrite(mapping[i], HIGH);
  }
  pinMode(1, OUTPUT);
  digitalWrite(1, LOW);
  //pinMode(13, OUTPUT);
  //digitalWrite(13, HIGH);
  //digitalWrite(LED_BUILTIN, HIGH);
}
void play () {
  boolean done = false;
  while (!done) {
    boolean piece_played = false;
    int temp = -1;
    //turn++;
    //turn= turn%2;
    while (temp == -1) {
      for (int i = 0; i <= 8; i++) {
        if ((digitalRead(i + 2) == true) && (board[i] == -1)) {
          temp = i;
          board[i] = turn;
          break;
        }
      }
    }
    done = checkWin(temp, turn);
    //    if(done){
    //      digitalWrite(1,HIGH);
    //    }
    delay(400);
    //    pinMode(temp + 2, OUTPUT);
    //    digitalWrite(temp + 2, LOW);
    digitalWrite(mapping[temp + 2], HIGH);
  }
  displayWinner();
}
boolean checkWin(int i, int turn) {
  //  digitalWrite(1, HIGH);
  //  delay(500);
  //board[i] = turn;
  //return false;
  if (i == 4) {
    if (board[0] == board[4] == board[6]) {
      int temp[3] = {0, 4, 6};
      for (int j = 0; j < 3; j++) {
        winners[j] = temp[j];
      }
      //digitalWrite(LED_BUILTIN, HIGH);
      return true;
    }
    if (board[2] == board[4] == board[8]) {
      int temp[3] = {2, 4, 8};
      for (int j = 0; j < 3; j++) {
        winners[j] = temp[j];
      }
      //digitalWrite(LED_BUILTIN, HIGH);
      return true;
    }
  }
  if (i / 3 == 0) {
    if (board[0] == board[1] == board[2]) {
      int temp[3] = {0, 1, 2};
      for (int j = 0; j < 3; j++) {
        winners[j] = temp[j];
      }
      //digitalWrite(LED_BUILTIN, HIGH);
      return true;
    }
  }
  if (i / 3 == 1) {
    if (board[3] == board[4] == board[5]) {
      int temp[3] = {3, 4, 5};
      for (int j = 0; j < 3; j++) {
        winners[j] = temp[j];
      }
      //digitalWrite(LED_BUILTIN, HIGH);
      return true;
    }
  }
  if (i / 3 == 2) {
    if (board[6] == board[7] == board[8]) {
      int temp[3] = {0, 1, 2};
      for (int j = 0; j < 3; j++) {
        winners[j] = temp[j];
      }
      //digitalWrite(LED_BUILTIN, HIGH);
      return true;
    }
  }
  //  digitalWrite(1, HIGH);
  //  delay(500);
  if (i % 3 == 0) {
    //digitalWrite(1, HIGH);
    if (board[0] == board[3] == board[6]) {
      int temp[3] = {0, 3, 6};
      for (int j = 0; j < 3; j++) {
        winners[j] = temp[j];
      }
      //digitalWrite(LED_BUILTIN, HIGH);
      return true;
    }
  }
  if (i % 3 == 1) {
    if (board[1] == board[4] == board[7]) {
      int temp[3] = {1, 4, 7};
      for (int j = 0; j < 3; j++) {
        winners[j] = temp[j];
      }
      return true;
    }
  }
  if (i % 3 == 2) {
    if (board[2] == board[5] == board[8]) {
      int temp[3] = {2, 5, 8};
      for (int j = 0; j < 3; j++) {
        winners[j] = temp[j];
      }
      return true;
    }
  }
  return false;
}
void displayWinner() {
  initialize();
  digitalWrite(1, HIGH);
  //  digitalWrite(13,LOW);
  //  for(int i=0; i<3; i++){
  //    digitalWrite(mapping[winners[i]],HIGH);
  //  }
  //  while(true){
  //    delay(1);
  //  }
  for (int i = 0; i < 9; i++) {
    int in = false;
    for (int j = 0; j < 3; j++) {
      if (i == winners[j]) {
        in = true;
      }
    }
    if (!in) {
      digitalWrite(mapping[i], LOW);
    }
  }
  delay(5000);
}

To continue this project I would fix the bug in the code, and then improve the mechanical parts of the board, namely make pieces to be played and improve the sensitivity of the switches, and finally affix everything so it is not constantly falling apart. There are also a number of ways in which the game will behave oddly, for example if played too quickly, and so I might adjust for those oddities.

Twinkle Twinkle Lulla-bye

In order to improve and work off of my last project I decided to program my lights to play twinkle twinkle little star (as LED interpretations). I got the idea from a show called ‘Switched at Birth’ where many deaf characters are protagonists. It is shown how deaf people typically experience interpretations of sound: through flashes of light. Therefore, I created something in the hopes to tailor to deaf babies. I used green and yellow LED’s as they are more calming and soothing for sleep.

I wrote down letter notes for how twinkle twinkle would be played on a piano, then translated each note to a PIN number. 

Originally I was going to play Brahm’s lullaby but decided against it as the RedBoard didn’t seem to be able to support all of the lights needed to create the system. 

So the idea was to create a seat pad for parents to sit on and when they got up to leave their child’s bedroom the light sequence would play. The video below shows it working: listen to it on mute!

Handy (not) Dandy Bike Light

Picture This.

You’re riding your bicycle at night, wearing a fluorescent vest so cars don’t flatten you on the road. You reach the end of a street but you realize there is a problem.

See, typically in a vehicle that doesn’t have a blinker to indicate where you will turn, the person riding is meant to use their hands to indicate which way they will turn.

But what about at night? You are on a bike with no blinker. Someone in a car far away may see your vest but they won’t have any indication that you are about to switch lanes or turn.

And so my Handy (not) Dandy Bike Light comes into play.

Re-Design

In my last project, I had a pun project called “Punch your Lights On.” This time, I took a similar mechanism, but gave it a more practical use. There is still a kind of jerking motion done in order to activate the lighting. This is due to the fact that on a bike, the movement would be rather deliberate and the light will not be turned on by a jump on the rough road.

 

Difficulties

The code is simply the “Blink” program that comes with the Arduino, but it is applied to the two different LED lights. This part was easy to execute.

Originally, the light was supposed to include a third LED which would constantly be on while a person is on the bike. This third position on the actual mechanism made the light harder to use and so I decided to remove it from the mechanism.

In my last project, the wires to the breadboard were to make contact with the metal marble. This caused some issues as the marble was not always in contact with the wires.

In this project, I expanded the possible surface area by connecting the wires to aluminum foil. These pieces of aluminum foil are meant to come into contact with the marble, making it much easier to complete the circuit.

Project Super Straw (2.0)

 

The new and improved Super Straw will make your drinking experience even better with cooler light displays. Notice that a different light or light display would be turned on every time you take a sip from the straw. It goes like RED-> BLUE -> YELLOW -> YELLOW-BLUE-RED and FADE. The cycle then repeats itself.

Basic circus graph

However, I encountered a small problem with the fading effect. The lights do not seem to completely turn off in the end.

Then I changed while (brightness > 0 ) to while (brightness >= 0 ) in the beginning of the part of the code that is in charge of the fading effect, then the problem was solved. It seemed that I need to allow the brightness to go to or below 0 to make the lights completely turned off.

After debugging

link to my code: https://github.com/ross67/IntroToIm/blob/master/Project%20Super%20Straw%202.0.txt

The Art of Interactive Design – Response

I’ve always understood interaction as a process by which elementary particles exchange gauge bosons with each other or when two masses exert force on each other. For me, the simple act of walking down the high-line consists of many interactions such as the collision of atmospheric particles and my body and the exertion of force on the ground by my feet (exertion of force on my feet by the ground). This definition is concrete, tangible, and most importantly, objective: if there is an exchange of force, there is an interaction.

Thinking of interactivity as a continuous variable with relative measures that outline the “degrees” of interaction is a particularly interesting concept. I do agree with the author that interactivity is not merely a boolean property. Perhaps the existence of interactivity can be defined with a simple yes or not, but there’s definitely much more to interactions than just that. Touching a rock versus playing squash are clearly two different “degrees” of interaction. But the question is, how can we quantify the level of interactivity objectively?

The Jump to Universality – Response

I really liked how the author used examples and analogies from a wide spectrum of fields and disciplines (ranging from literature and history to physics and biology) to better portray the concept of universality. The establishment of a universal system in which all parties involved in the field acknowledge and adopt is arguably one of the most important elements of the advancement of the human race. It enables individuals from different corners of the world to communicate and collaborate with each other, solving problems that are sometimes for too difficult for just a handful of people that speak the same language.

Lights yay!

Coding is confusing. Just a little bit. I’ve never done any coding before or computer science, so Wednesday was a first for me. I thought I understood what was happening during last class (which I did) but when I went over it again everything was kind of jumbled. So when I went to program for my maze game, I wanted to write a code which I could clearly understand.

I basically coded it so that when the button- which was the end point of the maze in my project- was hit, the two lights would alternatively flicker on and off. Here is a video of my project in action:

 

the Blowback Machine (New, Improved, and Interactive!)

The new and improved blowback machine, now with twice the interactivity!!!

So initially with the first blowback machine, I had a problem that you needed to blow on it very hard in order to keep the aluminum foil sheets in contact long enough for the fan DC motor to turn on. To fix that, I separated the switch circuit and the motor circuit, and used the Arduino to signal the motor to turn on for 2 seconds as soon as contact between the sheets is made. In addition, I wired the motor properly with a separate power source going through a transistor in order to prevent possible damage to the Arduino.

Now the Interactivity!!

 

So initially, I wanted add speakers to the circuit that plays the sound of blowing air when the DC motor turns on. So I did some research, and found out that the most convenient way would have been with an Arduino shield that has space for an SD card. I didn’t have that, but I found another way to play sound through Pulse Width Modulation (PWM), the same technology that allows you to dim an LED. So I got to testing I ran into a few problems. PWM is extremely limiting, as in it could only play 8-bit sounds, therefore I couldn’t have played the sound of blowing. Which I could’ve worked through, if it actually worked. I tried multiple speakers and multiple wiring set ups, but I could not get it to work. So I moved on.

Then I thought, what if people wanted to practice blowing at things, without the consequences of having the rage of the fan! So I added a button to enable or disable fan responsiveness, with an LED to indicate if the fan is going to blow back or not in response to you blowing.

code :

int motorPin = 7;
int circuitPin = 2;
int buttonPin = 8;
int ledPin = 13;
bool fanOperation = false;
bool previousButtonState = false;

void setup() {
  // put your setup code here, to run once:
  pinMode(motorPin, OUTPUT);
  pinMode(circuitPin, INPUT);
  pinMode(buttonPin, INPUT);
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}


void loop() {
  // put your main code here, to run repeatedly:
  int x = digitalRead(circuitPin);
  bool buttonState = digitalRead(buttonPin);
  Serial.println(fanOperation);
  if (buttonState) {
    if (!previousButtonState) {
      fanOperation = !fanOperation;
    } 
  }
  if (fanOperation) {
    digitalWrite(ledPin, HIGH);
    if (x) {
    digitalWrite(motorPin, HIGH);
    delay(2000);
    digitalWrite(motorPin, LOW);
    delay(500);
    } 
  } if (!fanOperation){
    digitalWrite(ledPin, LOW);
  }
  
  previousButtonState = buttonState;
}

Video:

The Jump to Universality

I thought this reading is incredibly interesting and thought provoking. It also made me realize the existence of these little ‘glitches in the matrix’, where things are happening out of the time that you would typically associate with them. Let me explain. For example, the system that the romans developed for the adding up their numerals, is exactly an algorithm that we would feed today’s computers. As another example, Alan Turing while developing the mathematical framework of general purpose computers, also developed Turing machines, which are theoretical general purpose computers that compute everything using the Unary system which is a very similar system to what the pre-historic farmers mentioned in the text used. Another thing I noticed throughout the reading is that the Author is desperate for the mathematicians and people he wrote about to make the jump to universality. I would argue that a lot of them didn’t need to, they developed number systems that were suitable for them, and didn’t need a universal number system.