This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Arduino.h> | |
| #include "defines.h" | |
| #include "globals.h" | |
| // PD controller implementation(Proportional, derivative). DT in seconds | |
| float stabilityPDControl(float DT, float input, float setPoint, float Kp, float Kd){ | |
| float error; | |
| float output; | |
| error = setPoint - input; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //陸自10式戦車ダウンサイジング版 | |
| //ESP32 Transmitter から Esp-WROOM02へのEspNowによる通信 | |
| //レシーバー側 macaddress; B4;E6;2D;4A;A1;1A | |
| #include <espnow.h> | |
| #include <ESP8266WiFi.h> | |
| #include <Servo.h> | |
| #define APHASE 12 | |
| #define AENBL 15 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <esp_now.h> | |
| #include <WiFi.h> | |
| typedef struct struct_message { | |
| int x_axis_value; | |
| int y_axis_value; | |
| } struct_message; | |
| void OnDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len) { | |
| int x_axis = makeWord(data[1],data[0]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const int DIR = 23; | |
| const int STEP = 22; | |
| const int ENABLE = 18; | |
| #define read_x 32 | |
| int x_axis, rpm; | |
| void setup() { | |
| Serial.begin(115200); | |
| pinMode(read_x, INPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Adafruit_NeoPixel.h> | |
| #define BUTTON_PIN 5 | |
| #define BUTTON_PIN2 4 | |
| Adafruit_NeoPixel strip(16, 10, NEO_GRB + NEO_KHZ800); | |
| //Adafruit_NeoPixel(LEDの使用個数、Arduinoのピン番号、色の並び+データの転送速度) | |
| boolean oldState = HIGH; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Adafruit_NeoPixel.h> | |
| const int DIN_PIN = 10; // D1 | |
| const int LED_COUNT = 144; // LEDの数 | |
| Adafruit_NeoPixel pixels(LED_COUNT, DIN_PIN, NEO_GRB + NEO_KHZ800); | |
| void setup() { | |
| pixels.begin(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Adafruit_NeoPixel.h> | |
| const int DIN_PIN = 10; // D10 | |
| const int LED_COUNT = 144; // LEDの数 | |
| Adafruit_NeoPixel pixels(LED_COUNT, DIN_PIN, NEO_GRB + NEO_KHZ800); | |
| void setup() { | |
| pixels.begin(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Servo.h> | |
| #include "SoftwareSerial.h" | |
| #include "DFRobotDFPlayerMini.h" | |
| Servo servo1, servo2; | |
| long currentTime, LEDTimer11, LEDTimer12, servoTimer9, servoTimer10; | |
| static const byte servoInterval9 = 25, servoInterval10 = 50 ; | |
| static byte pos9 = 0, pos10 =10; | |
| static byte increment = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "U8g2lib.h" | |
| U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0,U8X8_PIN_NONE); | |
| void setup(void) { | |
| u8g2.begin(); | |
| } | |
| void loop(void) { | |
| forward(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <U8g2lib.h> | |
| U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0,U8X8_PIN_NONE); | |
| void setup(void) { | |
| u8g2.begin(); | |
| u8g2.setFont(u8g2_font_8x13_tf); | |
| } | |
| void loop(void) { | |
| u8g2.clearBuffer(); |
NewerOlder