Skip to content

Instantly share code, notes, and snippets.

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

Mark Moore Robotto

💭
Calibrating Self.ballmerPeak
  • Aarhus Gymnasium
  • Aarhus, DK
  • 09:15 (UTC +02:00)
View GitHub Profile
@Robotto
Robotto / garanteretFloat.py
Last active January 24, 2024 11:49
Rekursiv float parser - Funktionen der kalder sig selv, indtil brugeren taster et gyldigt tal...
##REKURSION:
#Definér en funktion som bliver ved med at kalde sig selv, indtil indtastningen er gyldig:
def floatGaranteretRekursiv():
try: ##Prøv at parse brugerens indtastning som float:
kommatal = float(input("Indtast et tal: "))
return kommatal
except: ##Hvis det ikke lykkes, så kalder funktionen sig selv (dvs den bliver ved indtil det lykkes)
print("Ugyldig indtastning, prøv igen...")
return floatGaranteretRekursiv()
@Robotto
Robotto / UDP_RX.ino
Created March 18, 2022 17:15
ESP8266 UDP RX
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
uint8_t state = 0;
String SSID = "IOT";
String PSK = "mrfunkfunk";
@Robotto
Robotto / ESP_UDP_BROADCAST.ino
Last active March 18, 2022 17:09
ESP_UDP_BROADCAST.ino
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <WiFiClient.h>
String SSID = "IOT";
String PSK = "mrfunkfunk";
//UDP stuff:
WiFiUDP Udp;
const unsigned int udpPort = 1337;
@Robotto
Robotto / .ino
Created March 9, 2022 14:35
Connect to eduroam with an ESP8266
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include "wpa2_enterprise.h"
char username[] = "mrnm@aarhustech.dk"; //skolemail
char password[] = "MyEAPPassword";
char ssid[] = "eduroam"; //Don't change this.
void setup()
@Robotto
Robotto / lineCheck.ino
Created December 6, 2021 13:39
Line checker.. Requests data from HTTP(s) server, checks each line in the response for the correct data.
/*
* This sketch sends data via HTTP GET requests to $host.
*
* Magic numbers are used to determine which line(s) to handle, and which part of this line is used.
* The numbers are determined using curl (or some other http dump program)
*/
#include <ESP8266WiFi.h>
const char* ssid = "JustUseYourPhone";
@Robotto
Robotto / ESPpir.ino
Last active March 3, 2021 11:41
ESP modules with a PIR sensor that broadcast if the PIR has been triggered, and listen for other devices trigger broadcasts. Also: a relay turns on if triggered.
/**************************************************************************/
/*!
naive brodacast/listener implementation with simple UDP broadcast.
Each device:
-must have a unique ID! (device_ID)
-Connects to wifi and waits for incoming UDP packets.
@Robotto
Robotto / tubeClamp.scap
Last active February 24, 2021 21:54
tubeClamp.scad
$fn = 32; //establish a decent roundness
length = 75;
height = 30;
width = 40;
bigHoleDiameter = 37.5;
filletRadius = 3;
/*
#run with python3
#js scraper code copied from: https://taras.codes/blog/linkedin-organization-follower-count/ ... replaced regex with string.strip
import socket
from pyquery import PyQuery
import string
import time
print(time.ctime(),"startup!")
TCP_IP = '5.79.74.16' #<-insert server IP here.
@Robotto
Robotto / AGC_klasseliste_til_adobe_csv.py
Last active June 30, 2020 12:54
AGC klasseliste til adobe admin console kompatibel CSV
import csv
import sys
from bs4 import BeautifulSoup
#Dette script indeholder ikke hemmelige eller personfølsomme oplysninger, men behandler manuelt anskaffede personoplysninger.
#Programmet æder klasselister (uden billeder) genereret via aarhus tech selvbetjeningen.
#Gem den genererede side som PrintPage.html i samme mappe som dette script.
inputFilename = "PrintPage.html"
outputFilename = "_klasseliste_til_adobe_admin_console_upload.csv"
@Robotto
Robotto / bigboibuton.ino
Created June 14, 2020 19:52
quick and dirty button to trigger a random number generator for an exam type situation...
#include "Keyboard.h"
const int buttonPin = 10;
void setup() {
pinMode(buttonPin, INPUT_PULLUP);
Keyboard.begin();
}
void loop() {