| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.

View
 

Wright Eduardo Lab Report 3

Page history last edited by zahraa@... 4 years, 12 months ago

Part A. Making Sounds

 

a. How would you change the code to make the song play twice as fast?

 

Double the amounts described in the NoteDurations array

 

b. What song is playing? ;-)

 

...Gee...I wonder what song it could be...I can't quite wrap my head around what song could possib- STAR WARS!!!!!!!!!!!! LUKE I AM YOUR FATHER!!!!!!! NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!

(David said he liked theatrics)

 

Part B. Writing to the LCD

 

a. What voltage level do you need to power your display?

 

You need a voltage level of 5 volts to power the display

 

b. What was one mistake you made when wiring up the display? How did you fix it?

 

I accidentally thought that i need to connect the circuit to the power supply in the lab instead of to the arduino power supply. I fixed it by connecting the circuit to the arduino power supply.

 

c. What line of code do you need to change to make it flash your name instead of "Hello World"?

 

lcd.print("hello, world!");

 

 

 

Part C. Fancy Inputs

 

1. Potentiometer

 

a. Post a copy of your new code in your lab writeup.

 

int sensorPin = A0;    // select the input pin for the potentiometer

int ledPin = 13;      // select the pin for the LED

int sensorValue = 0;  // variable to store the value coming from the sensor

 

void setup() {

  // declare the ledPin as an OUTPUT:

  pinMode(ledPin, OUTPUT);

}

 

void loop() {

  // read the value from the sensor:

  sensorValue = analogRead(sensorPin);

  analogWrite(ledPin, sensorValue / 4);

}

✔great

 

 

2. Flex Sensor

 

a. What resistance do you see with a Multimeter when the sensor is flat? When it is bent?

?

b. What kind of voltages should we expect for the Arduino analog pin based on the sensor resistance?

?c. How does the range of the LED's brightness change compared to the potentiometer?

?

d. Include a copy of your Lowly Multimeter code in your lab write-up.

 

// include the library code:

#include <LiquidCrystal.h>

 

int sensorPin = A0;    // select the input pin for the potentiometer

int ledPin = 13;      // select the pin for the LED

int sensorValue = 0;  // variable to store the value coming from the sensor

 

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

 

void setup() {

  pinMode(ledPin, OUTPUT);

  pinMode(sensorPin, INPUT);

  lcd.begin(16, 2);

}

 

void loop() {

   // read the value from the sensor:

  sensorValue = analogRead(sensorPin) ;

  // turn the ledPin on

  analogWrite(ledPin, sensorValue * 255/1024);

  lcd.print(sensorValue);

}

 

3. Force Sensitive Resistor

 

a. What resistance values do you see from your force sensor?

 

The resistance values range from 0 ohms to 1,000 ohms

 

b. What kind of relationship does the resistance have as a function of force applied? (e.g., linear?)

Resistance should be very high (infinite or M Ohms) when the FSR is not pressed. Resistance should lower to a few hundred Ohms, or low K Ohms, when pressed hard. -0.25

 

c. Include a copy of your FSR thumb wrestling code in your lab write-up.

 

Part D. Timer

 

a. Make a short video showing how your timer works, and what happens when time is up!

 

b. Post a link to the Lab 3 Timers Hall of Fame.

 

 

 

 

 

 

 

Comments (1)

zahraa@... said

at 2:54 pm on Aug 10, 2015

good job

You don't have permission to comment on this page.