Skip to content
Snippets Groups Projects
Commit a63a5100 authored by Malaurie Bernard's avatar Malaurie Bernard
Browse files

Changing pousse-seringue.cpp to make it fit new class and methods.

parent 972a27ae
No related branches found
No related tags found
1 merge request!17Malaurie's work on UI + CLI interface + AccelStepper interface
......@@ -56,6 +56,7 @@ SSD1306AsciiWire oled;
#include "motor.h"
#include "Debouncer.h" // local, debouncer, short counter, long detector
#include "syringe.h"
#include "syringefilled.h"
#include "cli.h"
#include "common.h"
#include "fs.h"
......@@ -88,8 +89,8 @@ float stepsPerSeconds2rpm () { return 60.0 * stepsPerSeconds / (MOTOR_STEPS * MI
int rpming = 0; // -1, 0 or +1
// single syringe global instance
Syringe syringe(stepper);
Cli console(syringe);
SyringeFilled syringefilled(stepper);
Cli console(syringe_filled);
const char* oledMode ()
{
......@@ -178,7 +179,7 @@ void buttons (int shortp, int longp)
// log debug on serial console
Serial.printf("button change: short:%d long:%d\n", shortp, longp);
syringe.stop();
syringe_filled.stop();
auto oldrpming = rpming;
rpming = 0; // anything stops rpming
......@@ -272,7 +273,7 @@ void setup()
oled.println("Booting...\n");
//syringe.setPhysical(MOTOR_STEPS * MICROSTEPS_CONF, M4_MMREV, /*forwardClockWise*/true, /*emergencySensorBehind*/false);
syringe.setPhysical(MOTOR_STEPS * MICROSTEPS_CONF, M5_MMREV, /*forwardClockWise*/false, /*emergencySensorBehind*/true);
syringe_filled.setPhysical(MOTOR_STEPS * MICROSTEPS_CONF, M5_MMREV, /*forwardClockWise*/false);
pinMode(SLEEP, OUTPUT);
digitalWrite(SLEEP, 0);
......@@ -354,7 +355,7 @@ void loop()
{
if (bEmergency.update(digitalRead(COURSE)))
{
syringe.manageEmergency(bEmergency.pressed(), !!stepper.distanceToGo());
syringefilled.manage_emergency(bEmergency.pressed(), !!stepper.distanceToGo());
Serial.printf("%sEmergency=%u (remaining steps = %lu)\n", msgHeader, bEmergency.pressed(), stepper.distanceToGo());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment