This file contains hidden or 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 | |
| import sys | |
| import time | |
| import argparse | |
| parser = argparse.ArgumentParser(description='Dump serial data from basis') | |
| parser.add_argument('portA', type=str, help='Serial port A') | |
| parser.add_argument('portB', type=str, help='Serial port B') | |
| parser.add_argument('--baud', type=int, default=1000000, help='The baud rate of both devices') | |
| parser.add_argument('--labelA', type=str, default='A') |
This file contains hidden or 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 visa | |
| import sys | |
| import pandas as pd | |
| import numpy as np | |
| import datetime | |
| import time | |
| import argparse | |
| parser = argparse.ArgumentParser(description='Continuously retrieve data from scope as quickly as possible') | |
| parser.add_argument('command', type=str, help='The command to execute. EG: MEAS:PWIDTH? CHANNEL3') |
This file contains hidden or 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 wiringpi2 as wiringpi | |
| import sys | |
| import argparse | |
| import time | |
| parser = argparse.ArgumentParser() | |
| # parser.add_argument('--clock', type=int, default=32) | |
| parser.add_argument('--period', type=int, default=200) | |
| parser.add_argument('--pulsewidth', type=int, default=15) | |
| args = parser.parse_args() |
This file contains hidden or 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
| ''' | |
| MioDecode.py | |
| Reads data from the internal serial bus of a Mio Alpha and prints the BPM to screen. | |
| Dependences: | |
| -pyserial | |
| Usage: | |
| python.exe MioDecode.py --port='<serial port>' --baud=<baud rate> |
This file contains hidden or 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 json | |
| f = open('devinfo.json','r') | |
| lines = f.readlines() | |
| config = json.loads(lines[0]) | |
| print config['data_format'] | |
| print config['sensor_settings']['accelerometer']['scale'] |
This file contains hidden or 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
| { | |
| "gitref": "refs/heads/add_sd", | |
| "gitsha": "5b5fba031cee12ffc9fa97977692062310f86ea7", | |
| "devid": "533231003153344c3330373038343038", | |
| "board": 201, | |
| "tick_rate_hz": 1000, | |
| "data_format": "0.1", | |
| "sample_ticks": { | |
| "accelerometer": 10, | |
| "gyroscope": 33, |
This file contains hidden or 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 pylab as plt | |
| import numpy as np | |
| import pandas as pd | |
| import random | |
| import time | |
| start = time.time() | |
| frames = pd.DataFrame([0], [0.0], ['data']) | |
| plt.ion() |
This file contains hidden or 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
| void pmc_enable_waitmode(void) | |
| { | |
| uint32_t i; | |
| /* Flash in Deep Power Down mode */ | |
| i = PMC->PMC_FSMR; | |
| i &= ~PMC_FSMR_FLPM_Msk; | |
| i |= ul_flash_in_wait_mode; | |
| PMC->PMC_FSMR = i; |
This file contains hidden or 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
| CC = gcc | |
| TARGET = test001 | |
| MACHINE = $(shell $(CC) -dumpmachine) | |
| # Windows | |
| ifneq (,$(or $(findstring mingw, $(MACHINE)), $(findstring cygwin, $(MACHINE)))) | |
| PLATFORM = WIN | |
| LIBS = -lm -lsetupapi | |
| RM = del |
This file contains hidden or 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
| #!/bin/sh | |
| PROJECT_NAME=$1 | |
| if [ "$PROJECT_NAME" != "" ]; then | |
| # TARGET_DIR=${PROJECT_NAME}/${PROJECT_NAME}/Debug | |
| TARGET_DIR=${PROJECT_NAME} | |
| find ${TARGET_DIR} -iname "*.d" -type f -exec sed -i 's/c:\\.*\\bin\\//g' {} \; |