| 
  • 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
 

AlexLewis_Lab4

Page history last edited by Alex lewis 7 years, 1 month ago

Fliqz has shut down their service. To access this video, email support with this video id: d79d4d9153f24ffd84d2d73107b128a4

a. Based on the readings from the serial monitor, what is the range of the analog values being read?

0-10K

 

b. How many bits of resolution does the analog to digital converter (ADC) on the Atmega32U4 have (hint: where might you look to find this sort of thing)? How many are you using with the range of values you're seeing?

10 bits of resolution

 

a. Describe the voltage change over the sensing range of the sensor. A sketch of voltage vs. distance would work also. Does it match up with what you expect from the datasheet?

As an object gets closer to the distance sensor the voltage increases to a limit. If something get out of its range as in too close ir too far the voltage starts to go down again.

 

a. Include your accelerometer read-out code in your write-up.

*/

 

// these constants describe the pins. They won't change:

const int xpin = A3;                  // x-axis of the accelerometer

const int ypin = A2;                  // y-axis

const int zpin = A1;                  // z-axis (only on 3-axis models)

 

void setup()

{

  // initialize the serial communications:

  Serial.begin(9600);

}

 

void loop()

{

  // print the sensor values:

  Serial.print(analogRead(xpin));

  // print a tab between values:

  Serial.print("\t");

  Serial.print(analogRead(ypin));

  // print a tab between values:

  Serial.print("\t");

  Serial.print(analogRead(zpin));

  Serial.println();

  // delay before next reading:

  delay(100);

}

 

a. Upload a picture of your rotary encoder in action!

 

a. Turn in a copy of your final state diagram.

 

a. How many byte-sized data samples can you store on the Atmega32U4?

1000 bytes

b. How would you get your analog data from the ADC to be byte-sized?

take the analog

 

Comments (1)

Vivien Tsao said

at 4:11 pm on Aug 10, 2013

Hi Alex, you seem to have forgotten to finish the lab. You're missing a few elements... 7/10

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