Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and update README.md #194

Open
tahouse opened this issue Aug 2, 2018 · 4 comments
Open

Fix and update README.md #194

tahouse opened this issue Aug 2, 2018 · 4 comments

Comments

@tahouse
Copy link

tahouse commented Aug 2, 2018

I appreciate the attempt at providing API examples, but the current README.md examples do not work. Running any of the examples, a new user will be greeted immediately with code that simply doesn't work.

Let's look at the Python API example

from papirus import Papirus

# The epaper screen object.
# Optional rotation argument: rot = 0, 90, 180 or 270
screen = Papirus([rotation = rot])

# Write a bitmap to the epaper screen
screen.display('./path/to/bmp/image')

# Perform a full update to the screen (slower)
screen.update()

# Update only the changed pixels (faster)
screen.partial_update()

# Update only the changed pixels with user defined update duration
screen.fast_update()

# Disable automatic use of LM75B temperature sensor
screen.use_lm75b = False

In the line screen = Papirus([rotation = rot]), [rotation = rot] isn't valid Python syntax.

With your current module specification screen.display('./path/to/bmp/image') also doesn't work. It appears from the module code that it's actually expecting an image bytestream, not a string path to an image.

There is also no mention of resizing an image to the correct size/resolution for the screen set in the setup/driver configuration.

@vitasam
Copy link

vitasam commented Aug 2, 2018

Hi,

In the line screen = Papirus([rotation = rot]), [rotation = rot] isn't valid Python syntax.

This syntax works:

from papirus import PapirusText
text = PapirusText(rotation = 90)
text.write("Hello World!")

But I tend to agree that README.md could be refactored

@ChristopherRush
Copy link
Contributor

@tahouse I will re-word the documentation and close this issue.

@ChristopherRush
Copy link
Contributor

dd9a122

@tvoverbeek
Copy link
Contributor

The screen.display('./path/to/bmp/image') issue has not been addressed.
Showing an image from file is in the PapirusImage class.
The screen.display expects an PIL image structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants