Skip to content

Instantly share code, notes, and snippets.

dwblair

Block or report user

Report or block dwblair

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ttn-otaa-feather-us915-sleep.ino
/*******************************************************************************
* Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman
* Copyright (c) 2018 Terry Moore, MCCI
*
* Permission is hereby granted, free of charge, to anyone
* obtaining a copy of this document and accompanying files,
* to do whatever they want with them without any restriction,
* including, but not limited to, copying, modification and redistribution.
* NO WARRANTY OF ANY KIND IS PROVIDED.
*
View sweptsine_frac.ino
// Output sine wave with frequency sweep between 100Hz and 10kHz (32 samples) on analog pin A0 using the DAC and DMAC
// Generously initially donated by MartinL2
// Written for M0. Tested on Adafruit Feather M0 with ATWINC-1500 WiFi
//
// BDL change to 100Hz to 25000Hz
// BDL change to sweep in frequency, rather than period. This makes it look better on an FFT
// BDL change to have constant power in FFT bins. Each frequency operates for the same amount of time yielding constant
// power in the FFT
// Uploaded to Adafruit forum 17 July 2019
View sweptsine2.ino
// Output sine wave with frequency sweep between 100Hz and 10kHz (32 samples) on analog pin A0 using the DAC and DMAC
// Generously initially donated by MartinL2
// Written for M0. Tested on Adafruit Feather M0 with ATWINC-1500 WiFi
//
// BDL change to 100Hz to 25000Hz
// BDL change to sweep in frequency, rather than period. This makes it look better on an FFT
// BDL change to have constant power in FFT bins. Each frequency operates for the same amount of time yielding constant
// power in the FFT
// Uploaded to Adafruit forum 17 July 2019
View sweptsine2.ino
// Output sine wave with frequency sweep between 100Hz and 10kHz (32 samples) on analog pin A0 using the DAC and DMAC
// Generously initially donated by MartinL2
// Written for M0. Tested on Adafruit Feather M0 with ATWINC-1500 WiFi
//
// BDL change to 100Hz to 25000Hz
// BDL change to sweep in frequency, rather than period. This makes it look better on an FFT
// BDL change to have constant power in FFT bins. Each frequency operates for the same amount of time yielding constant
// power in the FFT
// Uploaded to Adafruit forum 17 July 2019
@dwblair
dwblair / conduct.ino
Created Feb 5, 2020
basic_conductivity_measure / samdX1
View conduct.ino
#include <Arduino.h>
#include "Adafruit_ZeroTimer.h"
// This example can have just about any frequency for the callback
// automatically calculated!
float freq = 20000.0; // the actual frequency seems to be half of this
// timer tester
Adafruit_ZeroTimer zerotimer = Adafruit_ZeroTimer(3);
View test_acquire_dds_csv.py
import serial
from collections import OrderedDict
import numpy as np
#import IPython;IPython.embed() # USE ME FOR DEBUGGING
################################################################################
PORT = '/dev/ttyACM1'
BAUD = 115200
DEBUG = True
View live.py
import serial
PORT='/dev/ttyACM0'
s=serial.Serial(PORT,115200,timeout=1)
SIZE = 1
NUM = 1000
RES = 12
RATE = 10
View fastgrab.py
import serial
PORT='/dev/ttyACM0'
OUTFILE='out.csv'
#f=open(OUTFILE,"w+")
#f=open(OUTFILE,"a+")
s=serial.Serial(PORT,115200,timeout=1)
View grab.py
import serial
PORT='/dev/ttyACM0'
OUTFILE='out.csv'
NUM_SAMPLES = 1000
f=open(OUTFILE,"w+")
s=serial.Serial(PORT,115200,timeout=1)
View debug_2.txt
('2219435784', '204')
2
uS:2.04
3
['116', '89', '6', '36', '117', '87', '6', '38', '119', '85', '4', '40', '120', '82', '3', '42', '120', '80', '3', '46', '121', '77', '1', '48', '122', '74', '1', '50', '122', '73', '1', '53', '123', '70', '0', '55', '123', '67', '0', '57', '124', '65', '0', '61', '123', '62', '0', '63', '124', '60', '0', '66', '123', '57', '0', '68', '123', '55', '0', '70', '123', '52', '1', '73', '123', '49', '1', '76', '122', '47', '2', '78', '121', '43', '2', '80', '120', '42', '3', '82', '120', '40', '10', '85', '119', '37', '5', '87', '118', '35', '6', '90', '117', '33', '8', '91', '115', '30', '9', '94']
4
('2220435784', '204')
5
uS:2.04
6
You can’t perform that action at this time.