Skip to content
Merged
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ The following variables at the top of the shotStopper.ino file can be configured
`REEDSWITCH`
* true if a reed switch on the brew solenoid is being used to determine the brew state. This is typically not necessary so set to FALSE by default. This feature is only available for non-momentary-switches.

`AUTOTARE`
* true by default. The scale will automatically tare when the shot is started, and, if MOMENTARY is false, will perform another tare at 3 seconds to notify the user that the switch is latched and should be returned to the home position.
* if set to false, the shotStopper will never send a tare command. It is the user's responsibility to tare before each shot. This may be helpful if the scale is not stable when the shot begins, and thus the scale is unable to tare reliably.

## Demo

You can find a demo on Youtube:
Expand Down
11 changes: 9 additions & 2 deletions examples/shotStopper/shotStopper.ino
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
// false for latching switches such as Linea Mini/Micra
#define REEDSWITCH false // Set to true if the brew state is being determined
// by a reed switch attached to the brew solenoid
#define AUTOTARE true // Automatically tare when shot is started
// and 3 seconds after a latching switch brew
// (as defined by MOMENTARY)
//***************

#define BUTTON_STATE_ARRAY_LENGTH 31
Expand Down Expand Up @@ -229,7 +232,9 @@ void loop() {
Serial.println("Button Latched");
digitalWrite(out,HIGH); Serial.println("wrote high");
// Get the scale to beep to inform user.
scale.tare();
if(AUTOTARE){
scale.tare();
}
}

//button released
Expand Down Expand Up @@ -309,7 +314,9 @@ void setBrewingState(bool brewing){
shot.shotTimer = 0;
shot.datapoints = 0;
scale.startTimer();
scale.tare();
if(AUTOTARE){
scale.tare();
}
Serial.println("Weight Timer End");
}else{
Serial.print("ShotEnded by ");
Expand Down