Skip to content

Hello World for Swift on Raspberry Pi: Blink an LED

License

Notifications You must be signed in to change notification settings

luisdelarosa/blink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blink

Blink an LED 3 times, using Swift on Raspberry Pi.

To set up:

  • Install Swift on a Raspberry Pi 3, preferably using Ubuntu Mate 16.04
  • Connect a red LED to ground (use the short leg)
  • Connect a 100 Ohm (or larger) resistor to the same breadboard row that has the red LED's long leg
  • Connect a wire from the Raspberry Pi's GPIO pin 17 (a GPIO breakout board, aka T-Cobbler helps a lot) Fritizing diagram of Raspberry Pi with LED and resistor on breadboard

Then execute at a command prompt on the Raspberry Pi:

git clone [email protected]:luisdelarosa/blink.git
cd blink
swift build && .build/debug/blink

You should see the LED blink 3 times.

Note that this relies on the Swift modules led and SwiftyGPIO.

About

Hello World for Swift on Raspberry Pi: Blink an LED

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages