Skip to content

Instantly share code, notes, and snippets.

@countofkrakow
countofkrakow / CRSF_Joystick.ino
Created May 9, 2023 18:45
Updated CRSFJoystick
#include <CrsfSerial.h> // https://github.com/CapnBry/CRServoF/
#include <PicoGamepad.h> // https://gitlab.com/realrobots/PicoGamepad/-/tree/master
#include "calibration.h"
// ONLY UNCOMMENT 1 Board ID
#define BOARD_ID 1 // PiPico
//#define BOARD_ID 2 // TINY2040
//#define BOARD_ID 3 // WaveShare RP2040-Zero
//#define BOARD_ID 4 // Seeed XAIO 2040
@countofkrakow
countofkrakow / CRSF_Joystick.ino
Created May 9, 2023 18:18
CRSFJoystick with updated SerialPassthrough code
#include <CrsfSerial.h> // https://github.com/CapnBry/CRServoF/
#include <PicoGamepad.h> // https://gitlab.com/realrobots/PicoGamepad/-/tree/master
#include "calibration.h"
// ONLY UNCOMMENT 1 Board ID
#define BOARD_ID 1 // PiPico
//#define BOARD_ID 2 // TINY2040
//#define BOARD_ID 3 // WaveShare RP2040-Zero
//#define BOARD_ID 4 // Seeed XAIO 2040
@countofkrakow
countofkrakow / rock-paper-scissors.py
Last active August 26, 2021 08:09
Rock Paper Scissors command line
# inspiration for this code came from here https://daniel.lawrence.lu/programming/rps/
import random
def selectBest(s):
return [i for i in range(len(s)) if max(s) == s[i]][0]
def selectBestDict(s):
ew = {i:s[beatedBy[beatedBy[i]]] - s[beatedBy[i]] for i in s.keys()};
return [i for i in ew.keys() if max(ew.values()) == ew[i]][0]