Disabled serial classic and changed serial baudrate to be compatible with bluetooth classic adapter
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,6 @@
|
|||||||
.pio
|
.pio
|
||||||
.vscode
|
.vscode
|
||||||
*.kicad_pcb.lck
|
*.lck
|
||||||
|
|
||||||
Schematics/Block-Party/Block-Party-Main-Board/production/
|
Schematics/Block-Party/Block-Party-Main-Board/production/
|
||||||
Schematics/Block-Party/Block-Party-Cube-Top-Board/production
|
Schematics/Block-Party/Block-Party-Cube-Top-Board/production
|
||||||
|
|||||||
@@ -3573,7 +3573,7 @@
|
|||||||
(hide yes)
|
(hide yes)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
(property "Manufacturer_Part_Number" "XINGLIGHT XL-1615RGBC-WS2812B"
|
(property "Manufacturer_Part_Number" "Quinn_lib:XL-1615RGBC-WS2812B"
|
||||||
(at 144.78 85.09 0)
|
(at 144.78 85.09 0)
|
||||||
(effects
|
(effects
|
||||||
(font
|
(font
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
|||||||
{"hostname":"THE-OBELISK","username":"Quinn"}
|
|
||||||
@@ -7,22 +7,33 @@
|
|||||||
;
|
;
|
||||||
; Please visit documentation for the other options and examples
|
; Please visit documentation for the other options and examples
|
||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
[platformio]
|
||||||
|
default_envs = esp32s3_release ; this ensures that only this environment is built for anything but the debug build
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
platform = espressif32
|
; platform = espressif32
|
||||||
|
upload_protocol = esptool
|
||||||
|
platform = https://github.com/platformio/platform-espressif32.git
|
||||||
|
board = esp32-s3-devkitc-1
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
build_flags = -Iinclude
|
||||||
|
; lib_ldf_mode = chain+
|
||||||
|
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
monitor_filters = esp32_exception_decoder, colorize, send_on_enter
|
||||||
|
upload_speed = 2000000 ;ESP32S3 USB-Serial Converter maximum 2000000bps
|
||||||
lib_deps = adafruit/Adafruit NeoPixel@^1.12.0
|
lib_deps = adafruit/Adafruit NeoPixel@^1.12.0
|
||||||
|
|
||||||
[env:esp32-s3-debug]
|
|
||||||
board = adafruit_feather_esp32s3_nopsram
|
|
||||||
build_type = debug
|
|
||||||
build_flags = -D DEBUG
|
|
||||||
|
|
||||||
[env:esp32-s3-build]
|
[env:esp32s3_release]
|
||||||
board = adafruit_feather_esp32s3_nopsram
|
|
||||||
build_flags = -D RELEASE
|
|
||||||
build_type = release
|
build_type = release
|
||||||
|
|
||||||
[env:denky32]
|
[env:esp32s3_debug]
|
||||||
board = denky32
|
debug_init_break = tbreak setup
|
||||||
|
debug_tool = esp-builtin
|
||||||
|
build_type = debug
|
||||||
|
debug_speed = 20000
|
||||||
|
; upload_port = COM7
|
||||||
|
; debug_port = COM7
|
||||||
|
; monitor_port = COM14
|
||||||
|
build_flags = -O1 -Iinclude
|
||||||
41
src/main.cpp
41
src/main.cpp
@@ -3,7 +3,8 @@
|
|||||||
#include <BluetoothSerial.h>
|
#include <BluetoothSerial.h>
|
||||||
|
|
||||||
// project specific libraries
|
// project specific libraries
|
||||||
#include "BluetoothSerialMessage.h"
|
#include "BluetoothSerial.h"
|
||||||
|
#include "SerialMessage.h"
|
||||||
#include "BoardLayout.h"
|
#include "BoardLayout.h"
|
||||||
#include "BOARD-DEFINITIONS.h"
|
#include "BOARD-DEFINITIONS.h"
|
||||||
#include "Color.h"
|
#include "Color.h"
|
||||||
@@ -22,8 +23,8 @@ enum Commands : uint8_t{
|
|||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
// ------------- OBJECT DEFINITIONS -----------------
|
// ------------- OBJECT DEFINITIONS -----------------
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
BluetoothSerial SerialBT;
|
// BluetoothSerial SerialBT;
|
||||||
BluetoothSerialMessage serialMessageBT(&SerialBT);
|
// BluetoothSerialMessage serialMessageBT(&SerialBT);
|
||||||
SerialMessage serialMessage(&Serial);
|
SerialMessage serialMessage(&Serial);
|
||||||
BoardLayout board(BOARD_WIDTH, BOARD_LENGTH, BOARD_HEIGHT, stacks);
|
BoardLayout board(BOARD_WIDTH, BOARD_LENGTH, BOARD_HEIGHT, stacks);
|
||||||
|
|
||||||
@@ -44,20 +45,20 @@ void printBoardState(){
|
|||||||
board.GetBoardState(boardState);
|
board.GetBoardState(boardState);
|
||||||
|
|
||||||
Serial.print("!0,");
|
Serial.print("!0,");
|
||||||
SerialBT.print("!0,");
|
// SerialBT.print("!0,");
|
||||||
|
|
||||||
for(int i = 0; i < (BOARD_WIDTH * BOARD_LENGTH); i++){
|
for(int i = 0; i < (BOARD_WIDTH * BOARD_LENGTH); i++){
|
||||||
Serial.print(boardState[i]);
|
Serial.print(boardState[i]);
|
||||||
SerialBT.print(boardState[i]);
|
// SerialBT.print(boardState[i]);
|
||||||
if(i == (BOARD_WIDTH * BOARD_LENGTH) - 1){
|
if(i == (BOARD_WIDTH * BOARD_LENGTH) - 1){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Serial.print(",");
|
Serial.print(",");
|
||||||
SerialBT.print(",");
|
// SerialBT.print(",");
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial.println(";");
|
Serial.println(";");
|
||||||
SerialBT.println(";");
|
// SerialBT.println(";");
|
||||||
}
|
}
|
||||||
|
|
||||||
void setStackColor(int * args, int argsLength){
|
void setStackColor(int * args, int argsLength){
|
||||||
@@ -85,26 +86,26 @@ void parseData(int * args, int argsLength){
|
|||||||
break;
|
break;
|
||||||
case Commands::PING:
|
case Commands::PING:
|
||||||
Serial.print("!");
|
Serial.print("!");
|
||||||
SerialBT.print("!");
|
// SerialBT.print("!");
|
||||||
Serial.print(Commands::PING);
|
Serial.print(Commands::PING);
|
||||||
SerialBT.print(Commands::PING);
|
// SerialBT.print(Commands::PING);
|
||||||
Serial.println(";");
|
Serial.println(";");
|
||||||
SerialBT.println(";");
|
// SerialBT.println(";");
|
||||||
break;
|
break;
|
||||||
case Commands::SetStackColors:
|
case Commands::SetStackColors:
|
||||||
Serial.println("!2;");
|
Serial.println("!2;");
|
||||||
SerialBT.println("!2;");
|
// SerialBT.println("!2;");
|
||||||
colorManager.Enable(false);
|
colorManager.Enable(false);
|
||||||
setStackColor(args, argsLength);
|
setStackColor(args, argsLength);
|
||||||
break;
|
break;
|
||||||
case Commands::GoToIdle:
|
case Commands::GoToIdle:
|
||||||
Serial.println("!3;");
|
Serial.println("!3;");
|
||||||
SerialBT.println("!3;");
|
// SerialBT.println("!3;");
|
||||||
colorManager.Enable(true);
|
colorManager.Enable(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Serial.println("INVALID COMMAND");
|
Serial.println("INVALID COMMAND");
|
||||||
SerialBT.println("INVALID COMMAND");
|
// SerialBT.println("INVALID COMMAND");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,8 +114,8 @@ void parseData(int * args, int argsLength){
|
|||||||
// ----------------- SETUP AND LOOP -----------------
|
// ----------------- SETUP AND LOOP -----------------
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(9600);
|
||||||
SerialBT.begin("blockPartyBT");
|
// SerialBT.begin("blockPartyBT");
|
||||||
Color colors[] = {Color(255, 0, 0), Color(0, 0, 0), Color(0, 0, 0)};
|
Color colors[] = {Color(255, 0, 0), Color(0, 0, 0), Color(0, 0, 0)};
|
||||||
board.SetStackColors(2, colors);
|
board.SetStackColors(2, colors);
|
||||||
|
|
||||||
@@ -132,10 +133,10 @@ void loop() {
|
|||||||
parseData(serialMessage.GetArgs(), serialMessage.GetArgsLength());
|
parseData(serialMessage.GetArgs(), serialMessage.GetArgsLength());
|
||||||
serialMessage.ClearNewData();
|
serialMessage.ClearNewData();
|
||||||
}
|
}
|
||||||
serialMessageBT.Update();
|
// serialMessageBT.Update();
|
||||||
if(serialMessageBT.IsNewData()){
|
// if(serialMessageBT.IsNewData()){
|
||||||
parseData(serialMessageBT.GetArgs(), serialMessageBT.GetArgsLength());
|
// parseData(serialMessageBT.GetArgs(), serialMessageBT.GetArgsLength());
|
||||||
serialMessageBT.ClearNewData();
|
// serialMessageBT.ClearNewData();
|
||||||
}
|
// }
|
||||||
colorManager.Update();
|
colorManager.Update();
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user