extern "C" void __cxa_pure_virtual(void); //for C++ defines /* Electric data access template TJR 191011 Uses Arduino c++ libraries in vanilla AVR environment Explanation http://www.johnhenryshammer.com/WOW2/pagesHowTo/atmelPage.php#index */ #define SAMPLES 512 //size of ram buffer #define PACKETSIZE 320 //size of output packet #include //import main Arduino header file byte dd[SAMPLES]; // ram buffer int loopCount=0; int sample=0; void fill_sinewave(){ /* sample data to stream the vital thing is that its possible to distinguish the end of a packet here the data is in the range 1-255 and a 0 denotes the end of the packet */ float pi = 3.141592; float fcnt=0; float fd; float dx=2 * pi / SAMPLES; // fill the 512 byte bufferarry int bb; for (int i = 0; i 0) { PORTB ^= (1 << 5); byte in=Serial.read(); if (in=='a') { Serial.println("Welcome to electic"); TCCR1B |= ((1<