Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
B
brew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
João Lino
brew
Commits
9f46351c
Commit
9f46351c
authored
Jun 22, 2017
by
João Lino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
press button to enter menu
cleanup
parent
b341fe27
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
180 additions
and
286 deletions
+180
-286
CustomDataStructures.h
CustomDataStructures.h
+9
-1
Display.cpp
Display.cpp
+13
-0
Display.h
Display.h
+2
-1
Temperature.cpp
Temperature.cpp
+2
-2
Temperature.h
Temperature.h
+9
-9
brew.h
brew.h
+11
-5
brew.ino
brew.ino
+133
-268
config.h
config.h
+1
-0
No files found.
CustomDataStructures.h
View file @
9f46351c
...
...
@@ -24,8 +24,8 @@ enum eMenuType {
};
enum
eMainMenuOptions
{
eMainMenu_NULL
,
eMainMenu_GO_FROM_STAGE
,
eMainMenu_GO
,
eMainMenu_GO_FROM_STAGE
,
eMainMenu_STOP
,
eMainMenu_SKIP
,
eMainMenu_BeerProfile
,
...
...
@@ -110,4 +110,12 @@ enum eBeerProfile {
eBeerProfile_Custom
};
typedef
struct
menuData_
{
char
*
_title
;
int
_position
;
int
_selection
;
char
**
_dialog
;
bool
_repaint
;
}
MenuData
;
#endif
Display.cpp
View file @
9f46351c
...
...
@@ -164,6 +164,19 @@ boolean displayStatus(LiquidCrystal_I2C *lcd, boolean cooking, float cookTempera
return
ret
;
}
boolean
displayGenericMenu
(
LiquidCrystal_I2C
*
lcd
,
MenuData
*
data
)
{
boolean
repaintRequired
=
data
->
_repaint
;
if
(
repaintRequired
)
{
lcd
->
clear
();
lcd
->
home
();
// go home
lcd
->
print
(
data
->
_title
);
lcd
->
setCursor
(
0
,
1
);
// go to start of 2nd line
lcd
->
print
((
data
->
_dialog
)[
data
->
_position
]);
repaintRequired
=
false
;
}
return
repaintRequired
;
}
boolean
displayMainMenu
(
LiquidCrystal_I2C
*
lcd
,
eMainMenuOptions
position
,
boolean
repaint
)
{
boolean
ret
=
repaint
;
...
...
Display.h
View file @
9f46351c
...
...
@@ -22,10 +22,11 @@ void xPaintStatusTemplate(LiquidCrystal_I2C *lcd, boolean cooking);
boolean
displayStatus
(
LiquidCrystal_I2C
*
lcd
,
boolean
cooking
,
float
cookTemperature
,
float
baseTemperature
,
float
upTemperature
,
float
downTemperature
,
unsigned
long
clockCounter
,
boolean
repaint
);
boolean
displayGenericMenu
(
LiquidCrystal_I2C
*
lcd
,
MenuData
*
data
);
boolean
displayMainMenu
(
LiquidCrystal_I2C
*
lcd
,
eMainMenuOptions
position
,
boolean
repaint
);
boolean
displayBeerProfileMenu
(
LiquidCrystal_I2C
*
lcd
,
eBeerProfileMenuOptions
position
,
boolean
repaint
);
boolean
displayStageMenu
(
LiquidCrystal_I2C
*
lcd
,
eStageMenuOptions
position
,
boolean
repaint
);
boolean
displayMaltMenu
(
LiquidCrystal_I2C
*
lcd
,
eMaltMenuOptions
position
,
boolean
repaint
);
boolean
displaySettingsMenu
(
LiquidCrystal_I2C
*
lcd
,
eSettingsMenuOptions
position
,
boolean
repaint
);
#endif
\ No newline at end of file
#endif
Temperature.cpp
View file @
9f46351c
...
...
@@ -6,7 +6,7 @@
#include "Arduino.h"
#include "Temperature.h"
Temperature
::
Temperature
(
char
*
name
,
Temperature
::
Temperature
(
c
onst
c
har
*
name
,
int
OutputPin_SensorPower
,
int
InputPin_TemperatureReading
,
int
TimeBetweenReadings
,
...
...
@@ -184,4 +184,4 @@ float Temperature::setPumpStatus( bool pump ) {
_pump
=
pump
;
return
_pump
;
}
\ No newline at end of file
}
Temperature.h
View file @
9f46351c
...
...
@@ -23,7 +23,7 @@ class Temperature
{
public:
// Temperature(Temperature_OUTPUT_PIN, Temperature_INPUT_PIN, Temperature_TIME_BETWEEN_READINGS, Temperature_DEFAULT_ADC_VMAX, Temperature_DEFAULT_VS, Temperature_DEFAULT_R1_RESISTENCE, Temperature_DEFAULT_LINE_RESISTENCE, Temperature_DEFAULT_OPERATION_RESISTENCE);
Temperature
(
char
*
name
,
Temperature
(
c
onst
c
har
*
name
,
int
OutputPin_SensorPower
,
int
InputPin_TemperatureReading
,
int
TimeBetweenReadings
,
...
...
@@ -40,19 +40,19 @@ class Temperature
float
setPumpStatus
(
bool
pump
);
private:
c
har
*
_name
;
int
_OutputPin_SensorPower
;
int
_InputPin_TemperatureReading
;
int
_TimeBetweenReadings
;
c
onst
char
*
_name
;
int
_OutputPin_SensorPower
;
int
_InputPin_TemperatureReading
;
int
_TimeBetweenReadings
;
float
_m1
;
float
_m2
;
float
_b1
;
float
_b2
;
float
_temperatureAverage
;
float
_measuredTemperature
;
float
_measuredTemperatureDeviation
;
bool
_pump
;
float
_temperatureAverage
;
float
_measuredTemperature
;
float
_measuredTemperatureDeviation
;
bool
_pump
;
unsigned
long
_lastTemperatureRead
;
int
_VoutAnalogSample
;
int
_VoutRAnalogSample
;
...
...
brew.h
View file @
9f46351c
...
...
@@ -21,7 +21,11 @@ void runStageSelection();
void
runBeerProfileSelection
();
void
runStartFromStageSelection_Processor
(
unsigned
long
*
stageTime
,
int
*
stageTemperature
,
eCookingStages
nextStage
);
void
xStartStage
(
unsigned
long
*
stageTime
,
int
*
stageTemperature
,
eCookingStages
nextStage
,
bool
bPurgePump
,
bool
bSetFinalYield
,
bool
bSetTime
,
bool
bSetTemperature
);
void
xStartStageHeadless
(
eCookingStages
nextStage
,
bool
bPurgePump
);
void
xStartStageInteractive
(
unsigned
long
*
stageTime
,
int
*
stageTemperature
,
eCookingStages
nextStage
);
void
runStartFromStageSelection
();
...
...
@@ -43,9 +47,9 @@ void xWarnClockEnded();
void
xWarnCookEnded
();
void
x
StageFirstRun
(
int
stageTime
,
int
stageTemperature
,
int
stagePumpSpeed
,
eCookingStages
stage
);
void
x
PrepareForStage
(
int
stageTime
,
int
stageTemperature
,
int
stagePumpSpeed
,
eCookingStages
stage
);
void
xSetup
GlobalVariablesFor
Stage
(
eCookingStages
nextStage
);
void
xSetupStage
(
eCookingStages
nextStage
);
void
xTransitionIntoStage
(
eCookingStages
nextStage
);
...
...
@@ -71,16 +75,18 @@ int getTimer( int initialValue );
int
getTemperature
(
int
initialValue
);
int
xSetGenericValue
(
int
initialValue
,
int
minimumValue
,
int
maximumValue
,
c
har
*
valueName
,
char
*
unit
);
int
xSetGenericValue
(
int
initialValue
,
int
minimumValue
,
int
maximumValue
,
c
onst
char
*
valueName
,
const
char
*
unit
);
int
xSetTemperature
(
int
initialValue
);
int
xSetFinalYield
(
int
initialValue
);
unsigned
long
getInactivityTime
();
// ###################### Set Variables ##################################################
void
xWaitForAction
(
String
title
,
String
message
);
boolean
gotButtonPress
(
int
iPin
);
#endif //__BREW
\ No newline at end of file
#endif //__BREW
brew.ino
View file @
9f46351c
This diff is collapsed.
Click to expand it.
config.h
View file @
9f46351c
...
...
@@ -78,6 +78,7 @@
#define ROTARY_ENCODER_DT_PIN 22 // Used for reading DT signal
#define ROTARY_ENCODER_SW_PIN 23 // Used for the push button switch
#define ROTARY_ENCODER_DEBOUNCE_TIME 50 //20 // Number of miliseconds to ignore new signals a signal is received
#define ROTARY_ENCODER_SW_DEBOUNCE_TIME 10 //20 // Number of miliseconds to ignore new signals a signal is received
// ++++++++++++++++++++++++ State Machine ++++++++++++++++++++++++
#define SETTING_WELCOME_TIMEOUT 100
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment