## so i’ve been thinking

about energy. like how sometimes a person has a lot of energy and sometimes there’s like less energy. i wonder how you could measure how much energy a person has at a time… like what form that usually takes… is that in how much they move… or how much heat they’re expending.. (but hard to say in this climate).. or their heartrate… anyways… sometimes a person could be exercising but feeling low on energy, or a person could be sitting still and feel a lot of energy.. so i’m wondering how to measure that..

## fantasy

In an ideal world, it would be amazing if there was a sensor that measured your heartbeat (which there are) and that was connected to clothing or even something by remote, that would show via LED RGB colors how fast your heart was beating. You could give someone else your heart that would tell them how fast your heart was beating at any given moment no matter how far away you were from them. Like using Wi-fi. The output doesn’t really matter. It could be something you wear on your own shirt. That vibrates like a cell phone when the person’s whose heart it belongs to heart is beating fast.

## will add more to this post later

but I want to put up:

• sensorwalk photos
• photos of the Arduino and related
• maybe some code questions

## Stupid Pet Tricks

Today’s class was cool because I got to see what everyone had made, and none of them were stupid but some of them did involve animals/pets. I was a bit in awe…

But anyways I will kind of talk about my project.

This is the code:

```#include "pitches.h"

int notes[] = {
NOTE_FS1 , NOTE_GS1 , NOTE_AS1 , NOTE_CS2 , NOTE_DS2 };

void setup() {
Serial.begin(9600);
}

void loop() {
Serial.println(sensorValue, DEC);

if (sensorValue <6 && sensorValue >0){
tone(8, 92.499, 500);
}
if (sensorValue <11 && sensorValue>6){
tone(8, 103.83, 500);
}
if (sensorValue <16 && sensorValue >11){
tone(8, 116.54, 500);
}
if (sensorValue <21 && sensorValue >16) {
tone(8, 138.59, 500);
}
if (sensorValue <26 && sensorValue >21) {
tone(8, 155.56, 500);
}
if (sensorValue <31 && sensorValue >26){
tone(8, 185.00, 500);
}
if (sensorValue <36 && sensorValue > 31){
tone(8, 207.65, 500);
}
if (sensorValue <41 && sensorValue >36){
tone(8, 233.08, 500);
}
if (sensorValue <46 && sensorValue >41){
tone(8, 277.18, 500);
}
if (sensorValue <51 && sensorValue >46){
tone(8, 311.13, 500);
}
if (sensorValue >50){
tone(8, 369.99, 500);
}
}```

The Pitches.h file is included, but because I wasn’t using the same notes, I had to use specific frequency values from a table of frequency values matched with notes.

When I got back to my room to try it out again, the light levels were lower, and actually the values (as seen in Serial Monitor) did not really go above 25-30, so to get the same results I divided analogRead(2) by 2 instead of 4, and that worked fine. However, it would be better probably to put in either a Map or a Calibration function.

It’s really cool too because it wouldn’t have come together without the help of my classmates, teacher Scott Fitzgerald, and the people of ITP.  It was like each person gave me a piece of the puzzle and then it was easy to put together.

The soldering was kind of a last-minute thing I decided to do, because obvious the sound is going to be hard to hear when the speaker is inside the box. I didn’t want to make a stupid looking hole in the box last-minute for the speaker, so I just stuck it at the edge. It’s okay.

Oh yeah, and today I went to the NYU Computer Store to pick up a packet of photo resistors. While I was there, I noticed they had medium Servo motors among other things like LED’s and a hugeeee packet of resistors. Honestly, I don’t really understand what was going on with the photo resistors. All I know is that in the end it worked. But the values coming out of analogRead(0) were all 1000+. I just tried analogRead(2) and the values were between approximately 0-50, so I decided to go with that. Since I believe it’s a serial circuit, I wonder if the values would change if there were only 2 photoresistors on the board, or 1.

I guess I’m curious now about batteries.

## Digital input and output

Seems I am running into a snag which is the LEDs are working, but the switch isn’t. I’m not sure exactly what I’m doing wrong.

I added a line of code in void (loop) to see if the Switch State was being activated:

Serial.println(switchState);

But the Serial Monitor did not show anything.

Edit: Nevermind, got it to work.

## Opening up the Arduino

5:14 P.M. So I got the kit today (finally!) and it’s glued in and screwed in. I haven’t connected it to the computer yet, partially because the USB driver doesn’t seem to be working for me. I think the problem was that I installed Arduino before opening up the driver. After restarting Arduino, the two usbmodem options under Board>Serial Port> are not showing up.

I wrote this code, which I pretty much copy and pasted from somewhere. So far I have on my breadboard 2 red for power wires, 2 black for ground wires, one yellow connected to digital input pin 2, a switch button, a green LED, and 2 resistors. The resistor leads are too long at the moment and should be clipped as well. That means I will have to go to Duane Reade to buy a small pair of scissors or else do it on Tuesday.

```void setup(){
pinMode(2,OUTPUT);
}

void loop(){
digitalWrite(2,HIGH);
delay(1000);
digitalWrite(2,LOW);
delay(1000);
}
```

I wonder if it will still work without the serial port driver. I am going to try that in the next 15 minutes.