Skip to content

Commit 2c873d9

Browse files
committed
Compiles but is untested.
Still need to finish commenting.
1 parent 1502e1b commit 2c873d9

File tree

3 files changed

+457
-451
lines changed

3 files changed

+457
-451
lines changed

examples/Example01_Basic_OneShot/Example01_Basic_OneShot.ino

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,55 +24,63 @@
2424

2525
#include "SparkFun_AS7331.h"
2626

27-
SfeAS7331ArdI2C myUVSensor;
27+
void setup() {
2828

29-
int8_t result = SFE_BUS_OK;
29+
}
3030

31-
void setup() {
32-
Serial.begin(115200);
33-
while(!Serial){delay(100);};
34-
Serial.println("UV LED Example.");
31+
void loop() {
32+
33+
}
3534

36-
// Initialize sensor and run default setup.
37-
if(myUVSensor.begin() == false) {
38-
Serial.println("Sensor failed to begin. Please check your wiring!");
39-
Serial.println("Spinning...");
40-
while(1);
41-
}
35+
// SfeAS7331ArdI2C myUVSensor;
4236

43-
Serial.println("Sensor began.");
37+
// int8_t result = SFE_BUS_OK;
4438

45-
// Set measurement mode and change device operating mode to measure.
46-
if(myUVSensor.startMeasurement(MEAS_MODE_CMD) == false) {
47-
Serial.println("Sensor did not get set properly.");
48-
Serial.println("Spinning...");
49-
while(1);
50-
}
39+
// void setup() {
40+
// Serial.begin(115200);
41+
// while(!Serial){delay(100);};
42+
// Serial.println("UV LED Example.");
5143

52-
Serial.println("Set mode to command.");
44+
// // Initialize sensor and run default setup.
45+
// if(myUVSensor.begin() == false) {
46+
// Serial.println("Sensor failed to begin. Please check your wiring!");
47+
// Serial.println("Spinning...");
48+
// while(1);
49+
// }
5350

54-
}
51+
// Serial.println("Sensor began.");
5552

56-
void loop() {
53+
// // Set measurement mode and change device operating mode to measure.
54+
// if(myUVSensor.startMeasurement(MEAS_MODE_CMD) == false) {
55+
// Serial.println("Sensor did not get set properly.");
56+
// Serial.println("Spinning...");
57+
// while(1);
58+
// }
59+
60+
// Serial.println("Set mode to command.");
61+
62+
// }
63+
64+
// void loop() {
5765

58-
// Send a start measurement command.
59-
if(SFE_BUS_OK != myUVSensor.setStartStateMode(START_STATE_ENABLED))
60-
Serial.println("Error starting reading!");
66+
// // Send a start measurement command.
67+
// if(SFE_BUS_OK != myUVSensor.setStartStateMode(START_STATE_ENABLED))
68+
// Serial.println("Error starting reading!");
6169

62-
// Wait for a bit longer than the conversion time.
63-
delay(2+(1 << myUVSensor.getConfigConversionTime()));
70+
// // Wait for a bit longer than the conversion time.
71+
// delay(2+(1 << myUVSensor.getConfigConversionTime()));
6472

65-
// Read UV values.
66-
if(SFE_BUS_OK != myUVSensor.readAllUV())
67-
Serial.println("Error reading UV.");
73+
// // Read UV values.
74+
// if(SFE_BUS_OK != myUVSensor.readAllUV())
75+
// Serial.println("Error reading UV.");
6876

69-
Serial.print("UVA:");
70-
Serial.print(myUVSensor.measures.uva);
71-
Serial.print(" UVB:");
72-
Serial.print(myUVSensor.measures.uvb);
73-
Serial.print(" UVC:");
74-
Serial.println(myUVSensor.measures.uvc);
77+
// Serial.print("UVA:");
78+
// Serial.print(myUVSensor.measures.uva);
79+
// Serial.print(" UVB:");
80+
// Serial.print(myUVSensor.measures.uvb);
81+
// Serial.print(" UVC:");
82+
// Serial.println(myUVSensor.measures.uvc);
7583

76-
delay(2000);
84+
// delay(2000);
7785

78-
};
86+
// };

0 commit comments

Comments
 (0)