Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 6:b1b74d1f8fab
- Parent:
- 5:fe1e88d6b0cb
- Child:
- 7:dd26474d5705
--- a/main.cpp Wed Feb 20 18:43:15 2019 +0000
+++ b/main.cpp Wed Feb 20 21:55:53 2019 +0000
@@ -212,7 +212,7 @@
bool latchCutter=tortilla.getCutter();
bool latchGriddle=tortilla.getGriddle();
bool latchOven=tortilla.getOven();
- bool latchProduction=tortilla.getTortilla();
+ //bool latchProduction=tortilla.getTortilla();
int END=tortilla.check();
if((END==1)&&(latchExtruder!=tortilla.getExtruder()))
pc.printf("\n..........Extruder END..........\r\n");
@@ -222,8 +222,9 @@
pc.printf("\n..........Griddle END..........\r\n");
else if((END==4)&&(latchOven!=tortilla.getOven()))
pc.printf("\n..........Oven END..........\r\n");
- else if((END==5)&&(latchProduction!=tortilla.getTortilla()))
+ else if(END==20000){
pc.printf("\n!!..........FULL PRODUCTION END..........!!\r\n");
+ }//else if
#else
tortilla.check();
#endif
@@ -232,10 +233,9 @@
void ExtruderProduction(void){
if((extruder.getTimer()>=EXTRUDER_CYCLE)&&(extruder.getPosition()<0.1)){
+ int addTime=GENERAL_TIME+CUTTER_WAIT_TIMER;
if(tortilla.getExtruderCount()==0)
- int addTime=GENERAL_TIME+CUTTER_WAIT_TIMER+CUTTER_FIRST_TIME;
- else
- int addTime=GENERAL_TIME+CUTTER_WAIT_TIMER;
+ addTime=addTime+CUTTER_FIRST_TIME;
tortilla.setCutterTrigger(tortilla.getExtruderCount(),addTime);
extruder.setTimer(0);
extruder.Step();
@@ -256,12 +256,11 @@
void CutterProduction(void){
int cutterMomentum=tortilla.getCutterTrigger(tortilla.getCutterCount());
if((cutterMomentum<=GENERAL_TIME)&&(cutterMomentum!=0)){
+ int addTime=GENERAL_TIME+GRIDDLE_WAIT_TIMER;
if(tortilla.getCutterCount()==0)
- int addTime=GENERAL_TIME+GRIDDLE_WAIT_TIMER+GRIDDLE_FIRST_TIME;
- else
- int addTime=GENERAL_TIME+GRIDDLE_WAIT_TIMER;
+ addTime=addTime+GRIDDLE_FIRST_TIME;
+ tortilla.setGriddleTrigger(tortilla.getCutterCount(),addTime);
cutter.cutt();
- tortilla.setGriddleTrigger(tortilla.getCutterCount(),addTime);
tortilla.addCutter();
#if defined(DEBUG_MODE)
pc.printf("Cutted tortilla number:%d\r\n",tortilla.getCutterCount());
@@ -273,10 +272,9 @@
void GriddleProduction(void){
int griddleMomentum=tortilla.getGriddleTrigger(tortilla.getGriddleCount());
if((griddleMomentum<=GENERAL_TIME)&&(griddleMomentum!=0)){
+ int addTime=GENERAL_TIME+OVEN_WAIT_TIMER;
if(tortilla.getGriddleCount()==0)
- int addTime=GENERAL_TIME+OVEN_WAIT_TIMER+OVEN_FIRST_TIME;
- else
- int addTime=GENERAL_TIME+OVEN_WAIT_TIMER;
+ addTime=addTime+OVEN_FIRST_TIME;
tortilla.setOvenTrigger(tortilla.getGriddleCount(),addTime);
griddle.press();
tortilla.addGriddle();