Thank Paul,
I have been working on the application today.
It is just about working. On one of my sensors it is a bit slow to respond to the code.
Took your advice a d bit banged. Just about enough adjustment in the counts to get the thing to work.
The code is a bit expanded but it does allow me...