This file contains 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
#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) |
This file contains 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
// 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) |
This file contains 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
#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) |
This file contains 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 "waveform.h" | |
#include <SPI.h> | |
//#include "TimerOne.h" | |
#define MOSI 11 | |
#define SCK 13 | |
#define LD0 8 | |
#define CS0 9 | |
#define CLR 10 |