Skip to content

Instantly share code, notes, and snippets.

#ifndef _Waveforms_h_
#define _Waveforms_h_
#define PI 3.141592
#define FREQ 200
#define PHI_STEPS 100
#define V_AMP 2047
#define OMEGA (PI*FREQ*2.0)
@sashoo
sashoo / main.ino
Last active August 29, 2015 14:06
Arduino timer interrupt experiment
// Timer interrupt experiment
// To model sine wave I send 12 bit integers to DAC8512
// Each integer corresponds to the current sine point
// (from 0 mV to 4095 mV)
// Data is transferred over SPI, so there actually
// may be a performance issue, considering the speed
// at which I want to output values
// (dt = 5 µs between two consecutive points)
@sashoo
sashoo / waveform.h
Created September 26, 2014 16:34
Arduino sine waveform table
#ifndef _Waveforms_h_
#define _Waveforms_h_
#define PI 3.141592
#define FREQ 200
#define PHI_STEPS 250
#define V_AMP 2047
#define OMEGA (PI*FREQ*2.0)
@sashoo
sashoo / main.ino
Created September 26, 2014 16:22
Arduino timer interrupt experiment
#include "waveform.h"
#include <SPI.h>
//#include "TimerOne.h"
#define MOSI 11
#define SCK 13
#define LD0 8
#define CS0 9
#define CLR 10