Skip to main content
Ctrl+K
BeagleBoard Documentation - Home
  • Introduction
  • Boards
  • Projects
  • Books
  • Accessories
    • About
    • Donate
    • GSoC
    • FAQ
  • OpenBeagle
  • Docs
  • Discord
  • Forum
  • BeagleBoard.org
  • Introduction
  • Boards
  • Projects
  • Books
  • Accessories
  • About
  • Donate
  • GSoC
  • FAQ
  • OpenBeagle
  • Docs
  • Discord
  • Forum
  • BeagleBoard.org

Section Navigation

  • simpPRU
    • simpPRU Basics
    • Build from source
    • Install
    • Language Syntax
    • IO Functions
    • Usage(simppru)
    • Usage(simppru-console)
    • simpPRU Examples
      • Delay example
      • Digital read example
      • Digital write example
      • HCSR04 Distance Sensor example (sending distance data to ARM using RPMSG)
      • Ultrasonic range sensor example
      • Sending state of button using RPMSG
      • LED blink on button press example
      • LED blink using for loop example
      • LED blink using while loop example
      • LED blink example
      • LED blink using hardware counter
      • Read hardware counter example
      • Using RPMSG to communicate with ARM core
      • Using RPMSG to implement a simple calculator on PRU
  • BB-Config
    • BB-Config Detail
    • Build from Source
    • Features
    • Version
  • Robotics Control Library
  • BeagleConnect Technology
Why are we doing this?

We believe in making computers open again to democratize technology and empower individuals and organizations to explore, experiment, and create without the constraints of proprietary systems.

What are we doing?

We design versatile and affordable single-board computers to provide developers, hobbyists, and educators with a platform for prototyping, experimentation, and production of embedded systems. Our comprehensive documentation, tutorials, and vibrant online community support users in their projects and foster knowledge sharing.

How are we doing it?

Through open-source hardware designs, diverse software support, and active community engagement, we enable users to customize, innovate, and collaborate effortlessly in embedded computing.

Support us

The BeagleBoard.org Foundation is a Michigan, USA-based 501(c)(3) non-profit corporation existing to provide education in and collaboration around the design and use of open-source software and hardware in embedded computing.

Become a Patreon Sponsor on GitHub
  • Projects
  • simpPRU Examples
  • LED blink...

LED blink using for loop example#

LED blink using hardware counter

Code#

for : l in 0:10 {
    digital_write(P1_31, true);
    delay(1000);
    digital_write(P1_31, false);
    delay(1000);
}
  • Following code works on PocketBeagle, to use on other boards, please change the pins accordingly.

Explanation#

This code runs for loop with 10 iterations, Inside for it sets header pin P1_31 to HIGH, waits for 1000ms, then sets header pin P1_31 to LOW, then again it waits for 1000ms. This loop runs endlessly, so we get a Blinking output if one connects a LED. So LED will blink 10 times with this code.

previous

LED blink on button press example

next

LED blink using while loop example

Outstanding todo items
On this page
  • Code
  • Explanation
Edit on OpenBeagle
Show Source
Download PDF
Provide Feedback
Feedback
Generate OpenBeagle Issue
Discuss on Forum

BeagleBoard.org is all about being open, please discuss in public on our forum!

© Copyright 2024, BeagleBoard.org Foundation.

Last updated on Dec 07, 2024.