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.
Dependencies: mbed
Diff: inc/globals.h
- Revision:
- 8:d3d7dca419b3
- Parent:
- 7:860b3a8275cb
- Child:
- 9:816b9a4e4f21
--- a/inc/globals.h Wed Dec 05 00:20:34 2018 +0000 +++ b/inc/globals.h Thu Dec 06 16:22:11 2018 +0000 @@ -42,11 +42,35 @@ #define GET FALSE #define SET TRUE +#define NO_PROMPT FALSE +#define WITH_PROMPT TRUE + #define ON 1 #define OFF 0 #define UPDATE_REFRESH_DELAY_US 500000.0 +#define ADC_SCALE_FACTOR 32767.0 +#define VOLTAGE_TARG_VALUE 1.65 +#define VOLTAGE_ACTUAL_VALUE 1.52 +const double VOLTAGE_CORRECTION = VOLTAGE_TARG_VALUE/VOLTAGE_ACTUAL_VALUE/ADC_SCALE_FACTOR; +const double VOLTAGE_48_FACTOR = 48.0*VOLTAGE_CORRECTION; +const double VOLTAGE_24_FACTOR = 24.0*VOLTAGE_CORRECTION; +const double VOLTAGE_12_FACTOR = 12.0*VOLTAGE_CORRECTION; + +#define CURRENT_ACTUAL_VALUE 1.7091 +#define CURRENT_TARG_VALUE 1.65 +//const double CURRENT_OFFSET = (CURRENT_ACTUAL_VALUE/CURRENT_TARG_VALUE)*ADC_SCALE_FACTOR; +const double CURRENT_48_OFFSET = 33940; +const double CURRENT_24_OFFSET = 33580; +const double CURRENT_12_OFFSET = 33380; +//#define CURRENT_OFFSET 33940 +//#define CURRENT_DIV_FACTOR -390 +#define CURRENT_48_DIV_FACTOR -368 +#define CURRENT_24_DIV_FACTOR -308 +#define CURRENT_12_DIV_FACTOR -324 +#define CURRENT_CONTROL_OFFSET 0.25 + #define DATA_ROW 1 #define BOARD_ENABLE_DELAY_MS 50