FIRST Robotics Competition Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

[FRC 2015] Heartbeats in FRC 2015

Heartbeats are a common tool used in embedded systems.  Without having access to User Interaces (UIs), it's helpful to have a visual indicator that your code is actually running on your robot.  With the cRIO hardware, you could toggle the USER1 LED to create a heartbeat.  How do you perform this same task when the roboRIO doesn't have the USER1 LED?

This snippet shows code that will switch the value on DIO Port 9 every 100ms between True and False.  With a LED connected to DIO 9, this would create a slowly flashing LED to act as a heartbeat.  When you start to develop your robot, it's helpful to know your code is running on the robot and this will allow you to know.  The snippet is best placed in the Periodic Tasks.vi found within your Team Code Folder inside your project.

FRCHeartbeat.png

For information about how to create a circuit for the LED, you can check out this article.

Contributors