a. Based on the readings from the serial monitor, what is the range of the analog values being read?
The serial monitor shows the range of analog input values to be from 0-1023.
✓
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?
Using the data sheet, the ADC has 10 bits of resolution, which is consistent with the previous answer (2^10), meaning that we are using all 10.
✓
Part B
1. 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?
The voltage increases from a negative number (~-250) to ~9000, then decreases back to a negative number as an object slowly approaches the IR sensor. This matches with the graphs presented in the data sheets.
✓
2. a. Include your accelerometer read-out code in your write-up.
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
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()
{
lcd.begin(16,2);
}
void loop()
{
lcd.clear();
lcd.print("X: ");
lcd.print(analogRead(xpin));
lcd.print(" Y: ");
lcd.print(analogRead(ypin));
lcd.setCursor(0,1);
lcd.print(" Z: ");
lcd.print(analogRead(zpin));
delay(1000);
}
✓
1a. Turn in a copy of your final state diagram.
Idle/Blank Screen --> Sensing hand --> Blank Screen
Idle/Blank Screen --> Showing data --> Blank Screen
✓v
2a. How many byte-sized data samples can you store on the Atmega32U4?
1000 bytes can be stored on the Atmega 32U4
✓
2b. How would you get your analog data from the ADC to be byte-sized?
Since the analog input is between 0-1024 and a byte can only store data between 0-255, the analog data has to be divided by 4.
Comments (1)
Benjamin Tee said
at 11:39 pm on Aug 12, 2012
Pretty awesome datalogger and application! Great job!
You don't have permission to comment on this page.