Skip to content

Instantly share code, notes, and snippets.

View la3pna's full-sized avatar

Thomas S. Knutsen la3pna

  • HBV / HIVE
  • Drammen, NORWAY
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pklaus
pklaus / arduino-due_high-speed-ADC.ino
Last active October 4, 2023 02:20
Arduino Due: ADC → DMA → USB @ 1MSPS
#undef HID_ENABLED
// Arduino Due ADC->DMA->USB 1MSPS
// by stimmer
// from http://forum.arduino.cc/index.php?topic=137635.msg1136315#msg1136315
// Input: Analog in A0
// Output: Raw stream of uint16_t in range 0-4095 on Native USB Serial/ACM
// on linux, to stop the OS cooking your data:
// stty -F /dev/ttyACM0 raw -iexten -echo -echoe -echok -echoctl -echoke -onlcr
@NT7S
NT7S / Si5351A_PSK.ino
Last active April 23, 2023 19:53
Generate PSK31 with an Si5351A
#include <si5351.h>
#include "Wire.h"
Si5351 si5351;
uint16_t varicode[] =
{
0b1010101011000000, // 0 NUL
0b1011011011000000, // 1 SOH
0b1011101101000000, // 2 STX
@NT7S
NT7S / DACZero.ino
Created January 18, 2017 16:18
DAC Sine Wave on Empyrean/Arduino Zero
uint8_t sine_wave[256] = {
0x80, 0x83, 0x86, 0x89, 0x8C, 0x90, 0x93, 0x96,
0x99, 0x9C, 0x9F, 0xA2, 0xA5, 0xA8, 0xAB, 0xAE,
0xB1, 0xB3, 0xB6, 0xB9, 0xBC, 0xBF, 0xC1, 0xC4,
0xC7, 0xC9, 0xCC, 0xCE, 0xD1, 0xD3, 0xD5, 0xD8,
0xDA, 0xDC, 0xDE, 0xE0, 0xE2, 0xE4, 0xE6, 0xE8,
0xEA, 0xEB, 0xED, 0xEF, 0xF0, 0xF1, 0xF3, 0xF4,
0xF5, 0xF6, 0xF8, 0xF9, 0xFA, 0xFA, 0xFB, 0xFC,
0xFD, 0xFD, 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE, 0xFE, 0xFD,
@NT7S
NT7S / Si5351_JT9.ino
Last active July 14, 2019 12:49
Simple JT9 beacon for Arduino driving the Si5351
//
// Simple JT9 beacon for Arduino, with the Etherkit Si5351A Breakout
// Board, by Jason Milldrum NT7S.
//
// Transmit an abritrary message of up to 13 valid characters
// (a Type 6 message).
//
// Original code based on Feld Hell beacon for Arduino by Mark
// Vandewettering K6HX, adapted for the Si5351A by Robert
// Liesenfeld AK6L <ak6l@ak6l.org>. Timer setup
@NT7S
NT7S / Si5351_JT65.ino
Created September 30, 2015 15:10
Simple JT65 beacon for Arduino driving the Si5351
//
// Simple JT9 beacon for Arduino, with the Etherkit Si5351A Breakout
// Board, by Jason Milldrum NT7S.
//
// Transmit an abritrary message of up to 13 valid characters
// (a Type 6 message).
//
// Original code based on Feld Hell beacon for Arduino by Mark
// Vandewettering K6HX, adapted for the Si5351A by Robert
// Liesenfeld AK6L <ak6l@ak6l.org>. Timer setup
@NT7S
NT7S / ZeroUARTFlowControl.ino
Created December 15, 2017 21:11
Empyrean/Arduino Zero USB-UART Flow Control
uint8_t led = LED_BUILTIN;
void setup() {
SerialUSB.begin(57600);
pinMode(led, OUTPUT);
}
void loop() {
if(SerialUSB.rts()) {
digitalWrite(led, HIGH);
@willasaywhat
willasaywhat / gist:1586278
Created January 10, 2012 01:43
Arduino 22 - TC74 Code
#include <Wire.h>
#define i2c_addr 0x4F
void setup() {
Serial.begin(9600);
Wire.begin();
}
void loop() {
@NT7S
NT7S / homebrew-arduino-zero-setup.md
Created June 29, 2015 18:45
Homebrew Arduino Zero Tool Setup

Homebrew Arduino Zero Tool Setup

A guide for installing the tools necessary to build up a homebrew barebones Arduino Zero (based on the Atmel SAMD21G18A microcontroller) on a Linux PC. While this guide is written for a Debian-based distribution such as Linux Mint, it should be adaptable to other distributions fairly easily.

This guide also assumes that we will be using the ATMEL-ICE debugger to write the Arduino bootloader to the SAMD21G18A flash memory via the Cortex Debug Connector.

Install Arduino IDE

You'll need a recent version of the Arduino IDE which has support for the Arduino Zero in the Boards Manager. As of this writing, the latest stable version is 1.6.5, so be sure to use at least this version. Also as of this writing, the version of the Arduino IDE in the Linux Mint repositories is quite old, so don't use that one.

@NT7S
NT7S / wspr_encode.c
Created September 25, 2015 02:29
My unoptimized implementation of the WSPR encoding process
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <ctype.h>
uint8_t wspr_code(char c)
{
/* Validate the input then return the proper integer code */
// Return 255 as an error code if the char is not allowed