Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Echo.cpp
- Committer:
- MikamiUitOpen
- Date:
- 2014-07-29
- Revision:
- 4:640d48e7b84a
- Parent:
- 1:18123753e1d0
- Child:
- 5:0af77f24af2a
File content as of revision 4:640d48e7b84a:
//--------------------------------------------------------------
// Echo generation system for Open Campus
// Copyright (c) 2014 MIKAMI, Naoki, 2014/07/29
//--------------------------------------------------------------
#include "mbed.h"
#include "AdcInternal.hpp"
#include "MCP4921.hpp"
#include "ReverbSystem.hpp"
using namespace Mikami;
const float FS_ = 10.0e3f;
Adc adc_(A0);
DacMCP4921 dac_;
ReverbSystem myReverb; // Reverb genaration system
Ticker timer_; // for timer interrupt
void TimerIsr()
{
float xn = adc_.Read(); // input
//====================================================
// Singal Processing. Change following statement(s).
float yn = xn; // input => output
// float yn = myReverb.Execute(xn); // Echo
//====================================================
dac_.Write(yn); // output
}
int main()
{
timer_.attach_us(&TimerIsr, 1.0e6f/FS_);
while (true) {} // infinite loop
}