Skip to content

Commit

Permalink
fixed bugs in example, added poll to usage
Browse files Browse the repository at this point in the history
  • Loading branch information
seancaulfield committed Jun 22, 2016
1 parent 0e989ad commit 5bb5f60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Pretty straightforward; see the example sketch for a detailed test.
// Do something intelligent if the sensor isn't found
}

// Poll sensor
my_veml6075.poll();

// Get "raw" UVA and UVB counts, with the dark current removed
uint16_t uva = my_veml6075.getUVA();
uint16_t uvb = my_veml6075.getUVB();
Expand Down
15 changes: 9 additions & 6 deletions examples/test-veml6075/test-veml6075.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,29 @@ void setup() {
void loop() {

if (found) {
uint16_t value;
float value;

// Poll sensor
veml6075.poll();

Serial.print(F("t = "));
Serial.println(millis());

value = veml6075.getUVA();
Serial.print(F("UVA = "));
Serial.println(value);
Serial.println(value, 2);

value = veml6075.getUVB();
Serial.print(F("UVB = "));
Serial.println(value);
Serial.println(value, 2);

value = veml6075.getUVIndex();
Serial.print(F("UV Index = "));
Serial.println(value);
Serial.println(value, 1);

value = veml6075.getDevID();
uint16_t devid = veml6075.getDevID();
Serial.print(F("Device ID = "));
Serial.println(value, HEX);
Serial.println(devid, HEX);

Serial.println(F("----------------"));
}
Expand Down

0 comments on commit 5bb5f60

Please sign in to comment.