marrc
Junior Member level 2
hello,
am getting following out puts on serial monitor:
a) when no i/p applied : 50
b) when 555 connected to i/p: values changing continuously between hundreds,thousands, ten thousands for the same applied input
i have used following code:
plz help!
am getting following out puts on serial monitor:
a) when no i/p applied : 50
b) when 555 connected to i/p: values changing continuously between hundreds,thousands, ten thousands for the same applied input
i have used following code:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 const int pulsePin = 8; // Input signal connected to Pin 8 of Arduino int pulseHigh; // Integer variable to capture High time of the incoming pulse int pulseLow; // Integer variable to capture Low time of the incoming pulse float pulseTotal; // Float variable to capture Total time of the incoming pulse int frequency; // Calculated Frequency void setup() { Serial.begin(9600); pinMode(pulsePin,INPUT); } void loop() { pulseHigh = pulseIn(pulsePin,HIGH); pulseLow = pulseIn(pulsePin,LOW); pulseTotal = pulseHigh + pulseLow; // Time period of the pulse in microseconds frequency=1000000/pulseTotal; // Frequency in Hertz (Hz) Serial.println(frequency); }
plz help!
Last edited by a moderator: