Merge pull request #1 from nightflyer88/beta

V1.1, supports ESP8266
This commit is contained in:
nightflyer88 2019-02-02 18:20:23 +01:00 committed by GitHub
commit 40457d3e47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 1202 additions and 129 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
data/airplane.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
data/battery.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

BIN
data/bootstrap.min.css.gz Executable file

Binary file not shown.

BIN
data/bootstrap.min.js.gz Executable file

Binary file not shown.

BIN
data/cg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
data/cglr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
data/home.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
data/index.html.gz Executable file

Binary file not shown.

Binary file not shown.

BIN
data/models.html.gz Executable file

Binary file not shown.

BIN
data/settings.html.gz Executable file

Binary file not shown.

BIN
data/settings.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
data/weight.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1,6 +1,6 @@
/*
-----------------------------------------------------------
Settings
Settings for AVR based MCUs
-----------------------------------------------------------
General settings for the CG scale.
*/
@ -44,6 +44,7 @@ CG scale with 3 Loadcells:
|---X1---|---------X2----------|
*/
#define PIN_LOADCELL1_DOUT A2
#define PIN_LOADCELL1_PD_SCK A3
@ -99,8 +100,8 @@ U8G2_SH1106_128X64_NONAME_1_HW_I2C oledDisplay(U8G2_R0, /* reset=*/ U8X8_PIN_NON
#define V_REF 5000 // set supply voltage from 1800 to 5500mV
// voltage divider
#define RESISTOR_R1 10000 // Ohms
#define RESISTOR_R2 10000 // Ohms
#define RESISTOR_R1 10000 // ohm
#define RESISTOR_R2 10000 // ohm
/*
voltage input

147
settings_ESP8266.h Normal file
View File

@ -0,0 +1,147 @@
/*
-----------------------------------------------------------
Settings for ESP8266 based MCUs
-----------------------------------------------------------
General settings for the CG scale.
*/
// **** Loadcell hardware settings ****
#define NUMBER_LOADCELLS 3 // if set to 2, the parameters of loadcell 3 are ignored
#define DISTANCE_X1 30 // mm
#define DISTANCE_X2 350 // mm
#define DISTANCE_X3 220 // mm
#define LOADCELL1_CALIBRATION_FACTOR 900 // user set calibration factor
#define LOADCELL2_CALIBRATION_FACTOR 900 // user set calibration factor
#define LOADCELL3_CALIBRATION_FACTOR 900 // user set calibration factor
/*
CG scale with 2 Loadcells:
<- ||=== Loadcell 1 ========== Loadcell 2
| | |
|---X1---|---------X2----------|
CG scale with 3 Loadcells:
-- || Loadcell 1
| || ||
| || ||
| || ||
<- X3 || ||================ Loadcell 2
| || ||
| || ||
| || ||
-- || Loadcell 3
| | |
|---X1---|---------X2----------|
*/
#define PIN_LOADCELL1_DOUT D6
#define PIN_LOADCELL1_PD_SCK D5
#define PIN_LOADCELL2_DOUT D2
#define PIN_LOADCELL2_PD_SCK D1
#define PIN_LOADCELL3_DOUT D7
#define PIN_LOADCELL3_PD_SCK D0
// **** Measurement settings ****
#define STABILISINGTIME 3000 // ms
#define UPDATE_INTERVAL_OLED_MENU 500 // ms
#define UPDATE_INTERVAL_LOADCELL 100 // ms
#define SMOOTHING_LOADCELL1 0.4 // IIR filter: smoothing value from 0.00-1.00
#define SMOOTHING_LOADCELL2 0.4 // IIR filter: smoothing value from 0.00-1.00
#define SMOOTHING_LOADCELL3 0.4 // IIR filter: smoothing value from 0.00-1.00
#define MINIMAL_CG_WEIGHT 10 // g if lower, no CG is displayed (0mm)
#define MINIMAL_TOTAL_WEIGHT 1 // g if lower, weight = 0 is displayed
// **** Calibration settings ****
#define REF_WEIGHT 1500 // g
#define REF_CG 100 // mm
// **** Display settings ****
// Please UNCOMMENT the display used
U8G2_SH1106_128X64_NONAME_1_HW_I2C oledDisplay(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ D3, /* data=*/ D4);
//U8G2_SSD1306_128X64_NONAME_1_HW_I2C oledDisplay(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ D3, /* data=*/ D4);
// **** Voltage measurement settings ****
// Enable voltage measurement
#define ENABLE_VOLTAGE true
// analog input pin
#define VOLTAGE_PIN A0
// supply voltage
#define V_REF 3300 // set supply voltage from 1800 to 5500mV
// voltage divider
#define RESISTOR_R1 20000 // ohm
#define RESISTOR_R2 10000 // ohm
/*
voltage input
|
|
| |
| | R1
| |
|
analog Pin <------+
|
| |
| | R2
| |
|
|
GND
*/
// **** Wifi settings ****
#define MAX_SSID_PW_LENGHT 32
// Station mode: connect to available network
#define SSID_STA "myWiFi"
#define PASSWORD_STA ""
#define TIMEOUT_CONNECT 30000 //ms
// Access point mode: create own network
#define SSID_AP "CG scale"
#define PASSWORD_AP ""
const char ip[4] = {1,2,3,4}; // default IP address
#define ENABLE_MDNS false // experimental (speed is slow): Enable mDNS to reach the webpage with hostname.local
// **** Model memory settings ****
#define MAX_MODELNAME_LENGHT 32 // max chars
#define MODEL_FILE "/models.json" // file to store models
#define JSONBUFFER_SIZE 20000 // max file size in bytes