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
riscv64-unknown-elf-gcc -o build-orangecrab/firmware.elf -DCFG_TUD_TASK_QUEUE_SZ=32 -march=rv32im -mabi=ilp32 -DORANGECRAB -I./boards/orangecrab/generated -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_AESIO=0 -DCIRCUITPY_ANALOGIO=0 -DCIRCUITPY_AUDIOBUSIO=0 -DCIRCUITPY_AUDIOIO=0 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=0 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=0 -DCIRCUITPY_BUSIO=0 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_COUNTIO=0 -DCIRCUITPY_DISPLAYIO=0 -DCIRCUITPY_FRAMEBUFFERIO=0 -DCIRCUITPY_VECTORIO=0 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_GNSS=0 -DCIRCUITPY_I2CPERIPHERAL=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=0 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=0 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_RGBMATRIX=0 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=0 -DCIRCUITPY_RTC=0 -DCIRCUITPY_SAMD=0 -DCIRC |
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
#!/bin/bash | |
ORIG_DIR=`pwd` | |
FRAME_DIR="/tmp/gif-frames" | |
LOSSY=80 | |
FPS=5 | |
LOOP=0 | |
SCALE=.5 | |
COLORS=128 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/bin/bash | |
# credit to olibre from stackoverflow (http://stackoverflow.com/questions/1861382/convert-png-to-svg) | |
File_png="${1?:Usage: $0 file.png}" | |
if [[ ! -s "$File_png" ]]; then | |
echo >&2 "The first argument ($File_png)" | |
echo >&2 "must be a file having a size greater than zero" | |
( set -x ; ls -s "$File_png" ) |
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
green() { | |
printf "\e[32m${1}\e[00m" | |
} | |
light_red() { | |
printf "\e[91m${1}\e[00m" | |
} | |
radioactive="\u2622" | |
check_mark="\u2714" |
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 <iostream> | |
#include <stdint.h> | |
using namespace std; | |
template <uint32_t f> | |
bool ProcessTask(void); | |
template <uint32_t f> | |
uint32_t RunProcess(uint32_t start) { |
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 struct | |
from itertools import izip_longest | |
def grouper(n, iterable, fillvalue=None): | |
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx... From stackoverflow" | |
args = [iter(iterable)] * n | |
return izip_longest(fillvalue=fillvalue, *args) | |
# Extract data from data_file which is a "binary string". Returns it in the format (Data[31 downto 8], Data[7 downto 0]) | |
# which is technically data, ADC channel |
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 UFixedPoint(object): | |
def __init__(self, num, m, n): | |
self.mask = 2**(m + n) - 1 | |
self.k = (1 << (n - 1)) | |
self.m = m | |
self.n = n | |
temp = int(num * 2**self.n) | |
self.value = temp & self.mask |
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
#!/bin/sh | |
echo "25" > /sys/class/gpio/export | |
echo "out" > /sys/class/gpio/gpio25/direction | |
echo "24" > /sys/class/gpio/export | |
echo "in" > /sys/class/gpio/gpio24/direction | |
OUTPUT="0" | |
INPUT="$(cat /sys/class/gpio/gpio24/value)" |
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
#!/bin/sh | |
## TOGGLE LED on a RASPBERRY PI | |
# Christopher Woodall and Thomas Nadovich | |
# June 9, 2012 | |
# | |
# Some reference material: http://elinux.org/RPi_Low-level_peripherals | |
# Done using the special made image of Debian Squeeze for the Raspberry Pi | |
# MUST BE ROOT: | |
# precede with `su -` if you trust me |
NewerOlder