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 numpy as np | |
from scipy import integrate as i | |
from pylab import * | |
t = np.arange(0,100,1) | |
acc = np.empty(100); acc.fill(10) | |
acc_error = acc + 1 | |
velo = i.cumtrapz(acc, t) | |
velo_error = i.cumtrapz(acc_error, t) | |
t = t[0:99] |
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 <EEPROM.h> | |
#include <MPU6050.h> | |
#include <I2Cdev.h> | |
#include <Wire.h> | |
MPU6050 accelgyro; | |
int k = 0; | |
int n = 1025; | |
int ax, ay, az; |
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 <EEPROM.h> | |
int m = 0; | |
int n = 0; | |
// the setup routine runs once when you press reset: | |
void setup() { | |
// initialize serial communication at 9600 bits per second: | |
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
98 | |
98 | |
98 | |
98 | |
98 | |
98 | |
98 | |
98 | |
98 | |
98 |
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 numpy as np | |
from pylab import * | |
acc = [] | |
with open('data') as f: | |
data = f.readlines() | |
for value in data: | |
value_acc = ((int(value))-128)/30.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
#include <MPU6050.h> | |
#include <I2Cdev.h> | |
#include <Wire.h> | |
MPU6050 accelgyro; | |
int ax, ay, az; | |
int gx, gy, gz; | |
int led = 13; |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from pyqtgraph.Qt import QtGui, QtCore | |
import numpy as np | |
import pyqtgraph as pg | |
from pyqtgraph.ptime import time | |
import serial | |
app = QtGui.QApplication([]) |
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 numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
import serial | |
fig, ax = plt.subplots() | |
line, = ax.plot(np.random.rand(10)) | |
ax.set_ylim(-5000, 5000) | |
xdata, ydata = [0]*100, [0]*100 | |
raw = serial.Serial("/dev/ttyUSB1",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
import socket, machine | |
# This is the HTML, CSS and js to deliver to the client. | |
# You can (should) store this in another file and read from there, | |
# but I am lazy. | |
# The CSS and HTML to display pretty code is from pygments. | |
upy = """<!DOCTYPE html> | |
<html> | |
<head> | |
<title>I'm a website running on a Microcontroller.</title> |
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 time | |
class RangeSensor: | |
def __init__(self): | |
pass | |
def make_generator(self): | |
t_end = time.time() + 0.1 | |
# tell sensor to start measurement |
OlderNewer