| Arduino Forum ::  Members :: TronSR
 Show Posts Pages: [1] 2 3 ... 6
 1 Using Arduino / Project Guidance / Re: Counting 180Hz at less then 200mV on: September 18, 2013, 10:26:58 am Thank you so much.
 2 Using Arduino / Project Guidance / Re: Counting 180Hz at less then 200mV on: September 18, 2013, 07:39:29 am Hi dc42QuoteFrom your code, it looks like you just want the frequency, in which case suggestion (1) is the obvious solution.Straight to the point, yes.. The pules count can be worked out with this method as well?I'll be using an OMLED or LCD screen to show Hz and counts, with a button to reset the count back to zero and and hold button.QuoteThe end result is the finished code counting the pulses using "unsigned long" so say over 1 minuet at 180Hz, so that will be 180X60 = 10,800 countsThank you for the link!
 3 Using Arduino / Project Guidance / Re: Counting 180Hz at less then 200mV on: September 17, 2013, 11:24:13 am Thank you very much!
 4 Using Arduino / Project Guidance / Counting 180Hz at less then 200mV on: September 17, 2013, 09:24:15 am Hi, I need some guidance, I would like to know if any of the ATmega328 pins can read 180Hz at less than 200mV with the appropriate code written.I'm testing the Nano with code shown below, using a signal generator with sin wave at 180Hz. With the serial monitor open the Nano will only start giving a reading over an output of 2.80V on PD5.Space is going to be tight so I need to keep the PCB small. I would like to use as little components as I can and this is the first time I'm going to give it a go at making a PCB with an ATmega328. I've done one with a Tiny85's and it was really fun.Code:#include int cnt;unsigned long frq; //Declares an extended size variable for the measured frequencyvoid setup() {  Serial.begin(9600);}void loop() {  FreqCounter::f_comp=10;  FreqCounter::start(1000);  while (FreqCounter::f_ready == 0)   frq=FreqCounter::f_freq; //Sets the 'frq' variable as the measured frequencySerial.println(frq);The end result is the finished code counting the pulses Quoteunsigned long so say over 1 minuet at 180Hz, so that will be 180X60 = 10,800 counts?
 5 Using Arduino / Programming Questions / Re: Help with, ATtiny13A Water Sensor on: January 30, 2013, 04:58:48 am Rite, all working now.. Thanks E.If I changed,Code:const int Probe = 0;to,Code:const int Probe = A3;I got this, why? I thought this is declaring?Code:Tiny13:3: error: 'A3' was not declared in this scopeI removed the "A"And now it's all working fine now, with a few adjustments to "threshold".Code:const int outPin1 = 1;const int outPin2 = 2;const int Probe = 3;const int threshold = 220;int sensorReading = 0;void setup() {  pinMode(outPin1, OUTPUT);  pinMode(outPin2, OUTPUT); }void loop() {  sensorReading = analogRead(Probe);     if (sensorReading >= threshold)  {         digitalWrite(outPin1, HIGH);      digitalWrite(outPin2, LOW);  }   else {    digitalWrite(outPin1, LOW);    digitalWrite(outPin2, HIGH);  }  delay(1000);}
 6 Using Arduino / Programming Questions / Re: Help with, ATtiny13A Water Sensor on: January 30, 2013, 04:25:30 am Thank you Erni, will update the code and see how it goes!