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
f3b806d9
Commit
f3b806d9
authored
Nov 22, 2014
by
service-config
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixing
parent
bd440b67
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
28 deletions
+16
-28
brew.ino
brew.ino
+16
-28
No files found.
brew.ino
View file @
f3b806d9
...
@@ -79,7 +79,7 @@ LiquidCrystal_I2C lcd(LCD_I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_
...
@@ -79,7 +79,7 @@ LiquidCrystal_I2C lcd(LCD_I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_
// ++++++++++++++++++++++++ Library - LiquidCrystal_I2C ++++++++++++++++++++++++
// ++++++++++++++++++++++++ Library - LiquidCrystal_I2C ++++++++++++++++++++++++
// ++++++++++++++++++++++++ Rotary Encoder ++++++++++++++++++++++++
// ++++++++++++++++++++++++ Rotary Encoder ++++++++++++++++++++++++
volatile
int
rotaryEncoderVirtualPosition
=
0
;
volatile
int
rotaryEncoderVirtualPosition
=
0
;
//volatile int rotaryEncoderMaxPosition = 120
;
volatile
int
rotaryEncoderMaxPosition
;
volatile
int
menuSize
=
2
;
volatile
int
menuSize
=
2
;
const
int
PinCLK
=
3
;
// Used for generating interrupts using CLK signal
const
int
PinCLK
=
3
;
// Used for generating interrupts using CLK signal
const
int
PinDT
=
22
;
// Used for reading DT signal
const
int
PinDT
=
22
;
// Used for reading DT signal
...
@@ -135,6 +135,7 @@ enum manual_menu_list {
...
@@ -135,6 +135,7 @@ enum manual_menu_list {
manual_temperature
,
manual_temperature
,
manual_time
,
manual_time
,
manual_mode
,
manual_mode
,
manual_mixer
,
manual_start
,
manual_start
,
manual_back
manual_back
};
};
...
@@ -251,32 +252,6 @@ void isr () { // Interrupt service routine is executed when
...
@@ -251,32 +252,6 @@ void isr () { // Interrupt service routine is executed when
break
;
break
;
}
}
case
state_manual_mixer
:
{
if
(
!
digitalRead
(
PinDT
))
{
if
((
interruptTime
-
lastInterruptTime
)
<
10
)
{
rotaryEncoderVirtualPosition
=
(
rotaryEncoderVirtualPosition
+
5
);
}
else
{
rotaryEncoderVirtualPosition
=
(
rotaryEncoderVirtualPosition
+
1
);
}
}
else
{
if
((
interruptTime
-
lastInterruptTime
)
<
10
)
{
rotaryEncoderVirtualPosition
=
(
rotaryEncoderVirtualPosition
-
5
);
}
else
{
rotaryEncoderVirtualPosition
=
(
rotaryEncoderVirtualPosition
-
1
);
}
}
if
(
rotaryEncoderVirtualPosition
>
mixerMaxSpeed
)
{
rotaryEncoderVirtualPosition
=
mixerMaxSpeed
;
}
if
(
rotaryEncoderVirtualPosition
<
0
)
{
rotaryEncoderVirtualPosition
=
0
;
}
break
;
}
default:
{
default:
{
}
}
...
@@ -321,7 +296,7 @@ void setup() {
...
@@ -321,7 +296,7 @@ void setup() {
// ++++++++++++++++++++++++ Heating Element Relay ++++++++++++++++++++++++
// ++++++++++++++++++++++++ Heating Element Relay ++++++++++++++++++++++++
// ++++++++++++++++++++++++ Mixer ++++++++++++++++++++++++
// ++++++++++++++++++++++++ Mixer ++++++++++++++++++++++++
pinMode
(
mixerPin
,
OUTPUT
);
pinMode
(
mixerPin
,
OUTPUT
);
analogWrite
(
mixerPin
,
mixerSpeed
);
analogWrite
(
mixerPin
,
0
);
// ++++++++++++++++++++++++ Mixer ++++++++++++++++++++++++
// ++++++++++++++++++++++++ Mixer ++++++++++++++++++++++++
// ++++++++++++++++++++++++ Temperature Sensor PT100 ++++++++++++++++++++++++
// ++++++++++++++++++++++++ Temperature Sensor PT100 ++++++++++++++++++++++++
analogReference
(
EXTERNAL
);
analogReference
(
EXTERNAL
);
...
@@ -856,6 +831,7 @@ void runStart() {
...
@@ -856,6 +831,7 @@ void runStart() {
unsigned
long
runStartTime
;
unsigned
long
runStartTime
;
unsigned
long
runTargetTime
;
unsigned
long
runTargetTime
;
cook_mode_list
runCurrentMode
;
cook_mode_list
runCurrentMode
;
unsigned
long
runMixerSpeed
;
// Configure environment
// Configure environment
boolean
clockStart
=
false
;
boolean
clockStart
=
false
;
...
@@ -876,7 +852,16 @@ void runStart() {
...
@@ -876,7 +852,16 @@ void runStart() {
// check if time ended and is time to stop and return to menu
// check if time ended and is time to stop and return to menu
if
(
clockStart
&&
clockEnd
)
{
if
(
clockStart
&&
clockEnd
)
{
// Turn mixer OFF for safety
analogWrite
(
mixerPin
,
0
);
// Turn heading element OFF for safety
digitalWrite
(
HEATING_ELEMENT
,
LOW
);
// Pause for efect
delay
(
1000
);
delay
(
1000
);
return
;
return
;
}
}
...
@@ -987,6 +972,9 @@ void runStart() {
...
@@ -987,6 +972,9 @@ void runStart() {
Serial.print(Rx, 6);
Serial.print(Rx, 6);
*/
*/
// Operate mixer
analogWrite
(
mixerPin
,
runMixerSpeed
);
// Operate the heating element
// Operate the heating element
Input
=
runCurrentTemperature
;
Input
=
runCurrentTemperature
;
Setpoint
=
runTargetTemperature
;
Setpoint
=
runTargetTemperature
;
...
...
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