Hi,
What is it you want the code to do?
You have a FOR-NEXT Loop with PULSOUT but you dont have any PAUSE in there so basicly there will be 20 2mS pulses right after each other with very little time between them. These 20 pulses will be present on the pin for roughly 40mS and then they will stop because you set Validcode to 0 after 20 pulses. So is it possible that you miss seeing the pulses all together?
HTH
/Henrik Olsson.
Bookmarks