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
from sklearn.linear_model import LinearRegression | |
import matplotlib.pyplot as plt | |
import numpy as np | |
data_time = [9.13E-02, 1.08E-01, 1.25E-01, 1.41E-01, 1.58E-01, 1.75E-01, 1.91E-01, 2.08E-01] | |
data_y = [1.50E-03, -4.40E-02, -9.14E-02, -1.44E-01, -2.00E-01, -2.63E-01, -3.24E-01, -3.92E-01] | |
regression = LinearRegression() | |
regression.fit(np.array(list(map(lambda x: [x**2, x], data_time))).reshape(-1, 2), np.array(data_y).reshape(-1, 1)) |
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
from sklearn.linear_model import LinearRegression | |
import matplotlib.pyplot as plt | |
import numpy as np | |
data_time = [1.08E-01, 1.25E-01, 1.41E-01, 1.58E-01, 1.75E-01, 1.91E-01] | |
data_velocity_y = [-2.78E+00, -3.00E+00, -3.27E+00, -3.56E+00, -3.71E+00, -3.88E+00] | |
regression = LinearRegression() | |
regression.fit(np.array(data_time).reshape(-1, 1), np.array(data_velocity_y).reshape(-1, 1)) |
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 LWheel 0 | |
#define RWheel 1 | |
// 0: not running, 1: only left is running, 2: only right is running, 3: both is running | |
int runningState = 0; | |
int priorRunningState = -1; | |
void setup() { | |
Serial.begin(9600); |
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
on: [push] | |
name: Build | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest |
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 <SoftwareSerial.h> | |
#include <Keyboard.h> | |
#define BLUETOOTH_RX 14 // Change this (RX) | |
#define BLUETOOTH_TX 16 // Change this (TX) | |
SoftwareSerial BTserial(BLUETOOTH_RX, BLUETOOTH_TX); | |
void setup() { | |
Serial.begin(9600); |
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
print("Hello, World") |
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
class ProgressBar(): | |
def __init__(self, size, finishedChar='#', unfinishedChar='-'): | |
self.size = size | |
self.finishedChar = finishedChar | |
self.unfinishedChar = unfinishedChar | |
def update(self, percent): | |
ratio_0 = math.floor(percent / (100 / self.size)) | |
ratio_1 = self.size - ratio_0 | |
sys.stdout.write("\r|" + self.finishedChar*ratio_0 + self.unfinishedChar*ratio_1 + "| " + str(math.floor(percent)) + "%") |
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 urllib.request | |
import os | |
urllib.request.urlretrieve("https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar", "./buildtool.jar") | |
os.system("java -jar buildtool.jar --rev latest --remapped") |