Use IQS62X sensor and move motor by detected angle
Dependencies: DRV8830 IQS62x IQSDisplayTerminal UIT_ACM1602NI mbed
Fork of Nucleo_ACM1602_I2C_DC by
MotorMove.h@12:8464be95bf76, 2018-01-30 (annotated)
- Committer:
- 8mona
- Date:
- Tue Jan 30 06:55:27 2018 +0000
- Revision:
- 12:8464be95bf76
- Parent:
- 9:b58e7d72a91c
Up version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
8mona | 8:f7ad1d7176ba | 1 | #include "mbed.h" |
8mona | 8:f7ad1d7176ba | 2 | //#include "DRV8830.h" |
8mona | 8:f7ad1d7176ba | 3 | |
8mona | 8:f7ad1d7176ba | 4 | |
8mona | 8:f7ad1d7176ba | 5 | #define ACCEL_SIZE 6 |
8mona | 8:f7ad1d7176ba | 6 | #define DECEL_SIZE 6 |
8mona | 8:f7ad1d7176ba | 7 | #define LIMIT_TIME 30 |
8mona | 8:f7ad1d7176ba | 8 | |
8mona | 8:f7ad1d7176ba | 9 | class MotorMove{ |
8mona | 8:f7ad1d7176ba | 10 | |
8mona | 8:f7ad1d7176ba | 11 | public: |
8mona | 8:f7ad1d7176ba | 12 | //DRV8830 motor; //Motor |
8mona | 8:f7ad1d7176ba | 13 | float vol_decel[DECEL_SIZE]; |
8mona | 8:f7ad1d7176ba | 14 | float vol_accel[ACCEL_SIZE]; |
8mona | 8:f7ad1d7176ba | 15 | float down_ratio; |
8mona | 9:b58e7d72a91c | 16 | int bflag_up; |
8mona | 9:b58e7d72a91c | 17 | int bflag_down; |
8mona | 8:f7ad1d7176ba | 18 | |
8mona | 8:f7ad1d7176ba | 19 | |
8mona | 8:f7ad1d7176ba | 20 | |
8mona | 9:b58e7d72a91c | 21 | void up_motor_set (int time_counter, float speed); |
8mona | 9:b58e7d72a91c | 22 | void down_motor_set (int time_counter, float speed); |
8mona | 8:f7ad1d7176ba | 23 | float ReturnMotorVol(int time_counter, int sw_flag1,int sw_flag2); |
8mona | 8:f7ad1d7176ba | 24 | |
8mona | 8:f7ad1d7176ba | 25 | private: |
8mona | 8:f7ad1d7176ba | 26 | int start_time_count; |
8mona | 8:f7ad1d7176ba | 27 | float Voltage; |
8mona | 9:b58e7d72a91c | 28 | int accel_count; |
8mona | 9:b58e7d72a91c | 29 | int decel_count; |
8mona | 8:f7ad1d7176ba | 30 | |
8mona | 8:f7ad1d7176ba | 31 | }; |
8mona | 8:f7ad1d7176ba | 32 | |
8mona | 8:f7ad1d7176ba | 33 |