2022-11-01から1ヶ月間の記事一覧

DIY Drone - ESP32 [Version 2] #3 (How to control Brushless Motor) Source code

Receiver side #include "BluetoothSerial.h" #if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it #endif #define Brushless_Motor_PIN 25 int i = 0…

DIY Drone - ESP32 [Version 2] #2 (How to connect ESP32 to ESP32 by Bluetooth) Source Code

Check MACadd void setup(void) { Serial.begin(115200); Serial.println("-----------------"); uint8_t macBT[6]; esp_read_mac(macBT, ESP_MAC_BT); } void loop() { uint8_t macBT[6]; esp_read_mac(macBT, ESP_MAC_BT); Serial.printf("%02X:%02X:%02X:…

DIY Drone - ESP32 [Version 2] #1 (How to make Joystick Controller) Source Code

//ref. https://101010.fun/iot/esp32-joystick.html //ref. https://wak-tech.com/archives/742 #define Right_VRX_PIN 12 #define Right_VRY_PIN 13 #define Left_VRX_PIN 25 #define Left_VRY_PIN 26 int left_x_val; int left_y_val; int right_x_val; i…

DIY RC Bowling [ESP32 ] Source code

Bowl side source code //参考https://rikoubou.hatenablog.com/entry/2017/10/06/181805 #include <WiFi.h> #include <WiFiUdp.h> #include "esp_system.h" const char ssid[] = "ESP32_wifi"; // SSID const char pass[] = "esp32pass"; // password const int localPort = 10</wifiudp.h></wifi.h>…

Source Code of DIY Drone - ESP32 [Arduino] Source code

Drone side source code //参考https://rikoubou.hatenablog.com/entry/2017/10/06/181805 #include<math.h> #define Deg2rad 3.1415 /180 #include <MadgwickAHRS.h> Madgwick MadgwickFilter; float quat[4] = {1.0, 0.0, 0.0 ,0.0}; float rate[3]; ///タイマー割込み 参考https:/</madgwickahrs.h></math.h>…