From e9a73bbb3c14af340999f70146747787785f4fee Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 19 Dec 2011 18:20:33 +0000 Subject: initial commit --- electic_streaming2560/main.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 electic_streaming2560/main.c (limited to 'electic_streaming2560/main.c') diff --git a/electic_streaming2560/main.c b/electic_streaming2560/main.c new file mode 100644 index 0000000..5cdf3a6 --- /dev/null +++ b/electic_streaming2560/main.c @@ -0,0 +1,83 @@ +/* test streaming sample data + * bluetooth + * TJR 141011 + + want: 1 second + 16M / 1024 prescale = + + */ + +#include +#include +#include +//include +#include + +#include + +#include "uart.h" + +//#include "HardwareSerial.h" + +#define SAMPLES 512 + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif +#define UART_BAUD_RATE 57600 + +//unsigned char dd[SAMPLES]; // ram buffer +int enabled=0; +int loopCount=0; +int sample=0; + +int main(void) +{ + Serial.begin(57600); + + //uart_init( UART_BAUD_SELECT(UART_BAUD_RATE,F_CPU) ); + DDRB |= (1 << 5); // port B bit 6 = arduino pin 13 + PORTB = (1 << 5); //turn on to start + TCCR1B |= (1 << WGM12); // Configure timer 1 for CTC mode + TIMSK1 |= (1 << OCIE1A); // Enable CTC interrupt + OCR1A = 1562; // Set CTC compare value to 1Hz at 1MHz AVR clock, with a prescaler of 64 + sei(); // Enable global interrupts + TCCR1B |= ((1<