Skip to content

Commit 65e6f9e

Browse files
committed
Ability to enable bluetooth on startup via config.h switch
1 parent 05cbc75 commit 65e6f9e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,14 @@ void setup()
278278

279279
#if HARDWARE_REV >= 2
280280
pinMode(fet_out,OUTPUT);
281+
281282
pinMode(bluetooth_pin,OUTPUT);
283+
#ifdef SUPPORT_BLUETOOTH_ENABLE_ON_STARTUP
284+
digitalWrite(bluetooth_pin, HIGH); // turn bluetooth on during boot
285+
#else
282286
digitalWrite(bluetooth_pin, LOW); // turn bluetooth off
287+
#endif
288+
283289
digitalWrite(fet_out, LOW); // turn on whole system on (write high to fet_out if you want to power off)
284290
#endif
285291
#ifdef SUPPORT_BRAKE

Arduino_Pedelec_Controller/config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const int serial_display_16x2_second_unused_pin = 11; // SoftSeria
3737
#define SERIAL_MODE SERIAL_MODE_DEBUG //Set your serial mode here. CHANGES ONLY HERE!<-----------------------------
3838

3939

40+
// #define SUPPORT_BLUETOOTH_ENABLE_ON_STARTUP //uncomment to enable bluetooth during startup
41+
4042
// Customizable buttons for use with the on-the-go-menu.
4143
// The menu is activated by the ACTION_ENTER_MENU action (see below).
4244
//

0 commit comments

Comments
 (0)