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 ulab.numpy as np | |
import random | |
import synthio | |
SAMPLE_SIZE = 200 | |
sinwave1 = np.array(np.sin(np.linspace(0, 2*np.pi, SAMPLE_SIZE, endpoint=False)) * 32767, dtype=np.int16) | |
sinwave2 = np.array(np.sin(np.linspace(np.pi/2, 2.5*np.pi, SAMPLE_SIZE, endpoint=False)) * 32767, dtype=np.int16) | |
downwave = np.linspace(32767, -32767, num=3, dtype=np.int16) | |
noisewave = np.array([random.randint(-32767, 32767) for i in range(SAMPLE_SIZE)], dtype=np.int16) |
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
Steps: | |
1. Start JlinkRemoteServer on windows | |
1a. If any issues check firewall rules that WSL can access it | |
2. In WSL run: JLinkGDBServerCLExe -device ATSAMD51G19A -if SWD -ip 172.30.240.1 | |
2a. IP may change that is windows machine IP (find with ip route command in WSL) | |
3. arm-none-eabi-gdb build/firmware.elf | |
3a. target extended-remote :2331 | |
Ensure JTab RST is hooked to Reset (or enable on ItsyBitsy M4 worked) |
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 board | |
import neopixel | |
from adafruit_pixel_framebuf import PixelFramebuffer, VERTICAL | |
import time | |
from random import randint, uniform | |
import random | |
pixel_pin = board.D5 | |
pixel_width = 8 | |
pixel_height = 4 |
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
#if defined(ADAFRUIT_FEATHER_M4_EXPRESS) | |
#include <Adafruit_GC9A01A.h> | |
//#define TWO_DISPLAYS | |
#if defined(GLOBAL_VAR) | |
SPIClass SPI1(&sercom3, 6, 13, 12, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_2); | |
#else | |
extern SPIClass SPI1; | |
#endif |
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
There are two main files here to give GPS asyncio ability. | |
UART_asyncio - wrap the core busio.UART read and readline methods with methods that will not block. | |
I am not sure how many core classes this type of wrapping would work for. But for UART seemed fine. | |
Things could be expanded more (write only writes X bytes before letting something else go). CPython's | |
serial_asyncio is somewhat close to what I'm doing, though CPython has Transport and Protocols with asyncoio | |
that CP does not have. | |
gps_asyncio - Right now a subclass of the adafruit_gps.GPS class but as someone suggested may be better as a | |
fork project as a lot of code had to be copied so not really OO. In theory could refactor the GPS class too | |
so the non-async methods all have their own functions and you can override just the async ones. But not even sure |
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
# Location of top-level MicroPython directory | |
MPY_DIR = .. | |
# Name of module | |
MOD = ahrs | |
# Source files (.c or .py) | |
SRC = madgwick.c ../lib/libm/ef_sqrt.c ../lib/libm/atan2f.c ../lib/libm/asinfacosf.c ../lib/libm/atanf.c | |
#SRC = factorial.c |