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.
dis_exp.h
- Committer:
- fionalin
- Date:
- 2022-06-28
- Revision:
- 0:4e3ad938564e
- Child:
- 2:d9745be6c253
File content as of revision 0:4e3ad938564e:
#pragma once #include "stepper.h" #include "capsense.h" #include <vector> #include <tuple> class DiscreteExperiment { public: DiscreteExperiment(StepperMotor& motor, CapSense& capsense, int32_t n_measure, uint32_t t_measure_us, int32_t delta_steps, int32_t max_steps); void proceed(); bool is_done(); std::vector<std::tuple<int32_t, long>>& report(); /*steps instead of dis */ void start(); void reset(); private: enum State { IDLE, MOVING, MEASURING, DONE }; private: StepperMotor& motor; CapSense& capsense; int32_t n_measure; uint32_t t_measure_us; int32_t delta_steps; int32_t max_steps; std::vector<std::tuple<int32_t, long>> data; State state; int32_t move_counter; int32_t measu_counter; int32_t steps_taken; };