Closed BallardBandit closed 3 years ago
Here's the code and log:
#include <BlueMagic32.h>
#include <M5StickC.h>
#define BUTTON_PIN 0
int buttonState; // the current reading from the input pin
int lastButtonState = LOW; // the previous reading from the input pin
unsigned long lastDebounceTime = 0; // the last time the output pin was toggled
unsigned long debounceDelay = 50; // the debounce time; increase if the output flickers
void setup()
{
Serial.begin(115200);
BMDConnection.begin("BlueMagic32");
BMDControl = BMDConnection.connect();
pinMode(BUTTON_PIN, INPUT);
}
void loop()
{
int reading = digitalRead(BUTTON_PIN);
// If the switch changed, due to noise or pressing:
if (reading != lastButtonState)
{
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay)
{
if (reading != buttonState)
{
buttonState = reading;
// only toggle the LED if the new button state is HIGH
if (buttonState == HIGH)
{
if (BMDConnection.available())
{
BMDControl->toggleRecording();
}
}
}
}
lastButtonState = reading;
}
Sketch uses 1018554 bytes (77%) of program storage space. Maximum is 1310720 bytes.
Global variables use 31788 bytes (9%) of dynamic memory, leaving 295892 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.0-dev
Serial port COM3
Connecting....
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 94:b9:7e:8c:8a:c8
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4096.0 kbit/s)...
Hash of data verified.
Compressed 18656 bytes to 12053...
Writing at 0x00001000... (100 %)
Wrote 18656 bytes (12053 compressed) at 0x00001000 in 1.1 seconds (effective 137.2 kbit/s)...
Hash of data verified.
Compressed 1018672 bytes to 588155...
Writing at 0x00010000... (2 %)
Writing at 0x00014000... (5 %)
Writing at 0x00018000... (8 %)
Writing at 0x0001c000... (11 %)
Writing at 0x00020000... (13 %)
Writing at 0x00024000... (16 %)
Writing at 0x00028000... (19 %)
Writing at 0x0002c000... (22 %)
Writing at 0x00030000... (25 %)
Writing at 0x00034000... (27 %)
Writing at 0x00038000... (30 %)
Writing at 0x0003c000... (33 %)
Writing at 0x00040000... (36 %)
Writing at 0x00044000... (38 %)
Writing at 0x00048000... (41 %)
Writing at 0x0004c000... (44 %)
Writing at 0x00050000... (47 %)
Writing at 0x00054000... (50 %)
Writing at 0x00058000... (52 %)
Writing at 0x0005c000... (55 %)
Writing at 0x00060000... (58 %)
Writing at 0x00064000... (61 %)
Writing at 0x00068000... (63 %)
Writing at 0x0006c000... (66 %)
Writing at 0x00070000... (69 %)
Writing at 0x00074000... (72 %)
Writing at 0x00078000... (75 %)
Writing at 0x0007c000... (77 %)
Writing at 0x00080000... (80 %)
Writing at 0x00084000... (83 %)
Writing at 0x00088000... (86 %)
Writing at 0x0008c000... (88 %)
Writing at 0x00090000... (91 %)
Writing at 0x00094000... (94 %)
Writing at 0x00098000... (97 %)
Writing at 0x0009c000... (100 %)
Wrote 1018672 bytes (588155 compressed) at 0x00010000 in 52.8 seconds (effective 154.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 768.0 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
If you are using M5 you should use the M5 example not the basic button example.: M5_Remote_Trigger_Timecode.ino
Thanks schoolpost :)
Hello, I am trying to do this project to make the M5Stick a camera remote.
I followed these instructions and the video, in addition to get the M5Stick accessible I had to use these drivers. I tired uploading other projects like flappy bird, and they work fine. But I can can't get the BlueMagic to work, it installs fine, but then the screen is black and there is no feedback on the serial monitor.