...
Announcement
Collapse
No announcement yet.
Arc tangent function
Collapse
X
-
I'm assuming that you are measuring the X&Y channels of something like the IDX or TGSL?? did this exercise a while back and used a 2 x16 display.
It basically worked and did not need a fast or high resolution ADC. An arduino Micro, Nano or UNO was all that was needed. One thing that made a difference though was the polarity of the signals while measuring. With the IDX, I had to sample the channels when the went negative to get accurate samples. You can sample after they "fly back" positive but sometimes got irratic results.
https://www.youtube.com/watch?v=b93lfFtUSFs
Comment
-
From my several years of experience with time measurement on ATMega328 I came to the most accurate measurement by comparison in OCR3A, the method with 'millis' I consider the least accurate. PS. I use ATMega A* 328BP at 8MHz - I had one.
Code:int o=3900;//time = 0,5s ... void Licznik() { //funkcja ... ready=0; //reset period measure flag cbi (TIMSK0,TOIE0); //T0 dissable millis and delay TCCR3A = 0; TCNT3 = 0; //T3=0 sbi(TIFR3,OCF3A); //T3 clear flag TCCR3B = 13; //T3 prescaler 1024 OCR3A = o; //T3 time sbi(TIMSK3,OCIE3A); //T3 enable Int, Attach time measurement ... while (ready == 0); //Wait for the end of the measurement ... cbi(TIMSK3,OCIE3A); //T3 disable Int, Turn off timing sbi(TIMSK0,TOIE0); //T0 enable } ... ISR(TIMER3_COMPA_vect) {ready=1;} //T3 Int 33, time measurement
Good luck!
Comment
Comment