IR LED with Teensy LC to indicate stepper motor status

I am working on a project using four separate Teensy LC boards, each one connected to their own stepper motor that moves its own pulley system. I need to hook up an infrared LED light to each Teensy LC board so that the IR light turns on when the motor is in the ‘Down’ position, and remains on until the motor is in the ‘Up’ position. I am looking for some help with how to write code that would allow me to do this. I have the pins and wires all setup, but am at a roadblock when it comes to writing the code.

I am an Arduino beginner so any help on this would be much appreciated. I can provide more details if necessary. The code that I have to drive my stepper motors is attached here.

test_7revs.ino (4.11 KB)

Hi Charles.

Please read the forum guide in the "please read" sticky post. That will tell you how to post code so that more forum members can see it (most read the forum on phones & tablets and can't open .Uno).

Turning a led on and off is the first thing you learn to do when you start learning Arduino. That's assuming you are sensible and learn to swim in the shallow end of the pool. If you jump straight in the deep end, you will certainly hit a roadblock, to mix metaphors!

What are the ir LEDs for?

I am working on a project using four separate Teensy LC boards, each one connected to their own stepper motor that moves its own pulley system.

I am an Arduino beginner

Yes beginners often think the best solution is to use multiple boards rather than to learn how to program correctly and use only one board.

As your software is in charge of the motors simply turn on the LED when you command the motor to go up, and turn it off when you command it to go down.

Mind you an IR LED is not much of an indicator because you can't see it, so what are you wanting to do with them?

Grumpy_Mike:
Mind you an IR LED is not much of an indicator because you can't see it, so what are you wanting to do with them?

First thing that came to my mind! :astonished: