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
  • 10:37 (UTC +02:00)
View GitHub Profile
@Robotto
Robotto / pump-o-tron.ino
Created April 29, 2024 11:32
pump-o-tron!
#define N_MEASUREMENTS 32 //Number of analogRead (pressure) measurements to average over
#define MAX_PRESSURE 830
const int pumpPin = 8; //LOW TO RUN, HIGH TO STOP
const int valvePin = 9; //HIGH TO CLOSE, LOW TO OPEN
const int pressurePin = A0;
bool valveState=false;
unsigned long pressureFiltered = 0;
@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 / StenoWeather.ino
Last active January 15, 2024 02:29
Web scraper for ardunio running on ESP8266 based boards.
/*
* 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 / 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 / gist:9db27ceead01c3ce7ece6406881f8c92
Last active October 31, 2021 18:55 — forked from criccomini/gist:3805436
Schedules & Scores API for Streaming Live Sports Stats - MSNBC
import pytz
import datetime
import time
import urllib2
import json
import os
import elementtree.ElementTree as ET
url = 'http://scores.nbcsports.com/ticker/data/gamesNEW.js.asp?jsonp=true&sport=%s&period=%d&random=%d'
@Robotto
Robotto / sciHub.sh
Last active September 5, 2021 13:08
Sci-Hub get PDF from DOI
#!/bin/bash
# Takes DOI strings as arguments for wget to first get SchHub info page, then extract pdf url, and then get that pdf!
# usage:
# Get a single pdf with: ./sciHub.sh 10.1145/1375761.1375762
# USe as many DOIs as arguents as you'd like :)
# to pass a list of DOI strings as arguments to this script you could use: "cat DOIS.txt | xargs ./sciHub.sh"
# replace .tw in the sci-hub url with whatever tld is currently in operation....
for DOI in "$@"
do
@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.