Skip to content

Intended for exposing Raspberry Pi GPIO to be accessed from Powershell.

Notifications You must be signed in to change notification settings

whatevergeek/powerpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PowerPi

a powershell module that wraps raspberry pi gpio

Author: Paul Lorett Amazona (whatevergeek)

Click Here for video demo

Setup

Once your WinIoT is already setup for your Pi,
connect the positive side of your LED to GPIO 5 pin
and the negative side to the ground (GND) pin
For setup, load the PowerPiLib.dll in WinIoT powershell console (accessed via Powershell Remoting).
PowerPiLib.dll is generated from the C# solution
You may use the files from the link below
if you don't want to build:
https://github.com/whatevergeek/powerpi/tree/master/PowerPiApp/PowerPiLib/bin/ARM/Debug

Sample Usage

Add-Type -Path .\PowerPiLib.dll
$ioValue = New-Object PowerPiLib.GpioValue
$ioHelper = New-Object PowerPiLib.GpioHelper

#To turn on LED:
$ioHelper.Pin = $ioValue::High

#To turn off LED:
$ioHelper.Pin = $ioValue::Low 

#To blink every 1 second
while($true)
{
    $ioHelper.Pin = @{$true=$ioValue::Low;$false=$ioValue::High}[$ioHelper.Pin -eq $ioValue::High]  
    start-sleep -m 1000
}

About

Intended for exposing Raspberry Pi GPIO to be accessed from Powershell.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages