Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamenm03 committed Jan 23, 2024
1 parent 69292ac commit d1bf655
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions examples/Lab3-SD/Lab3-SD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const int chipSelect = 10;
// ############### START EDITING HERE (1/3) ###############
// Adjust the following pins according to your setup

// Pin for voltage divider
const int vDivPin = A0;

// Pin for first TMP36
const int tmp1Pin = A0;
const int tmp1Pin = A1;

// Pin for second TMP36
const int tmp2Pin = A1;

// Pin for voltage divider
const int vDivPin = A2;
const int tmp2Pin = A2;

// Pin for pressure sensor
const int pressPin = A3;
Expand All @@ -36,7 +36,7 @@ const int accelzPin = A7;
// **HINT HINT WINK WINK**

// This is the string that goes at the top of your csv file. It is the column headers for your spreadsheet.
const String header = "Time (ms),TMP36_1 (Raw),TMP36_2 (Raw),Voltage (Raw),Pressure (raw),Humidity (raw),Accel_x (raw),Accel_y (raw),Accel_z (raw)";
const String header = "Time (ms),Voltage (V),TMP36_1 (Raw),TMP36_2 (Raw),Pressure (raw),Humidity (raw),Accel_x (raw),Accel_y (raw),Accel_z (raw)";

#include <SPI.h>
#include <SD.h>
Expand Down Expand Up @@ -71,9 +71,6 @@ void loop() {

// Note: in future labs, you may need to change this to add additional sensors.

double tmp1Val = analogRead(tmp1Pin); // First temperature reading (raw)
double tmp2Val = analogRead(tmp2Pin); // Second temperature reading (raw)

// ############### START EDITING HERE (2/3) ###############

double vDivVal = analogRead(vDivPin); // Battery voltage reading (THIS IS FROM VOLTAGE DIVIDER)
Expand All @@ -82,6 +79,9 @@ void loop() {

// ############### END EDITING HERE (2/3) ###############

double tmp1Val = analogRead(tmp1Pin); // First temperature reading (raw)
double tmp2Val = analogRead(tmp2Pin); // Second temperature reading (raw)

double pressVal = analogRead(pressPin); // Pressure reading (raw)
double humidVal = analogRead(humidPin); // Humidity reading (raw)
double accelxVal = analogRead(accelxPin); // X-Acceleration reading (raw)
Expand All @@ -94,15 +94,15 @@ void loop() {
// add the time (since boot) in milliseconds
dataString += String(millis());
dataString += ",";
// add the adjusted voltage divider value
dataString += String(vDivAdj);
dataString += ",";
// add the first raw TMP36 value
dataString += String(tmp1Val);
dataString += ",";
// add the second raw TMP36 value
dataString += String(tmp2Val);
dataString += ",";
// add the adjusted voltage divider value
dataString += String(vDivAdj);
dataString += ",";
// add the raw pressure value
dataString += String(pressVal);
dataString += ",";
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ENGR100-950",
"version": "1.0.6",
"version": "1.0.7",
"keywords": "Arduino,library",
"description": "UMich ENGR 100-950 Library",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ENGR100-950
version=1.0.6
version=1.0.7
author=Benjamen Miller <[email protected]>
maintainer=Benjamen Miller <[email protected]>
sentence=UMich ENGR 100-950 Library
Expand Down

0 comments on commit d1bf655

Please sign in to comment.