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
Binary file removed .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .gitignore/.gitignore → .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
Thumbs.db
19 changes: 14 additions & 5 deletions BowieLights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,35 @@ void BowieLights::dimLights() {
}

void BowieLights::setLight(uint8_t led_num, uint8_t val) {
if(led_num == 0) {
switch (led_num) {
case 0:
analogWrite(BRIGHT_LED_FRONT_LEFT, val);
led_val[0] = val;
} else if(led_num == 1) {
break;
case 1:
analogWrite(BRIGHT_LED_FRONT_RIGHT, val);
led_val[1] = val;
} else if(led_num == 2) {
break;
case 2:
analogWrite(BRIGHT_LED_BACK_LEFT, val);
led_val[2] = val;
} else if(led_num == 3) {
break;
case 3:
analogWrite(BRIGHT_LED_BACK_RIGHT, val);
led_val[3] = val;
} else if(led_num == 99) {
break;
case 99:
analogWrite(BRIGHT_LED_FRONT_LEFT, val);
analogWrite(BRIGHT_LED_BACK_LEFT, val);
analogWrite(BRIGHT_LED_FRONT_RIGHT, val);
analogWrite(BRIGHT_LED_BACK_RIGHT, val);
for(int i=0; i<4; i++) {
led_val[i] = val;
}
break;
default:
Serial.println("ERROR: Undefined led_num specified");
break;
}
}

Expand Down
14 changes: 10 additions & 4 deletions BowieScoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ void BowieScoop::servoInterruption(int key, int val) {
void BowieScoop::updateScoopProbes() {
scoop_probe_left_val = digitalRead(SCOOP_PROBE_LEFT);
scoop_probe_right_val = digitalRead(SCOOP_PROBE_RIGHT);
//Serial << "Scoop probes- L: " << scoop_probe_left_val;
//Serial << "Scoop probes- R: " << scoop_probe_right_val << endl;
#ifdef SERVO_DEBUG:
Serial << "Scoop probes- L: " << scoop_probe_left_val;
Serial << "Scoop probes- R: " << scoop_probe_right_val << endl;
#endif
}

bool BowieScoop::getScoopProbeL() {
Expand All @@ -80,15 +82,19 @@ void BowieScoop::moveEnd(int endPos, int step, int del) {
int prev_pos = getEndPos();
if(prev_pos > endPos) { // going towards END_MIN
for(int i=prev_pos; i>endPos; i-=step) {
//Serial << "S" << i << endl;
#ifdef SERVO_DEBUG
Serial << "S" << i << endl;
#endif
scoop.writeMicroseconds(i);
end_position = i;
delay(del);
servoInterruption(SERVO_END_KEY, i);
}
} else if(prev_pos <= endPos) { // going towards END_MAX
for(int i=prev_pos; i<endPos; i+=step) {
//Serial << "S" << i << endl;
#ifdef SERVO_DEBUG
Serial << "S" << i << endl;
#endif
scoop.writeMicroseconds(i);
end_position = i;
delay(del);
Expand Down
3 changes: 3 additions & 0 deletions BowieScoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#ifndef _BOWIESCOOP_H_
#define _BOWIESCOOP_H_

// optional servo positional debugging
#define SERVO_DEBUG False

// Servo positions
#define END_MIN 700 // up
#define END_PARALLEL_TOP 2300 // parallel to ground when arm is raised, raised a bit to keep debris in
Expand Down