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:22 (UTC +02:00)
View GitHub Profile
@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() {
@Robotto
Robotto / Posiscale.ino
Created May 21, 2020 18:21
Positive scroll text on large dot matrix display (max7219)
//MAX7219
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
#define stringArraySize 7
//int pinBatt = A0;
int pinCS = 8; // Attach CS to this pin, DIN to MOSI and CLK to SCK (cf http://arduino.cc/en/Reference/SPI )
int numberOfHorizontalDisplays = 4;
int numberOfVerticalDisplays = 1;
@Robotto
Robotto / buttonRefresh.py
Created January 22, 2020 07:52
Emulate keyboard from GPIO
#buttonRefresh.py
#by robotto - november 2016
#reads a button on a pi and executes a call to xte with
# a key sequence.
# sudo apt-get install python-rpi-gpio python3-rpi.gpio
from subprocess import Popen, PIPE #to call xte
import RPi.GPIO as GPIO #for button
from time import sleep #for debounce
@Robotto
Robotto / serialTest.py
Last active January 20, 2020 19:25
Pyserial example for receiving multiple values from an arduino
from time import sleep
import serial
#MAKE SURE THE BAUDRATE MATCHES WITH THE ARDUINO (Serial.begin(115200);)
#ser = serial.Serial("/dev/ttyACM0",115200) #Linux
ser = serial.Serial("COM3",115200) #Windows
while True:
sleep(1)
#The arduino is doing something like:
# Serial.print(x1);
@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

Keybase proof

I hereby claim:

  • I am robotto on github.
  • I am robotto (https://keybase.io/robotto) on keybase.
  • I have a public key ASAY0jDlqVXaQ10QkSF8BFBZy8fgdAfXbW6J86uacbWIbQo

To claim this, I am signing this object:

@Robotto
Robotto / exponentialFilter.ino
Created January 23, 2017 10:12
Exponential filtering of ADC measurements, with voltage calculation thrown in..
//exponentialFilter.ino
//example sketch to pull and filter measurements from eg. an ADC
//the filter has a beta value which determines the weight of new values.
//A high beta value will filter more noise but slow down the response of the filter.
static float filterBeta=32; //1, 2 , 4, 8, 16, 32, 64, 128 and so on...
//where is the data coming from?
static unsigned int adcPin=A0;
//the filtered value for printing or whatever:
@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 / lighthouse.ino
Last active August 30, 2016 21:53
Sommerhack lighthouse - Status and control of a relay over http on wlan (Wemos D1 mini)
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
//Function declarations:
void handleRoot();
void handleToggle();