a. Based on the readings from the serial monitor, what is the range of the analog values being read?
it goes from 0 to 1036
✓ Did it really go above 1024?
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?
the resolution of the atmega32U4 is of 1024 bits or 1 kb
Not quite. 1 bit represents integer value of 2. so to get 1024, you will have 2^10 bits = 1024.
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?
mi sensor was a bit weird so it went from 0.6 to 4.2 and as I distanced away from it gradually the voltage would go up lineally but sometimes it would suddenly skip 0.3 volts up or it would suddenly increase or decrease.
Check your wiring or change a known working sensor to check if it is a sensor issue.
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. Turn in a copy of your final state diagram.
Untitled 8.pdf
a. How many byte-sized data samples can you store on the Atmega32U4?
1024
✓
b. How would you get your analog data from the ADC to be byte-sized?
1024/4 = 256
✓
Comments (1)
Benjamin Tee said
at 9:23 pm on Aug 15, 2012
- 0.5 for Part 1
- 0.5 missing rotary encoder photo
- 0.5 for missing video
You don't have permission to comment on this page.