Skip to content

Commit

Permalink
switched to faster servos that needed roughly double the target angle
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Igo committed Apr 26, 2015
1 parent 4f6fbc6 commit 660c786
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
8 changes: 0 additions & 8 deletions arduino/DeskAttendant/DeskAttendant.ino
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ unsigned long turned_on_at = 0L;
Button pressers press the momentary switches on the treadmill and the A/V receiver.
*/
boolean take_action = true; // affect the treadmill, press buttons, and fire relays if true; otherwise just change status LEDs
ButtonPresser receiver_power("RECEIVER POWER", receiver_button_servo_pin, receiver_servo_delay, receiver_servo_starting_angle, receiver_servo_target_angle);

/*
Treadmill and subclasses let you control a treadmill by turning it on or off.
Expand Down Expand Up @@ -154,11 +153,6 @@ void status_communication_setup() {
rgb_blink();
}

// Initialize the ButtonPresser for the A/V receiver.
void button_presser_setup() {
receiver_power.setup();
}

// Prepare the fan relay to be controlled by pin fan_relay_pin.
void fan_relay_setup() {
// this pin can throw the relay that lets power go to the fan
Expand All @@ -183,7 +177,6 @@ void setup() {
// If we're configured to act on changes in walker status, initialize the A/V receiver's button presser
// and set up the Treadmill object for use.
if (take_action) {
button_presser_setup();

// Prepare the fan relay to be controlled by pin fan_relay_pin.
fan_relay_setup();
Expand Down Expand Up @@ -299,7 +292,6 @@ void process_status_loop() {
Serial.println(on);
}
if ((*treadmill).set_state(on)) { // this may or may not succeed due to the underlying hardware
receiver_power.toggle_button();
set_fan_relay(on);
status = new_status;
turned_on_at = millis();
Expand Down
6 changes: 3 additions & 3 deletions arduino/libraries/SoleF85Treadmill/SoleF85Treadmill.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ const int STOP_button_servo_pin = 10;
const int servo_starting_angle = 0;

// the START button's servo moves to this angle and back to servo_starting_angle
const int START_servo_target_angle = 10;
const int START_servo_target_angle = 20;

// the STOP button's servo moves to this angle and back to servo_starting_angle
const int STOP_servo_target_angle = 8;
const int STOP_servo_target_angle = 26;

// for each degree moved, wait this many ms to ensure that the servo actually reaches the target position
const int ms_per_degree_delay = 12;
const int ms_per_degree_delay = 6;

const int START_servo_delay = ms_per_degree_delay * (START_servo_target_angle - servo_starting_angle);
const int STOP_servo_delay = ms_per_degree_delay * (STOP_servo_target_angle - servo_starting_angle);
Expand Down

0 comments on commit 660c786

Please sign in to comment.