Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
firmware code for LED control
#3
Hi Travis,

The IR emitter is tied to the port interface's 5V power line, so it's always on - not due to anything we initialize in software.
I haven't tried powering the IR emitter from the PWM line. Please keep in mind that it's a 3.3V line. A 10-ohm resistor in series with the port interface board's blue potentiometer limits the current through the white LED to a safe level - but the same current may not be safe for an IR emitter. I'd tune the visible light to low brightness (or even off), then swap in the IR emitter and use the low end of the potentiometer range.

You can probably avoid hacking the firmware by setting the line to be on at your desired PWM, in the output actions section of every state of your state matrix. When the trial starts, the emitter will turn on, and stay on until the inter-trial interval.

If you do mod the firmware and you're using state machine r0.5-1.0 (Arduino Due), please make sure to mod the text file controlling PWM frequency of your Arduino board, as indicated in comments at the top of the firmware file.

Please let us know if this works!
Cheers,
-Josh
Reply


Messages In This Thread
firmware code for LED control - by Travis - 08-12-2018, 02:21 AM
RE: firmware code for LED control - by Travis - 08-12-2018, 03:30 PM
RE: firmware code for LED control - by Josh - 08-17-2018, 12:31 AM

Forum Jump: