Control of an IR emitter transistor #71
robzed
started this conversation in
Show and tell
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Control of an IR emitter transistor.
![image](https://private-user-images.githubusercontent.com/4871013/270040672-3c929878-1f08-47af-8181-4ba450d09e74.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4MjI2ODcsIm5iZiI6MTcyMTgyMjM4NywicGF0aCI6Ii80ODcxMDEzLzI3MDA0MDY3Mi0zYzkyOTg3OC0xZjA4LTQ3YWYtODE4MS00YmE0NTBkMDllNzQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjRUMTE1OTQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTA4OWQzMzk4NmZjYWMxNGZmYTMxMzBjZjg3NTE5MDFjZjFlNjNkYjk5ZjA0YTZmNDg3OWMxMjA1MjMzMjUwMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.q_9lrdpubg0RONRDGN-v6_OZFB51LgaagOmxXlzhN1k)
Ran by this code:
https://github.com/robzed/ukmarsbot_forth/blob/master/for_rp2040/robot-adc.fth
line 145 turns on the IR LED
dup EMITTER_B pin!
This is the rising edge on the image above.
Then we ask the hardware to read 4 ADC channels and interrupt us when the FIFO is full.
On the next interrupt, line 151 turns off the IR LED
false EMITTER_B pin!
This is the falling edge on the image above.
From rising to falling is about 25 us.
We repeat this sequence every 2ms.
Interrupt latency isn't a problem here.
Beta Was this translation helpful? Give feedback.
All reactions