Skip to content

Instantly share code, notes, and snippets.

View gyaresu's full-sized avatar

Gareth gyaresu

View GitHub Profile
anonymous
anonymous / application.c
Created April 27, 2017 04:58
#include "stm32f4xx_hal.h"
#include "main.h"
#include "spi.h"
#include "usart.h"
#define QUAN_SPI_BYTES 8
#define LIS3DSH_READ 0x80U
#define LIS3DSH_WRITE 0x00U
#!/bin/bash
cat $1 | grep '^IRA:' > $1_positions.csv
sed -i -e 's/^.\+sat:/sat:/' -e 's/\( RAI\:.\+\)\|\(sat:\)\|\(beam:\)\|\(pos=(\)\|\()\)\|\(alt=\)\|\(+\)//g' -e 's%/%;%' -e 's/ /;/g' -e '/^00;00/d' -e 's/$/000/g' -e '/[0-9]\+;[0-9]\+;\([0-9]\+\|-[0-9]\+\).[0-9]\+;\([0-9]\+\|-[0-9]\+\).[0-9]\+;[0-9]\+/!d' $1_positions.csv
awk -F ';' '($5<=100000){print}' $1_positions.csv > $1_positions_spotbeams.csv
awk -F ';' '($5>100000){print}' $1_positions.csv > $1_positions_satellites.csv
sed -i '1 i\satellite;beam;latitude;longitude;altitude' $1_positions*.csv
@dev-zzo
dev-zzo / tutorial.md
Last active February 9, 2023 00:08
ChameleonMini fun

Getting it to work

The device is shipped with test firmware installed. To burn a proper firmware, you will need:

The instructions on the blog page are incorrect because Rev G hardware uses ATxmega128A4U instead of ATxmega32A4U. Why? Probably an outdated version of hardware.

@ktemkin
ktemkin / mockup.py
Last active February 6, 2023 19:49
# Creating a GreatFET object implicitly opens the USB connection to the device.
try:
device = GreatFET() # Optionally accepts serialNo= to select between multiple GreatFETs.
except DeviceNotFoundException:
print("No device found!")
sys.exit()
# Once a connection is made, the board's ID is queried, and used to make the board's peripherals available.
# (This either would be a factory method that produces an appropriate class, or a run-time mixin.)
# For now, this would mean that objects are present on 'device' that allow access to each of the Azalea board's peripherals.
@liushooter
liushooter / uninstall-haskell-osx.sh
Last active November 15, 2017 01:49 — forked from gatlin/uninstall-haskell-osx.sh
Uninstall Haskell from Mac OS X
#!/bin/bash
# source: http://www.haskell.org/pipermail/haskell-cafe/2011-March/090170.html
sudo rm -rf /Library/Frameworks/GHC.framework
sudo rm -rf /Library/Frameworks/HaskellPlatform.framework
sudo rm -rf /Library/Haskell
rm -rf .cabal
rm -rf .ghc
rm -rf ~/Library/Haskell
@SyncChannel
SyncChannel / LoRaFW_IOX_AdafruitIO_Gateway.ino
Created March 17, 2016 01:16
LoRa FeatherWing IOX Adafruit IO Gateway Example Program
/* LoRa FeatherWing IOX Adafruit IO Gateway Example Program
* By: Dan Watson | syncchannel.blogspot.com
* Date: 3-12-2016
* Version: 0.1 Initial Release
*
* Example Adafruit IO Gateway Program for the LoRa FeatherWing IOX for Adafruit Feather
* Tested with HUZZAH ESP8266
*
* This program configures the Feather as a LoRa receiver and Adafruit IO Wi-Fi Gateway.
* It is intended as a companion to the LoRA FeatherWing IOX Beacon Example Program.
@SyncChannel
SyncChannel / LoRaFW_IOX_TransceiverMode.ino
Created March 17, 2016 01:15
LoRa FeatherWing IOX Tranceiver Mode Example Program
/* LoRa FeatherWing IOX Tranceiver Mode Example Program
* By: Dan Watson | syncchannel.blogspot.com
* Date: 3-12-2016
* Version: 0.1 Initial Release
*
* Example Tranceiver Mode Program for the LoRa FeatherWing IOX for Adafruit Feather
* Tested with Feather M0, 32U4 and HUZZAH ESP8266
*
* This program configures the Feather as a LoRa receiver. It is intended as a companion
* to the LoRA FeatherWing Beacon Example Program, and can receive the beacon messages.
@SyncChannel
SyncChannel / LoRaFW_IOX_BeaconMode.ino
Last active October 24, 2020 02:05
LoRa FeatherWing IOX Beacon Mode Example Program
/* LoRa FeatherWing IOX Beacon Mode Example Program
* By: Dan Watson | syncchannel.blogspot.com
* Date: 3-12-2016
* Version: 0.1 Initial Release
*
* Example Beacon Mode Program for the LoRa FeatherWing IOX for Adafruit Feather
* Tested with Feather M0, 32U4, and HUZZAH ESP8266
* However, you only have one analog input on HUZZAH (1V input max!)
*
* This program configures the Feather as a transmit-only beacon. It transmits a payload of data
from PIL import Image
import struct
import sys
imgsize = 128
img = Image.new('L', (imgsize, imgsize))
with open("lily.cfile", "rb") as f:
while True:
@mpj
mpj / monad-stream-example.js
Last active September 14, 2022 06:42
This is the code from Monads - episode #21 of FunFunFunction (https://www.youtube.com/playlist?list=PL0zVEGEvSaeFSwPn06GKArptSxiP1Gff8)
const fetch = require('node-fetch')
const Bacon = require('baconjs')
function getInPortuguese(word) {
// Google Translate API is a paid (but dirt cheap) service. This is my key
// and will be disabled by the time the video is out. To generate your own,
// go here: https://cloud.google.com/translate/v2/getting_started
const apiKey =
'AIzaSyB4DyRHIsNhogQXmH16YKbZfR-lTXrQpq0'
const url =