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: dis_exp.h
- Revision:
- 2:d9745be6c253
- Parent:
- 0:4e3ad938564e
--- a/dis_exp.h Tue Jul 12 13:02:25 2022 -0400 +++ b/dis_exp.h Thu Aug 04 15:14:29 2022 -0400 @@ -2,17 +2,22 @@ #include "stepper.h" #include "capsense.h" +#include <cstdint> #include <vector> #include <tuple> +#include "Adafruit_MPR121.h" class DiscreteExperiment { public: - DiscreteExperiment(StepperMotor& motor, CapSense& capsense, + DiscreteExperiment(StepperMotor& motor, Adafruit_MPR121& mpr121, 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 */ + /** + * Returns a vector of tuples of (steps, tau in microseconds) + */ + std::vector<std::tuple<int32_t, uint32_t>>& report(); /*steps instead of dis */ void start(); void reset(); @@ -26,14 +31,14 @@ private: StepperMotor& motor; - CapSense& capsense; + Adafruit_MPR121& mpr121; 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; + std::vector<std::tuple<int32_t, uint32_t>> data; State state; int32_t move_counter;