Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pousseseringue-arduino
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FabLAAS
PousseSeringue
pousseseringue-arduino
Commits
66f44831
Commit
66f44831
authored
1 year ago
by
David Gauchard
Browse files
Options
Downloads
Patches
Plain Diff
consolidate
parent
35a4a31a
No related branches found
No related tags found
1 merge request
!17
Malaurie's work on UI + CLI interface + AccelStepper interface
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
cli.cpp
+2
-2
2 additions, 2 deletions
cli.cpp
motor.h
+4
-4
4 additions, 4 deletions
motor.h
pousseseringue-arduino.cpp
+14
-7
14 additions, 7 deletions
pousseseringue-arduino.cpp
syringe.cpp
+16
-6
16 additions, 6 deletions
syringe.cpp
syringe.h
+1
-0
1 addition, 0 deletions
syringe.h
with
37 additions
and
19 deletions
cli.cpp
+
2
−
2
View file @
66f44831
...
...
@@ -190,7 +190,7 @@ void Cli::loop (Stream& input)
copyNextToTemp
();
}
Serial
.
printf
(
"%sVOL: %g ul (%g mm)
\n
"
,
_msgHeader
.
c_str
(),
syringe
.
confToMm3
(),
syringe
.
confToMm
());
Serial
.
printf
(
"%sVOL: %g ul (%g mm)
(target)
\n
"
,
_msgHeader
.
c_str
(),
syringe
.
confToMm3
(),
syringe
.
confToMm
());
}
else
if
(
kw
(
F
(
"MM"
)))
{
...
...
@@ -203,7 +203,7 @@ void Cli::loop (Stream& input)
copyNextToTemp
();
}
Serial
.
printf
(
"%sVOL: %g ul (%g mm)
\n
"
,
_msgHeader
.
c_str
(),
syringe
.
confToMm3
(),
syringe
.
confToMm
());
Serial
.
printf
(
"%sVOL: %g ul (%g mm)
(target)
\n
"
,
_msgHeader
.
c_str
(),
syringe
.
confToMm3
(),
syringe
.
confToMm
());
}
else
if
(
kw
(
F
(
"DIA"
)))
{
...
...
This diff is collapsed.
Click to expand it.
motor.h
+
4
−
4
View file @
66f44831
...
...
@@ -66,12 +66,15 @@ public:
#if CORE_MOCK
return
0
;
#else
return
stepper
.
currentPosition
();
return
stepper
.
currentPosition
()
*
(
_forwardClockwise
?
1
:
-
1
)
;
#endif
}
void
moveToMm
(
float
mm
)
{
Serial
.
printf
(
"# moving to %g mm / %g steps
\n
"
,
mm
,
mmToStep
(
mm
));
moveToStep
(
mmToStep
(
mm
));
}
...
...
@@ -122,14 +125,11 @@ public:
Serial
.
printf
(
"# %g mm/rev
\n
"
"# %d steps/rev
\n
"
"# %g steps/mm
\n
"
"# position: %ld steps / %g mm
\n
"
"# max speed: %g steps/s %g mm/s
\n
"
"# accel: %g steps/s/s %g mm/s/s
\n
"
,
_mmPerRevolution
,
_stepsPerRevolution
,
_stepsPerRevolution
/
_mmPerRevolution
,
stepper
.
currentPosition
(),
stepToMm
(
stepper
.
currentPosition
()),
stepper
.
maxSpeed
(),
stepToMm
(
stepper
.
maxSpeed
()),
stepper
.
acceleration
(),
...
...
This diff is collapsed.
Click to expand it.
pousseseringue-arduino.cpp
+
14
−
7
View file @
66f44831
...
...
@@ -7,8 +7,12 @@
#undef STAPSK
#ifndef STASSID
#define STASSID ""
#define STAPSK "WifiLAAS2022" // this password is wrong
#define STASSID "laas-capture"
#define STAPSK ""
#endif
#ifndef ARDUINO_ESP8266_ADAFRUIT_HUZZAH
#error select board Adafruit Feather HUZZAH ESP8266
#endif
#define NAME "PousseSeringue"
...
...
@@ -284,13 +288,16 @@ void setup()
uint8_t
mac
[
6
];
WiFi
.
macAddress
(
mac
);
sprintf
(
ssid
,
NAME
"-%02x%02x%02x"
,
mac
[
3
],
mac
[
4
],
mac
[
5
]);
#if 0
if (strlen(STASSID) > 0)
{
WiFi
.
m
ode
(
WIFI_
AP_STA
);
WiFi
.
softAP
(
ssid
);
WiFi
.
begin
(
STASSID
,
STAPSK
);
WiFi.
setPhyM
ode(WIFI_
PHY_MODE_11G
);
WiFi.
mode(WIFI_STA
);
//
WiFi.
softAP(ssid
);
WiFi.hostname(ssid);
WiFi.begin(STASSID, STAPSK);
}
#endif
// redirect everything to my AP ip:
dnsServer
.
setErrorReplyCode
(
DNSReplyCode
::
NoError
);
...
...
@@ -375,6 +382,6 @@ void loop()
}
console
.
loop
(
Serial
);
webLoop
();
dnsServer
.
processNextRequest
();
// access-point redirection
//
webLoop();
//
dnsServer.processNextRequest(); // access-point redirection
}
This diff is collapsed.
Click to expand it.
syringe.cpp
+
16
−
6
View file @
66f44831
...
...
@@ -5,13 +5,17 @@
void
Syringe
::
showConfiguration
(
const
Syringe_configuration_t
&
conf
)
{
Motor
::
showConfiguration
();
auto
step
=
whereStep
();
Serial
.
printf
(
"# diameter: %g mm
\n
"
"# capacity: %g uL
\n
"
"# rate: %g uL/s = %g mm/s
\n
"
"# volume: %g uL
\n
"
"# volume: %g uL
(target)
\n
"
"# direction: %s
\n
"
"# zeroing: %d
\n
"
"# emergency: %d
\n
"
,
"# emergency: %d
\n
"
"# current position: %g mm %g ul %d steps
\n
"
,
conf
.
diameter_mm
,
conf
.
capacity_ul
,
conf
.
rate_ul_per_s
,
...
...
@@ -19,7 +23,8 @@ void Syringe::showConfiguration (const Syringe_configuration_t& conf)
conf
.
volume_value
*
conf
.
volume_unit_ul
,
conf
.
direction
>
0
?
"infuse"
:
"withdraw"
,
conf
.
findZero
,
emergency
());
emergency
(),
stepToMm
(
step
),
mmToMm3
(
stepToMm
(
step
)),
step
);
}
float
Syringe
::
confToMm3
()
const
...
...
@@ -27,14 +32,19 @@ float Syringe::confToMm3 () const
return
current_configuration
.
direction
*
current_configuration
.
volume_value
*
current_configuration
.
volume_unit_ul
;
}
float
Syringe
::
sectionMm2
()
const
{
return
pow
(
current_configuration
.
diameter_mm
/
2
,
2
)
*
M_PI
;
}
float
Syringe
::
mm3ToMm
(
float
mm3
)
const
{
return
mm3
/
(
pow
(
current_configuration
.
diameter_mm
/
2
,
2
)
*
M_PI
);
return
mm3
/
sectionMm2
(
);
}
float
Syringe
::
mmToMm3
(
float
mm
)
const
{
return
mm
*
(
pow
(
current_configuration
.
diameter_mm
/
2
,
2
)
*
M_PI
);
return
mm
*
sectionMm2
(
);
}
float
Syringe
::
confToMm
()
const
...
...
@@ -126,7 +136,7 @@ void Syringe::manageEmergency (bool pressed, bool stepperMoving)
current_configuration
.
findZero
=
false
;
setEmergency
(
false
);
resetPosition
();
Serial
.
printf
(
"
EMERGENCY: danger faded away
\n
"
);
Serial
.
printf
(
"
ZERO: reset
\n
"
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
syringe.h
+
1
−
0
View file @
66f44831
...
...
@@ -59,6 +59,7 @@ public:
float
mmToMm3
(
float
mm
)
const
;
float
confToMm
()
const
;
float
confToMm3
()
const
;
float
sectionMm2
()
const
;
// Actions
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment