This file contains 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 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 |
This file contains 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
/*|----------------------------------------------------------|*/ | |
/*|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) |*/ | |
/*|WiFi.begin() have more parameters for PEAP connection |*/ | |
/*|----------------------------------------------------------|*/ |
This file contains 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
/* | |
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> |
This file contains 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
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: |
This file contains 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
/* | |
* Reads a potentiometer on pin 34 and maps the reading to the X axis | |
* | |
* Potentiometers can be noisy, so the sketch can take multiple samples to average out the readings | |
*/ | |
#include <Arduino.h> | |
#include <BleGamepad.h> | |
This file contains 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
#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; |
This file contains 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
##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() |
This file contains 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 <ESP8266WiFi.h> | |
#include <WiFiUdp.h> | |
uint8_t state = 0; | |
String SSID = "IOT"; | |
String PSK = "mrfunkfunk"; |
This file contains 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 <WiFiUdp.h> | |
#include <WiFiClient.h> | |
String SSID = "IOT"; | |
String PSK = "mrfunkfunk"; | |
//UDP stuff: | |
WiFiUDP Udp; | |
const unsigned int udpPort = 1337; |
NewerOlder