Hi,
i tough i read somewhere on the internet that a digitalRead instruction could detect a rising and falling edge. For some reason I can’t find it anymore. Maybe it was another instruction…
Anyway I need to detect the rising and falling edge of a pushbutton on a digital input, any help would be appreciated.
The digitalRead() function determines whether the current state of the pin is HIGH or LOW. An interrupt can be captured, using an external interrupt, on the change from LOW to HIGH, from LOW to HIGH, or either change.
The pulseIn() function can tell you how long a pin is HIGH or LOW, when the change is caused by something other than a push-button switch.
They should explain interrupts, digitalRead, pulseIn, and reading pins with digitalRead. After you've mastered that, you can try learning port manipulation for faster digitalReads.
They should explain interrupts, digitalRead, pulseIn, and reading pins with digitalRead. After you've mastered that, you can try learning port manipulation for faster digitalReads.
Onions.
The page "Reference/DigitalReadDigitalRead" doesn't exist.
The page "Reference/AttachInterruptExternalInterrupts" doesn't exist.
An electrical full pulse (|----| ; AL, RE, AH, FE) signal has edges in addition to active levels.
What do you want now?
(a) Sensing the RE (Rising Edge = Leading Edge) of an incoming pulse and then trigger an event.
(b) Sensing the FE (Falling Edge = Training Edge) of an incoming pulse and then trigger an event.
Is it possible to create a full electrical pulse using a push button?
yes.
Let us trigger a 74LS123 type one-shot by a push button.
The RE of the resultant pulse can be detected by the MCU being interrpted over INT0-pin.
The RE of the resultant pulse can also be detected by counting the RE of the incoming pulse
using T0-pin.