-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathSpark_Server_Core_USB_1.ino
46 lines (35 loc) · 1.01 KB
/
Spark_Server_Core_USB_1.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "BluetoothSerial.h" //Header File for Serial Bluetooth, will be added by default into Arduino
#include <M5Core2.h>
BluetoothSerial SerialBT; //Object for Bluetooth
byte bt_byte, usb_byte;
#define SPARK_BT_NAME "Spark 40 Audio"
void setup() {
M5.begin();
// Serial.begin(115200);
M5.Lcd.setBrightness(100);
M5.Lcd.setTextColor(WHITE);
M5.Lcd.setTextSize(2);
M5.Lcd.setCursor(0, 0);
M5.Lcd.fillScreen(BLACK);
M5.Lcd.println(">Spark Spoofer Core2 USB1<");
M5.Lcd.println(" ");
M5.Lcd.print("Starting BT..");
if (!SerialBT.begin(SPARK_BT_NAME))
{
M5.Lcd.println("failed");
while (true) {};
}
M5.Lcd.println("ready to pair");
}
void loop() {
if (SerialBT.available()) //Check if we receive anything from Bluetooth
{
usb_byte = SerialBT.read(); //Read what we recevive
Serial.write(usb_byte);
};
if (Serial.available())
{
bt_byte = Serial.read();
SerialBT.write(bt_byte);
}
}