Skip to content

Instantly share code, notes, and snippets.

View Robotto's full-sized avatar
💭
Calibrating Self.ballmerPeak

Mark Moore (Askemanden Unlimited) Robotto

💭
Calibrating Self.ballmerPeak
  • Aarhus Gymnasium
  • Aarhus, DK
  • 03:15 (UTC +01:00)
View GitHub Profile
@Robotto
Robotto / ESP32_PN532_HSU.ino
Created December 2, 2025 09:51
ESP32 PN532 HSU (UART)
//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
@Robotto
Robotto / NPK.ino
Last active November 25, 2025 12:09
ESP32 NPK sensor via hardware UART through RS485 module
// 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;
@Robotto
Robotto / iotPlotter.ino
Created November 18, 2025 12:58
IOTplotter example for ESP8266
#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>
@Robotto
Robotto / codeCellSkateboardGamepad.ino
Last active October 24, 2025 08:19
Skateboard as a gamepad using the codecell
#include <Arduino.h>
#include <BleGamepad.h>
#include <CodeCell.h>
CodeCell myCodeCell;
float Roll = 0.0;
float Pitch = 0.0;
float Yaw = 0.0;
@Robotto
Robotto / analogFiltering.ino
Created September 30, 2025 06:51
Analog Filtering on an Arduino - Maximum and minimum helps control autoscaling in the serial plotter.
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);
}
@Robotto
Robotto / SerialtxFromPythonToArduino.ino
Last active March 18, 2025 08:00
Serial RX in arduino from python (receiving raw bytes) - Plays well with this gist: https://gist.github.com/Robotto/48cdc0eb75ccee3a306866d634f76f77
#include <Servo.h>
const int servoPin = 9;
const unsigned long baudRate = 115200;
Servo myservo;
void setup() {
Serial.begin(baudRate);
myservo.attach(servoPin);
}
@Robotto
Robotto / SerialtxFromPythonToArduino.py
Last active March 17, 2025 13:53
Serial TX from python to arduino (sending raw bytes) - Plays well with this gist: https://gist.github.com/Robotto/55494b012af0c0f9c9d7c048066c9290
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
//SOURCE: https://github.com/martinius96/ESP32-eduroam/tree/master/2022/eduroam
/*|----------------------------------------------------------|*/
/*|Connection sketch to eduroam network (WPA/WPA2) Enteprise |*/
/*|Suitable for almost any ESP32 microcontroller with WiFi |*/
/*|Raspberry or Arduino WiFi CAN'T USE THIS LIBRARY!!! |*/
/*|Edited by: Martin Chlebovec (martinius96) |*/
/*|Compilation under 2.0.3 Arduino Core and higher worked |*/
/*|Compilation can be done only using STABLE releases |*/
/*|Dev releases WILL NOT WORK. (Check your Ard. Core .json) |*/
@Robotto
Robotto / ESP32_MP3_I2S.ino
Created January 14, 2025 12:11
ESP32_MP3_I2S
/*
Rember to upload LittleFS data from data folder after code upload!
CTRL + SHIFT + P -> "Upload LittleFS ...."
Get the upload plugin for IDE V2.2.1+ from: https://github.com/earlephilhower/arduino-littlefs-upload
*/
#include <Arduino.h>
@Robotto
Robotto / readWrite.py
Created December 17, 2024 09:50
læs fra en fil, skriv til en fil.
def kryptoFakeStuff(msg):
return msg
messages=[]
with open("input.txt", "r") as file:
for line in file:
messages.append(line.strip())
with open("ciphers.txt", "w") as file: