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 <BleGamepad.h> //http://librarymanager/All#ESP32-BLE-Gamepad | |
| //BleGamepad bleGamepad; | |
| BleGamepad bleGamepad("BLEstick", "orksat.me", 100); // Set custom device name, manufacturer and initial battery level | |
| BleGamepadConfiguration bleGamepadConfig; // Create a BleGamepadConfiguration object to store all of the options | |
| const int delayBetweenHIDReports = 5; // Additional delay in milliseconds between HID reports |
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
| // Open loop motor control example | |
| // Open loop means no positional feedback. | |
| #include <SimpleFOC.h> //http://librarymanager/All#Simple%20FOC | |
| // Stepper motor & driver instance | |
| //The motor is this thing: | |
| StepperMotor motor = StepperMotor(10); //18 degrees per step = 20 poles = 10 pole pairs | |
| StepperDriver4PWM driver = StepperDriver4PWM(18,19,5,23); | |
| float outPosition = 500.0; //Position of the end of travel for the linear thingy |
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
| /* | |
| PINOUT: | |
| RØD: 3.3V | |
| ORANGE: 5V | |
| SORT: GND | |
| GRÅ: 18 | |
| */ | |
| // Include the ESP32 Arduino Servo Library instead of the original Arduino Servo Library |
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
| //GET YOUR LIBRARY HERE: https://github.com/Seeed-Studio/PN532/ | |
| #define NFC_INTERFACE_HSU | |
| #include <PN532_HSU.h> | |
| #include <PN532_HSU.cpp> | |
| #include <PN532.h> | |
| HardwareSerial mySerial(2); | |
| #define BAUD 9600 | |
| #define RX_GPIO 35 |
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
| // Copypastey mashup from the following sources: | |
| // https://wiki.dfrobot.com/RS485_Soil_Sensor_N_P_K_SKU_SEN0605 | |
| // https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/ | |
| // RS485 <-> UART conversion using: https://wiki.seeedstudio.com/Grove-RS485/ | |
| uint8_t Com[8] = { 0x01, 0x03, 0x00, 0x1E, 0x00, 0x01, 0xE4, 0x0C }; //N | |
| uint8_t Com1[8] = { 0x01, 0x03, 0x00, 0x1F, 0x00, 0x01, 0xB5, 0xCC }; //P | |
| uint8_t Com2[8] = { 0x01, 0x03, 0x00, 0x20, 0x00, 0x01, 0x85, 0xC0 }; //K | |
| int N, P, K; |
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 <ESP8266WiFi.h> | |
| #include <ESP8266HTTPClient.h> | |
| #include <ArduinoJson.h> | |
| const uint16_t json_doc_size = 1024; | |
| #include <WiFiClient.h> | |
| #include <WiFiClientSecure.h> | |
| #include <SparkFun_Si7021_Breakout_Library.h> //Uses a simple temperature/humidity sensor. Link: https://www.sparkfun.com/sparkfun-humidity-and-temperature-sensor-breakout-si7021.html | |
| #include <Wire.h> |
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 <BleGamepad.h> | |
| #include <CodeCell.h> | |
| CodeCell myCodeCell; | |
| float Roll = 0.0; | |
| float Pitch = 0.0; | |
| float Yaw = 0.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
| float filterAlpha = 16.0; | |
| float filtered = 390.0; | |
| float thresholdOffset=50.0; | |
| float movingThreshold = filtered+thresholdOffset; | |
| unsigned long loopCounter=0; | |
| void setup() { | |
| Serial.begin(115200); | |
| } |
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> | |
| const int servoPin = 9; | |
| const unsigned long baudRate = 115200; | |
| Servo myservo; | |
| void setup() { | |
| Serial.begin(baudRate); | |
| myservo.attach(servoPin); | |
| } |
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
| import serial #Pakken hedder pyserial | |
| import sys | |
| import glob | |
| import time | |
| def list_ports(): | |
| """ Finds all serial ports and returns a list containing them | |
| :raises EnvironmentError: | |
| On unsupported or unknown platforms |
NewerOlder