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 <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 |
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 <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 |
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
# 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] |