Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Add example for Scroll pHat #41

Merged
merged 5 commits into from
May 12, 2018
Merged

Add example for Scroll pHat #41

merged 5 commits into from
May 12, 2018

Conversation

DanielSSilva
Copy link
Contributor

This pull requests adds an example that displays the legendary "Sad Joey" on the Scroll pHat, and also a small "explanation" on how this is achieved

@msftclas
Copy link

msftclas commented May 9, 2018

CLA assistant check
All CLA requirements met.

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented May 10, 2018

I actually really like that this example is a script and not a module. It's very unique in that sense. :)

@anmenaga
Copy link

Very nice!
1 thing remaining is to add it to the table in 'Examples/README.md'

@DanielSSilva
Copy link
Contributor Author

Thank you @tylerl0706 , I wanted to make it as simple and straight forward as possible :)

@anmenaga I've noticed that moments later. I've not added because I don't know if I need to set that copyright thing as well. Can you check that?

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really looking good! I just have a few questions :)

Also can you add it to the ToC for the examples?


we need to set the register 1 with data 0x0D (0000 1101).

This example assumes that you already have I2C enabled and Microsoft.PowerShell.IoT module installed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link to the install instructions in this repo?

https://github.com/PowerShell/PowerShell-IoT#installation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add the line to enable I2C since it's simple.

Actually, if you wanted to, you can totally copy the first 2 sections under installation:

https://github.com/PowerShell/PowerShell-IoT/tree/master/Examples/Microsoft.PowerShell.IoT.SSD1306#software-setup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure thing! will do

######### Data Registers and value #########
[int[]]$DataRegisterAddress = 0x04 ..0x08
[int[]]$values = 0x12,0x08,0x08,0x08,0x12
######### Lightning Effect Register and value #########
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you say Lightning Effect, do you mean flashing on and off?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or is this for the brightness?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh maybe it wasn't the best choice of words... It's just the brightness. I'll change that as well

@@ -0,0 +1,34 @@
Import-Module Microsoft.PowerShell.IoT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah this file will need the copyright. You can do it if you want or I can add it before merging.

…e clearer. Added instructions to install the module and enable I2C
Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

(Aside from the one tiny note 😀)

$Device = Get-I2CDevice -Id $DeviceAddress -FriendlyName phat
Set-I2CRegister -Device $Device -Register $ConfigurationRegisterAddress -Data $ConfigurationRegisterValue

######## Lightning Effect #####
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed a "Lightning" change :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

God damn it!

@TylerLeonhardt TylerLeonhardt merged commit 1cc9c83 into PowerShell:master May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants