Skip to content

Commit 824a8f1

Browse files
committed
Build test: Add support for HX711 and Nokia display views
Minor other tweaks.
1 parent 1edd476 commit 824a8f1

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ Time now;
110110
#ifdef SUPPORT_TEMP_SENSOR
111111
#include "one_Wire.h"
112112
#include "DallasTemp.h"
113-
OneWire tempWire(temp_pin);
113+
OneWire tempWire(temp_pin);
114114
DallasTemperature sensors(&tempWire);
115115
#endif
116116

117117
#ifdef SUPPORT_HX711
118-
#include "HX711.h"
118+
#include "HX711.h"
119119
HX711 loadcell(hx711_data, hx711_sck);
120120
double load=0; //this is the current load
121121
boolean load_updated=false; //new measurement flag, becomes true if measurement is updated

tools/compile_test.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
'SUPPORT_GEAR_SHIFT',
4444
'SUPPORT_MOTOR_SERVO',
4545
'SUPPORT_TEMP_SENSOR',
46+
'SUPPORT_HX711',
4647
'DETECT_BROKEN_SPEEDSENSOR',
4748
'USE_EXTERNAL_CURRENT_SENSOR',
4849
'USE_EXTERNAL_VOLTAGE_SENSOR'
@@ -97,6 +98,16 @@ def write_config_h(filename=CONFIG_H,
9798
f.write('#define DISPLAY_TYPE DISPLAY_TYPE_' + display_type + ' //Set your display type here. CHANGES ONLY HERE!<-----------------------------\n')
9899
f.write('\n')
99100
f.write('#define NOKIA_LCD_CONTRAST 190 //set display contrast here. values around 190 should do the job\n')
101+
f.write('\n')
102+
f.write('\n')
103+
f.write('//Selection of available display views: comment out any view that you do not want. Can save much programming space!\n')
104+
f.write('#define DV_GRAPHIC\n')
105+
f.write('#define DV_TIME 1\n')
106+
f.write('#define DV_BATTERY\n')
107+
f.write('#define DV_ENVIRONMENT\n')
108+
f.write('#define DV_HUMAN\n')
109+
f.write('\n')
110+
f.write('\n')
100111
f.write('const int serial_display_16x2_pin = 12;\n')
101112
f.write('\n')
102113
f.write('#define SERIAL_MODE_NONE (1<<0) //dont send serial data at all\n')
@@ -155,7 +166,8 @@ def write_config_h(filename=CONFIG_H,
155166
f.write('\n')
156167
f.write('const int poti_value_on_startup_in_watts = 0; //poti startup value in watts\n')
157168
f.write('const int poti_level_step_size_in_watts = 50; //number of watts to increase / decrease poti value by switch press\n')
158-
f.write('const int fixed_throttle_in_watts = 250;')
169+
f.write('const int poti_fixed_value_via_switch = 250;\n')
170+
f.write('const int fixed_throttle_in_watts = 250;\n')
159171
f.write('\n')
160172
f.write('#ifdef SUPPORT_GEAR_SHIFT\n')
161173
f.write('const byte gear_shift_pin_low_gear = 5; //pin that connect to the low gear signal ("red" cable)\n')
@@ -167,6 +179,10 @@ def write_config_h(filename=CONFIG_H,
167179
f.write('#define CONTROL_MODE_TORQUE 2 //power = x*power of the biker, see also description of power_poti_max!\n')
168180
f.write('#define CONTROL_MODE CONTROL_MODE_' + control_mode + ' //Set your control mode here\n')
169181
f.write('\n')
182+
f.write('const byte hx711_data=20; //data pin of hx711 sensor\n')
183+
f.write('const byte hx711_sck=21; //clock pin of hx711 sensor\n')
184+
f.write('const double hx711_scale=78514.375; //this is the scale to apply.\n')
185+
f.write('\n')
170186
f.write('//Config Options-----------------------------------------------------------------------------------------------------\n')
171187
f.write('const byte temp_pin = A2; //pin connected to Data pin of the DS18x20 temperature Sensor\n')
172188
f.write('const int pas_tolerance=1; //0... increase to make pas sensor slower but more tolerant against speed changes\n')
@@ -416,6 +432,8 @@ def test_max_config_fc2x0(self):
416432
'SUPPORT_BATTERY_CHARGE_DETECTION',
417433
'SUPPORT_BATTERY_CHARGE_COUNTER',
418434
'SUPPORT_GEAR_SHIFT',
435+
'SUPPORT_TEMP_SENSOR',
436+
'SUPPORT_HX711',
419437
'DETECT_BROKEN_SPEEDSENSOR'
420438
]
421439
)

0 commit comments

Comments
 (0)