Swift + Orange Pi + LEDs Semaphore




Introduction: Swift + Orange Pi + LEDs Semaphore

Let's give life to a sequence of blinking LEDs.

Our Red, Green and Blue LEDs will go on and off in a sequential way.

We will use Swift language, and will run this on linux

Step 1: Step 1: Orange Pi GPIO

We will use 4 pins:

  • PA6: Blue LED
  • PA1: Green LED
  • PA0: Red LED
  • Ground

Step 2: Step 2: LEDs on BreadBoard

Let's place the LEDs, connecting the cathodes to the Ground.

Anodes will be connected to the pins through jumper cables. Protect the LEDs with resistors.

Avoid errors using Red, Green and Blue color cables.

Step 3: Step 3: Chip + Code

Install Linux using an SD Card, I recommend SD Class 10 Ultra 1

I am using Armbian Jessie Server. Get Armbian

Get Swift 3.0 for ARM

Get code from github.com/adagio/RGBSemaphore

Let's build the executable using: swift build

Then run using super user privileges: sudo .build/debug/RGBSemaphore



    • Epilog Challenge 9

      Epilog Challenge 9
    • Pro Tips Challenge

      Pro Tips Challenge
    • Science of Cooking

      Science of Cooking

    We have a be nice policy.
    Please be positive and constructive.