This file contains hidden or 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
// 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 |
This file contains hidden or 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
// 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 |
This file contains hidden or 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 <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); |
This file contains hidden or 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 serial | |
from collections import OrderedDict | |
import numpy as np | |
#import IPython;IPython.embed() # USE ME FOR DEBUGGING | |
################################################################################ | |
PORT = '/dev/ttyACM1' | |
BAUD = 115200 | |
DEBUG = True |
This file contains hidden or 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 serial | |
PORT='/dev/ttyACM0' | |
s=serial.Serial(PORT,115200,timeout=1) | |
SIZE = 1 | |
NUM = 1000 | |
RES = 12 | |
RATE = 10 |
This file contains hidden or 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 serial | |
PORT='/dev/ttyACM0' | |
OUTFILE='out.csv' | |
#f=open(OUTFILE,"w+") | |
#f=open(OUTFILE,"a+") | |
s=serial.Serial(PORT,115200,timeout=1) |
This file contains hidden or 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 serial | |
PORT='/dev/ttyACM0' | |
OUTFILE='out.csv' | |
NUM_SAMPLES = 1000 | |
f=open(OUTFILE,"w+") | |
s=serial.Serial(PORT,115200,timeout=1) |
This file contains hidden or 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
('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 |
This file contains hidden or 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 <Arduino.h> | |
#include "Adafruit_ZeroTimer.h" // https://github.com/dwblair/Adafruit_ZeroTimer | |
// timer 3 ---------------------- | |
float freq3 = 1; // 10 Hz | |
volatile bool togglepin = false; | |
volatile bool togglepin2 = false; |
This file contains hidden or 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 <Arduino.h> | |
#include "Adafruit_ZeroTimer.h" | |
// This example can have just about any frequency for the callback | |
// automatically calculated! | |
float freq = 10.0; // 1 KHz | |
// timer tester | |
Adafruit_ZeroTimer zerotimer = Adafruit_ZeroTimer(3); |