If you don't want to post code at all
take a
single
microcontroller that does it
all
by using
non-blocking timing
A teensy 4.1 will be fast enough with a CPU-clock of 600 Mhz and plenty of IO-pins
I don’t have access to the code right now. Thanks for the help. I’ll post as soon as I can.
There are different interrupt conditions.
Parameters
interrupt: the number of the interrupt. Allowed data types:int.
pin: the Arduino pin number.
ISR: the ISR to call when the interrupt occurs; this function must take no parameters and return nothing. This function is sometimes referred to as an interrupt service routine.
mode: defines when the interrupt should be triggered. Four constants are predefined as valid values:
- LOW to trigger the interrupt whenever the pin is low,
- CHANGE to trigger the interrupt whenever the pin changes value
- RISING to trigger when the pin goes from low to high,
- FALLING for when the pin goes from high to low.
Note rising or falling edge.
What trigger are you using?
Tom...
![]()
Starting from an initial condition of all interrupts enabled - six total, correct?
When a car's leading edge generates its interrupt, record the time stamp then disable the interrupt for that sensor. When the race is over and all interrupts have been registered, reset to the initial condition.
What processor are you using?
Hi,
Can you post your code?
Can you post a schematic of your project?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, component names and pin labels.
This will give us a platform to work on to help your situation.
An image(s) of your project setup would be good so we can see the beam setup.
Thanks.. Tom...
![]()
I can make it work using the falling interrupts but I would need 12 interrupts pins to have enough to read all of the sensors I need. Mega has 6 interrupt pins and two I will have to use for a I2c LCD display because they share the same pins as 2 of the interrupt pins. Wish they made a board where all pins could accept interrupts. I am writing the code now to post but the code is not the question that I have. My question is there a way to use the pin change interrupts in a way that are like the regular interrupts with a rising-falling condition.
See this article for the basics of pin change interrupt.
The trick, if we need to call it that, is to examine (within the interrupt service routine) all the pins that are on the vector for that port to see which pin, and which direction it went, was the cause of the interrupt.
HTH
a7
See if this works for you:
Hi,
Did you Google;
arduino dragstrip timer
Tom..
![]()