![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
for learning
setting.h
- Committer:
- jobuuu
- Date:
- 2019-08-20
- Revision:
- 7:e9086c72bb22
- Parent:
- 5:a4319f79457b
- Child:
- 11:82d8768d7351
File content as of revision 7:e9086c72bb22:
#include "mbed.h" #include "FastPWM.h" #define PI 3.141592 // pwm #define PIN_V PB_7 #define PIN_W PB_6 //#define PWM_ARR 0x465 // loop 80k, pwm 40k //#define PWM_ARR 0x8CA // loop 40k, pwm 20k #define PWM_ARR 0x1194 // loop 20k, pwm 10k //#define PWM_ARR 0x2328 // loop 10k, pwm 5k #define FREQ_5k 5000.0 #define FREQ_10k 10000.0 #define FREQ_20k 20000.0 #define FREQ_40k 40000.0 #define DT_5k 0.0002 #define DT_10k 0.0001 #define DT_20k 0.00005 #define DT_40k 0.000025 extern DigitalOut check; extern DigitalOut check_2; extern AnalogOut dac_1; extern AnalogOut dac_2; extern double dtc_v; extern double dtc_w; // I2C extern I2C i2c; // SDA, SCL (for K22F) extern const int i2c_slave_addr1; extern unsigned int value; // 10bit output of reading sensor AS5510 // SPI extern SPI eeprom; //(SPI_MOSI, SPI_MISO, SPI_SCK); extern DigitalOut eeprom_cs; extern SPI enc; extern DigitalOut enc_cs; // UART extern Serial pc; //Serial pc(PA_9,PA_10); _ UART // CAN extern CAN can; extern CANMessage msg; // Board Information // User Function void CurrentControl(); void ValveControl(unsigned int ControlMode);