Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Adafruit_LSM303DLHC
Submodule Adafruit_LSM303DLHC added at 3adbf0
114 changes: 0 additions & 114 deletions Adafruit_LSM303_Old/Adafruit_LSM303_Old.cpp

This file was deleted.

124 changes: 0 additions & 124 deletions Adafruit_LSM303_Old/Adafruit_LSM303_Old.h

This file was deleted.

21 changes: 0 additions & 21 deletions Adafruit_LSM303_Old/README.md

This file was deleted.

28 changes: 0 additions & 28 deletions Adafruit_LSM303_Old/examples/Test/Test.ino

This file was deleted.

1 change: 1 addition & 0 deletions Adafruit_Sensor
Submodule Adafruit_Sensor added at e985f2
18 changes: 10 additions & 8 deletions hermes/hermes.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// Raising this raises the vector magnitude needed to reach max (purple),
// and thus lowers sensitivity.
// Eg: 800 = more sensitive, 1600 = less sensitive
#define HERMES_SENSITIVITY 1600.0
#define HERMES_SENSITIVITY 3200.0
// Emulate two strips by starting the crawl in the
// middle of the strip and crawling both ways.
#define ENABLE_SPLIT_STRIP 1
Expand All @@ -48,8 +48,6 @@
// Accel imports.
#include <Wire.h>
#include <Adafruit_LSM303_Old.h>

// Our custom data type.
#include "AccelReading.h"

void setup() {
Expand Down Expand Up @@ -147,9 +145,12 @@ unsigned long lastSignificantMovementTime;
// Initialization.
void accelSetup() {
Serial.println("BEGIN");


lsm.begin();

// Try to initialise and warn if we couldn't detect the chip
if (!lsm.begin()) {
Serial.println("Unable to initialize the LSM303. Check your wiring!");
}
bufferPosition = 0;

// Initialize the full buffer to zero.
Expand Down Expand Up @@ -351,7 +352,7 @@ bool equalReadings(AccelReading a, AccelReading b) {
// color //
///////////

int COLOR_RANGE = 384;
int COLOR_RANGE = 383;
uint32_t lastColor;
unsigned long lastCrawl;
uint32_t lightArray[LED_COUNT];
Expand Down Expand Up @@ -386,7 +387,7 @@ void updateLED() {
//showColor(scale);

if (sleep()) {
breathe(strip);
breathe();
} else {
crawlColor(pixelColor);
}
Expand Down Expand Up @@ -481,6 +482,7 @@ void showColor(float scale) {
// Takes a scale, from 0.0 to 1.0, indicating progression
// through the color rainbow.
uint32_t pixelColorForScale(double scale) {
scale = max(min(scale, 1), 0);
float brightness = MAX_BRIGHTNESS * (scale + MIN_BRIGHTNESS);
int c = COLOR_RANGE * scale; // Intentionally round to an int.

Expand Down Expand Up @@ -636,7 +638,7 @@ void resetBreathe() {
keyframePointer = 0;
}

void breathe(Adafruit_NeoPixel strip) {
void breathe() {
int numKeyframes = sizeof(KEYFRAMES) - 1;
float period = SLEEP_CYCLE_MS / numKeyframes;
unsigned long now = millis();
Expand Down