Merge branch 'dev'

master
Robert Sorić 2023-10-30 12:00:27 +01:00
commit 103e107195
110 changed files with 12541 additions and 837 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

View File

@ -0,0 +1,9 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia odio vitae vestibulum. Donec in efficitur leo, nec vehicula elit.
Suspendisse potenti. Nullam quis risus eget urna mollis ornare vel eu leo. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.
Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Pellentesque in ipsum id orci porta dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.
Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vivamus suscipit tortor eget felis porttitor volutpat. Cras ultricies ligula sed magna dictum porta.
Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Sed porttitor lectus nibh, et malesuada fames ac turpis egestas.

View File

@ -1,16 +1,33 @@
# This example will show you how to draw basic black and white shapes
# Also, it will draw a bitmap of the Soldered logo in the middle
# Include all the required libraries
from inkplate10 import Inkplate
from image import *
from soldered_logo import *
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Let's draw some shapes!
# This example will draw shapes around the upper left corner, and then rotate the screen
# This creates a symmetrical-looking pattern of various shapes
for r in range(4):
# Sets the screen rotation
display.setRotation(r)
@ -26,14 +43,25 @@ if __name__ == "__main__":
display.fillRoundRect(10, 100, 100, 100, 10, display.BLACK)
display.drawTriangle(300, 100, 400, 150, 400, 100, display.BLACK)
# If it's rotation 0 or 2, also add this filled triangle
if display.rotation % 2 == 0:
display.fillTriangle(500, 101, 400, 150, 400, 100, display.BLACK)
display.display()
time.sleep(5)
# Draws image from bytearray
display.setRotation(0)
display.drawBitmap(120, 200, image, 576, 100)
#Use display.partialUpdate instead of display.display() to draw only updated pixels
display.partialUpdate()
# Show on the display!
# Use display.partialUpdate instead of display.display() to draw only updated pixels
# This makes for a faster update
# IMPORTANT: the display should be fully updated every ~10 partialUpdates with display.display()
# This ensures the image retains it's quality
display.partialUpdate()
# Wait 5 seconds
time.sleep(5)
# Reset the rotation
display.setRotation(0)
# We've drawn the pattern, now let's draw the Soldered logo right in the middle
display.drawBitmap(494, 391, soldered_logo, 211, 44)
# Show on the display
display.display()

View File

@ -1,32 +1,39 @@
# Include needed libraries
# This example will show you how to draw different shades of gray using grayscale mode
# Include needed libraries
from inkplate10 import Inkplate
from image import *
from soldered_logo import *
import time
# Initialize inkplate display
# Create Inkplate object in 2-bit grayscale mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function, you can make infinite while loop inside this to run code indefinitely
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Draw palet of posible colors
#use color values 0, 1, 2, 3
display.writeFillRect(0, 0, 25, 600, 3)
display.writeFillRect(25, 0, 25, 600, 2)
display.writeFillRect(50, 0, 25, 600, 1)
display.writeFillRect(75, 0, 25, 600, 0)
# Draw pallet of posible shades
# 0 being the lightest (white), 3 being the darkest
display.writeFillRect(0, 0, 25, 825, 3)
display.writeFillRect(25, 0, 25, 825, 2)
display.writeFillRect(50, 0, 25, 825, 1)
display.writeFillRect(75, 0, 25, 825, 0)
# Show on the display
display.display()
# Wait 3 seconds
time.sleep(3)
# Draws image from bytearray
display.setRotation(0)
display.drawBitmap(120, 200, image, 576, 100)
display.display()
time.sleep(10)
# Let's draw the Soldered logo and show it on the display
display.drawBitmap(248, 391, soldered_logo, 211, 44)
display.display()

View File

@ -1,22 +1,47 @@
from inkplate10 import Inkplate
from image import *
# This example will show you how to read the voltage of the battery
# and also the temperature from the TPS and print it on the screen
# Include needed libraries
from inkplate10 import Inkplate
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Get the battery reading as a string
battery = str(display.readBattery())
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
display.printText(100, 100, "batt: " + battery + "V")
# Print the text at coordinates 100,100 (from the upper left corner)
display.printText(100, 100, "Battery voltage: " + battery + "V")
# Show it on the display
display.display()
# Wait 5 seconds
time.sleep(5)
# Get the temperature reading, also as a string
temperature = str(display.readTemperature())
display.setTextSize(2)
display.printText(100, 150, "TEMP: " + temperature + "C")
# Print the text at coordinates 100, 150, and also add the measurement unit
display.printText(100, 150, "Temperature: " + temperature + "C")
# Show it on the display
display.display()

View File

@ -0,0 +1,44 @@
# This example shows how to draw a grayscale image from the SD card
# Copy the image from Sd_card_example_files and place it on the microSD card
# NOTE: This takes quite a while as MicroPython can be a bit slow
# Include needed libraries
from inkplate10 import Inkplate
import os, time
# Init display in 2bit mode, important
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# SD Card must be initialised with this function
display.initSDCard()
# Wait one second so we're totally sure it's initialized
time.sleep(1)
# Wake the SD (power ON)
display.SDCardWake()
# Draw image in grayscale and display it
# Also print a message before and after
print("Starting to draw image from file!")
display.drawImageFile(0, 0, "sd/1.bmp", False)
display.display()
print("Finished drawing image from file!")
# Put the SD card back to sleep to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()

View File

@ -1,14 +1,19 @@
# This example will show you how to connect to WiFi
# get data from the internet and then print it
# Include needed libraries
import network
import time
from inkplate10 import Inkplate
ssid = "e-radionica.com"
password = "croduino"
# Enter your WiFi credentials here
ssid = ""
password = ""
# Function which connects to WiFi
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_basics.html
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print("connecting to network...")
@ -18,11 +23,10 @@ def do_connect():
pass
print("network config:", sta_if.ifconfig())
# This function does a HTTP GET request
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
def http_get(url):
import socket
res = ""
_, _, host, path = url.split("/", 3)
addr = socket.getaddrinfo(host, 80)[0][-1]
@ -36,25 +40,32 @@ def http_get(url):
else:
break
s.close()
return res
# Main function
if __name__ == "__main__":
# Calling functions defined above
do_connect()
response = http_get("http://micropython.org/ks/test.html")
# First, connect
do_connect()
# Initialise our Inkplate object
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page/resource, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Print response in lines
cnt = 0
for x in response.split("\n"):
display.printText(
10, 10 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 10
# Create and initialize our Inkplate object in 1-bit mode
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
# Display image from buffer
display.display()
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
# Print response line by line
cnt = 0
for x in response.split("\n"):
display.printText(
10, 20 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 20
# Display image from buffer in full refresh
display.display()

View File

@ -1,21 +1,42 @@
# For this example, copy the files from the directory "Sd_card_example_files"
# to an empty microSD card's root folder and then insert it into Inkplate
# Include required libraries
import os, time
from inkplate10 import Inkplate
# Create Inkplate object in 2-bit (grayscale) mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
display.begin()
# This prints all the files on card
print(os.listdir("/sd"))
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
f = open("sd/text.txt", "r")
# SD Card must be initialised with this function
display.initSDCard()
# Print file contents
print(f.read())
f.close()
# This prints all the files on card
print(os.listdir("/sd"))
time.sleep(5)
# Open the file text.txt in read only mode and print it's contents
f = open("sd/text.txt", "r")
print(f.read()) # This should print 5 lines of "Lorem Ipsum"
f.close() # Close the file
# Utterly slow, can take minutes :(
display.drawImageFile(0, 0, "sd/1.bmp")
# Wait 5 seconds
time.sleep(5)
display.display()
# Draw the image titled "1.bmp"
# Warning, this takes quite a while
# It's faster with smaller images or in 1-bit mode
display.drawImageFile(0, 0, "sd/1.bmp")
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# Show the image from the buffer
display.display()

View File

@ -0,0 +1,60 @@
# This example shows you how to use the GPIO expander's pins
# Soldered Inkplate10 has an internal and external GPIO expander
# See below which pins are available
# Include needed libraries
import time
from mcp23017 import *
from inkplate10 import Inkplate
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# pin = display.gpioExpanderPin(gpioExpander,pin,mode)
# Supported gpio expanders on Soldered Inkplate 10: 1, 2 (internal, external)
# Supported modes: modeINPUT, modeINPUT_PULLUP, modeINPUT_PULLDOWN, modeOUTPUT
# The pins are listed below
# Declare all the available pins as output:
expander1_P1_1 = display.gpioExpanderPin(1, 9, modeOUTPUT)
expander1_P1_2 = display.gpioExpanderPin(1, 10, modeOUTPUT)
expander1_P1_3 = display.gpioExpanderPin(1, 11, modeOUTPUT)
expander1_P1_4 = display.gpioExpanderPin(1, 12, modeOUTPUT)
expander1_P1_5 = display.gpioExpanderPin(1, 13, modeOUTPUT)
expander1_P1_6 = display.gpioExpanderPin(1, 14, modeOUTPUT)
expander1_P1_7 = display.gpioExpanderPin(1, 15, modeOUTPUT)
expander2_P0_0 = display.gpioExpanderPin(2, 0, modeOUTPUT)
expander2_P0_1 = display.gpioExpanderPin(2, 1, modeOUTPUT)
expander2_P0_2 = display.gpioExpanderPin(2, 2, modeOUTPUT)
expander2_P0_3 = display.gpioExpanderPin(2, 3, modeOUTPUT)
expander2_P0_4 = display.gpioExpanderPin(2, 4, modeOUTPUT)
expander2_P0_5 = display.gpioExpanderPin(2, 5, modeOUTPUT)
expander2_P0_6 = display.gpioExpanderPin(2, 6, modeOUTPUT)
expander2_P0_7 = display.gpioExpanderPin(2, 7, modeOUTPUT)
expander2_P1_0 = display.gpioExpanderPin(2, 8, modeOUTPUT)
expander2_P1_1 = display.gpioExpanderPin(2, 9, modeOUTPUT)
expander2_P1_2 = display.gpioExpanderPin(2, 10, modeOUTPUT)
expander2_P1_3 = display.gpioExpanderPin(2, 11, modeOUTPUT)
expander2_P1_4 = display.gpioExpanderPin(2, 12, modeOUTPUT)
expander2_P1_5 = display.gpioExpanderPin(2, 13, modeOUTPUT)
expander2_P1_6 = display.gpioExpanderPin(2, 14, modeOUTPUT)
expander2_P1_7 = display.gpioExpanderPin(2, 15, modeOUTPUT)
# Take the previously declared pin 1_5 on expander 2 and blink it
# To see the blinking, attatch a 300Ohm resistor and LED between that pin and GND
while (1):
expander2_P1_5.digitalWrite(1)
time.sleep(0.5)
expander2_P1_5.digitalWrite(0)
time.sleep(0.5)
# Infinite loop, this goes on forever

View File

@ -1,57 +1,79 @@
from inkplate10 import Inkplate
from image import *
# This example shows you how to use the touchpads
# Only older models of Inkplate10 (e-Radionica Inkplate 10) have them
# Include required libraries
from inkplate10 import Inkplate
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Create some coordinates and a radius for drawing a circle
circle_x = 400
circle_y = 300
circle_r = 40
#main function used by micropython
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# function to show text at the top of the screen
# need to be called every time we clear display
def topText():
# Function to show text at the top of the screen
# Needs to be called every time we clear the display to re-draw the text
def draw_top_text():
display.setTextSize(2)
display.printText(100, 10, "TOUCHPADS EXAMPLE! 1, 3 TO MOVE CIRCLE, 2 TO RESET")
topText()
# Call it
draw_top_text()
# Touchpads definitions
touch1, touch2, touch3 = display.TOUCH1, display.TOUCH2, display.TOUCH3
#draw initial circle for touchpad demonstration
# Draw the initial circle for touchpad demonstration
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
# Show everything on the display
display.display()
#Main loop that will run forever or until battery is dead
# Start infinite loop
while True:
#check if touchpad is pressed
# If a touchpad is pressed, move the circle and redraw everything
# Touch 1 moves the circle to the left
if touch1():
circle_x -= 40
display.clearDisplay()
topText()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
display.partialUpdate()
if touch3():
circle_x += 40
display.clearDisplay()
topText()
draw_top_text()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
# Show on the display!
# Use display.partialUpdate instead of display.display() to draw only updated pixels
# This makes for a faster update
# IMPORTANT: the display should be fully updated every ~10 partialUpdates with display.display()
# This ensures the image retains it's quality
display.partialUpdate()
# Touch 2 will reset the position of the circle
if touch2():
circle_x = 400
circle_y = 300
circle_r = 40
display.clearDisplay()
topText()
draw_top_text()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
display.partialUpdate()
display.display() # Do a full refresh also
# Touch 3 will move the circle to the right
if touch3():
circle_x += 40
display.clearDisplay()
draw_top_text()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
display.partialUpdate()

View File

@ -1,42 +1,50 @@
# This example will show you how to draw shapes and text in black, white and red
# Also, it will draw a bitmap of the Soldered logo in the middle
# Include needed libraries
from inkplate2 import Inkplate
from soldered_logo import *
import time
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Must be called before using the display, like in Arduino
display.begin()
display.clearDisplay()
# Print some text
# Initialize the display, needs to be called only once
display.begin()
# Print some text at location x = 5 px, y = 8 px
# So, close to the upper left corner
display.printText(5, 8, "Welcome to Inkplate 2")
# Print some larger text in red
display.setTextSize(2)
display.printText(5, 20, "MicroPython!", display.RED)
# Fill a black circle and draw some white and red circles in it
# Fill a black circle and draw some white and red circles inside it
display.fillCircle(178, 16, 15, display.BLACK)
display.drawCircle(178, 16, 13, display.RED)
display.drawCircle(178, 16, 9, display.WHITE)
display.drawCircle(178, 16, 4, display.RED)
# Draw a red checkerboard pattern
# Draw a red checkerboard pattern with a loop
for x in range(30):
display.fillRect(0 + (5*x*2), 38, 5, 5, display.RED)
for x in range(30):
display.fillRect(5 + (5*x*2), 42, 5, 5, display.RED)
# Draw some lines
# Draw some horizontal lines
display.drawLine(0, 49, 214, 49, display.BLACK)
display.drawLine(0, 51, 214, 51, display.RED)
display.drawLine(0, 53, 214, 53, display.BLACK)
display.drawLine(0, 55, 214, 55, display.RED)
# Draw a bitmap image
# Draw the soldered logo as a bitmap image in red
display.drawBitmap(0, 58, soldered_logo, 211, 44, display.RED)
# Display everything on the ePaper - must be called!
display.display()
# Display everything on Inkplate's display
# This function must be called after drawing, or else the display won't update
# The display flickers when it updates and it takes a while, this is normal
display.display()

View File

@ -0,0 +1,29 @@
# This example will show you how to draw a color image (black, white, red)
# The pixel format is four pixels per byte, each pixel two bits
# 00 is Black
# 01 is White
# 10 is Red
# Include needed libraries
from inkplate2 import Inkplate
# Import the image
# It should also be copied to Inkplate when copying other libraries
# Check the README for more info
from color_image_inkplate2 import color_image_inkplate2
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# color_image_inkplate2 is 212x104px, draw it over the whole screen
# Arguments are: x start, y start, width, height, and then the image buffer
display.drawColorImage(0, 0, 212, 104, color_image_inkplate2)
# Show it on the display
display.display()

View File

@ -1,16 +1,19 @@
# This example will show you how to connect to WiFi
# get data from the internet and then print it
# Include needed libraries
import network
import time
from inkplate2 import Inkplate
ssid = ""
password = ""
# Enter your WiFi credentials here
ssid = "Soldered"
password = "dasduino"
# Function which connects to WiFi
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_basics.html
def do_connect():
import network
# Connect to WiFi
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print("connecting to network...")
@ -20,7 +23,7 @@ def do_connect():
pass
print("network config:", sta_if.ifconfig())
# Does a HTTP GET request
# This function does a HTTP GET request
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
def http_get(url):
import socket
@ -37,28 +40,32 @@ def http_get(url):
else:
break
s.close()
return res
# Main function
if __name__ == "__main__":
# Calling functions defined above
do_connect()
# First, connect
do_connect()
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page/resource, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Initialise our Inkplate object
display = Inkplate()
display.begin()
# Create and initialize our Inkplate object
display = Inkplate()
display.begin()
# Print the GET response in lines
cnt = 0
for x in response.split("\n"):
display.printText(
10, 10 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 10
# Print response line by line
cnt = 0
for x in response.split("\n"):
display.printText(
2, 2 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 10
# Display image from buffer
display.display()
# Also print to terminal because the screen is small
print(x)
# Display image from buffer
display.display()

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 KiB

View File

@ -0,0 +1,9 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia odio vitae vestibulum. Donec in efficitur leo, nec vehicula elit.
Suspendisse potenti. Nullam quis risus eget urna mollis ornare vel eu leo. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.
Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Pellentesque in ipsum id orci porta dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.
Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vivamus suscipit tortor eget felis porttitor volutpat. Cras ultricies ligula sed magna dictum porta.
Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Sed porttitor lectus nibh, et malesuada fames ac turpis egestas.

View File

@ -0,0 +1,63 @@
# This example will show you how to draw shapes and text in black, white and red
# Also, it will draw a bitmap of the Soldered logo in the middle
# Include needed libraries
from inkplate4 import Inkplate
from soldered_logo import *
import time
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Let's draw some shapes!
# This example will draw shapes around the upper left corner, and then rotate the screen
# This creates a symmetrical-looking pattern of various shapes
for r in range(4):
# Sets the screen rotation
display.setRotation(r)
# All drawing functions
# Draw some of the elements in red so we can see the color
display.drawPixel(20, 5, display.BLACK)
display.drawRect(10, 40, 20, 60, display.RED)
display.drawCircle(30, 60, 15, display.RED)
display.fillCircle(70, 30, 15, display.BLACK)
display.drawFastHLine(30, 75, 100, display.BLACK)
display.drawFastVLine(100, 10, 40, display.BLACK)
display.drawLine(5, 5, 150, 150, display.BLACK)
display.drawRoundRect(160, 5, 20, 60, 10, display.BLACK)
display.fillRoundRect(150, 70, 60, 15, 10, display.RED)
display.drawTriangle(5, 196, 60, 196, 33, 149, display.RED)
# Show on the display!
# This function must be called in order for the display to update
display.display()
# Wait 5 seconds
time.sleep(5)
# Reset the rotation
display.setRotation(0)
# Let's draw the Soldered logo right in the middle
# First, fill the background of the image white
display.fillRect(94, 128, 211, 44, display.WHITE) # Draw white background
# Now, draw the logo
display.drawBitmap(94, 128, soldered_logo, 211, 44, display.RED)
# Show on the display
display.display()

View File

@ -0,0 +1,34 @@
# This example will show you how to read the voltage of the battery
# and also print it on the screen
# Include needed libraries
from inkplate4 import Inkplate
import time
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Get the battery reading as a string
battery = str(display.readBattery())
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
# Print the text at coordinates 50, 50 (from the upper left corner)
display.printText(50, 50, "Battery voltage: " + battery + "V")
# Show it on the display
display.display()

View File

@ -0,0 +1,71 @@
# This example will show you how to connect to WiFi
# get data from the internet and then print it
# Include needed libraries
import network
import time
from inkplate4 import Inkplate
# Enter your WiFi credentials here
ssid = ""
password = ""
# Function which connects to WiFi
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_basics.html
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print("connecting to network...")
sta_if.active(True)
sta_if.connect(ssid, password)
while not sta_if.isconnected():
pass
print("network config:", sta_if.ifconfig())
# This function does a HTTP GET request
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
def http_get(url):
import socket
res = ""
_, _, host, path = url.split("/", 3)
addr = socket.getaddrinfo(host, 80)[0][-1]
s = socket.socket()
s.connect(addr)
s.send(bytes("GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n" % (path, host), "utf8"))
while True:
data = s.recv(100)
if data:
res += str(data, "utf8")
else:
break
s.close()
return res
# Main function
if __name__ == "__main__":
# First, connect
do_connect()
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page/resource, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Create and initialize our Inkplate object
display = Inkplate()
display.begin()
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
# Print response line by line
cnt = 0
for x in response.split("\n"):
display.printText(
10, 20 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 20
# Display image from buffer
display.display()

View File

@ -0,0 +1,42 @@
# For this example, copy the files from the directory "Sd_card_example_files"
# to an empty microSD card's root folder and then insert it into Inkplate
# Include required libraries
import os, time
from inkplate4 import Inkplate
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# SD Card must be initialised with this function
display.initSDCard()
# This prints all the files on card
print(os.listdir("/sd"))
# Open the file text.txt in read only mode and print it's contents
f = open("sd/text.txt", "r")
print(f.read()) # This should print 5 lines of "Lorem Ipsum"
f.close() # Close the file
# Wait 5 seconds
time.sleep(5)
# Draw the image titled "1.bmp"
# Warning, this takes quite a while
# It's faster with smaller images
display.drawImageFile(0, 0, "sd/1.bmp")
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# Show the image from the buffer
display.display()

View File

@ -0,0 +1,42 @@
import time
from PCAL6416A import *
from inkplate4 import Inkplate
display = Inkplate()
# This script demonstrates using all the available GPIO expander pins as output
if __name__ == "__main__":
# Must be called before using, line in Arduino
display.begin()
# pin = display.gpioExpanderPin(gpioExpander,pin,mode)
# Supported modes: modeINPUT, modeINPUT_PULLUP, modeINPUT_PULLDOWN, modeOUTPUT
# Supported pins on Soldered Inkplate 4 are listed below
expander_P0_0 = display.gpioExpanderPin(0, modeOUTPUT)
expander_P0_1 = display.gpioExpanderPin(1, modeOUTPUT)
expander_P0_2 = display.gpioExpanderPin(2, modeOUTPUT)
expander_P0_3 = display.gpioExpanderPin(3, modeOUTPUT)
expander_P0_4 = display.gpioExpanderPin(4, modeOUTPUT)
expander_P0_5 = display.gpioExpanderPin(5, modeOUTPUT)
expander_P0_6 = display.gpioExpanderPin(6, modeOUTPUT)
expander_P0_7 = display.gpioExpanderPin(7, modeOUTPUT)
expander_P1_0 = display.gpioExpanderPin(8, modeOUTPUT)
expander_P1_1 = display.gpioExpanderPin(9, modeOUTPUT)
expander_P1_2 = display.gpioExpanderPin(10, modeOUTPUT)
expander_P1_3 = display.gpioExpanderPin(11, modeOUTPUT)
expander_P1_4 = display.gpioExpanderPin(12, modeOUTPUT)
expander_P1_5 = display.gpioExpanderPin(13, modeOUTPUT)
expander_P1_6 = display.gpioExpanderPin(14, modeOUTPUT)
expander_P1_7 = display.gpioExpanderPin(15, modeOUTPUT)
# Take the previously declared pin 1_5 and blink it
# To see the blinking, attatch a 300Ohm resistor and LED between that pin and GND
while (1):
expander_P1_5.digitalWrite(1)
time.sleep(0.5)
expander_P1_5.digitalWrite(0)
time.sleep(0.5)
# Infinite loop, this goes on forever

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -0,0 +1,9 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia odio vitae vestibulum. Donec in efficitur leo, nec vehicula elit.
Suspendisse potenti. Nullam quis risus eget urna mollis ornare vel eu leo. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.
Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Pellentesque in ipsum id orci porta dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.
Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vivamus suscipit tortor eget felis porttitor volutpat. Cras ultricies ligula sed magna dictum porta.
Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Sed porttitor lectus nibh, et malesuada fames ac turpis egestas.

View File

@ -1,16 +1,33 @@
# This example will show you how to draw basic black and white shapes
# Also, it will draw a bitmap of the Soldered logo in the middle
# Include all the required libraries
from inkplate5 import Inkplate
from soldered_logo import *
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Must be called before using, like in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Let's draw some shapes!
# This example will draw shapes around the upper left corner, and then rotate the screen
# This creates a symmetrical-looking pattern of various shapes
for r in range(4):
# Sets the screen rotation
display.setRotation(r)
@ -26,17 +43,25 @@ if __name__ == "__main__":
display.fillRoundRect(10, 100, 100, 100, 10, display.BLACK)
display.drawTriangle(300, 100, 400, 150, 400, 100, display.BLACK)
print("rotation "+str(r))
# If it's rotation 0 or 2, also add this filled triangle
if display.rotation % 2 == 0:
display.fillTriangle(500, 101, 400, 150, 400, 100, display.BLACK)
display.display()
# Show on the display!
# Use display.partialUpdate instead of display.display() to draw only updated pixels
# This makes for a faster update
# IMPORTANT: the display should be fully updated every ~10 partialUpdates with display.display()
# This ensures the image retains it's quality
display.partialUpdate()
# Wait 5 seconds
time.sleep(5)
# Reset the rotation
display.setRotation(0)
# Draws image from bytearray
# Parameters are X position, Y position, the byte array, and the exact dimensions of the image (width, height)
# We've drawn the pattern, now let's draw the Soldered logo right in the middle
display.drawBitmap(374, 248, soldered_logo, 211, 44)
#Use display.partialUpdate instead of display.display() to draw only updated pixels
display.partialUpdate()
# Show on the display
display.display()

View File

@ -1,34 +1,40 @@
# Include needed libraries
# This example will show you how to draw different shades of gray using grayscale mode
# Include needed libraries
from inkplate5 import Inkplate
from soldered_logo import *
import time
# Initialize inkplate display
# Create Inkplate object in 2-bit grayscale mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function, you can make infinite while loop inside this to run code indefinitely
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Draw palet of posible colors
#use color values 0, 1, 2, 3
# Draw pallet of posible shades
# 0 being the lightest (white), 3 being the darkest
display.writeFillRect(0, 0, 25, 600, 3)
display.writeFillRect(25, 0, 25, 600, 2)
display.writeFillRect(50, 0, 25, 600, 1)
display.writeFillRect(75, 0, 25, 600, 0)
# Show on the display
display.display()
# Wait 3 seconds
time.sleep(3)
display.setRotation(0)
# Draws image from bytearray
# Parameters are X position, Y position, the byte array, and the exact dimensions of the image (width, height)
# Let's draw the Soldered logo and show it on the display
display.drawBitmap(374, 248, soldered_logo, 211, 44)
display.display()
time.sleep(10)

View File

@ -1,21 +1,47 @@
from inkplate5 import Inkplate
from image import *
# This example will show you how to read the voltage of the battery
# and also the temperature from the TPS and print it on the screen
# Include needed libraries
from inkplate5 import Inkplate
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Get the battery reading as a string
battery = str(display.readBattery())
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
display.printText(100, 100, "batt: " + battery + "V")
# Print the text at coordinates 100,100 (from the upper left corner)
display.printText(100, 100, "Battery voltage: " + battery + "V")
# Show it on the display
display.display()
# Wait 5 seconds
time.sleep(5)
# Get the temperature reading, also as a string
temperature = str(display.readTemperature())
display.setTextSize(2)
display.printText(100, 150, "TEMP: " + temperature + "C")
# Print the text at coordinates 100, 150, and also add the measurement unit
display.printText(100, 150, "Temperature: " + temperature + "C")
# Show it on the display
display.display()

View File

@ -0,0 +1,44 @@
# This example shows how to draw a grayscale image from the SD card
# Copy the image from Sd_card_example_files and place it on the microSD card
# NOTE: This takes quite a while as MicroPython can be a bit slow
# Include needed libraries
from inkplate5 import Inkplate
import os, time
# Init display in 2bit mode, important
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# SD Card must be initialised with this function
display.initSDCard()
# Wait one second so we're totally sure it's initialized
time.sleep(1)
# Wake the SD (power ON)
display.SDCardWake()
# Draw image in grayscale and display it
# Also print a message before and after
print("Starting to draw image from file!")
display.drawImageFile(0, 0, "sd/1.bmp", False)
display.display()
print("Finished drawing image from file!")
# Put the SD card back to sleep to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()

View File

@ -1,29 +1,42 @@
# For this example, copy the files from the directory "Sd_card_example_files"
# to an empty microSD card's root folder and then insert it into Inkplate
# Include required libraries
import os, time
from inkplate5 import Inkplate
# Create Inkplate object in 2-bit (grayscale) mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
display.begin()
# SD Card must be initialised with this function
display.initSDCard()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# This prints all the files on card
print(os.listdir("/sd"))
# SD Card must be initialised with this function
display.initSDCard()
f = open("sd/text.txt", "r")
# This prints all the files on card
print(os.listdir("/sd"))
# Print file contents
print(f.read())
f.close()
# Open the file text.txt in read only mode and print it's contents
f = open("sd/text.txt", "r")
print(f.read()) # This should print 5 lines of "Lorem Ipsum"
f.close() # Close the file
time.sleep(5)
# Wait 5 seconds
time.sleep(5)
# Utterly slow, can take minutes :(
display.drawImageFile(0, 0, "sd/1.bmp")
# Draw the image titled "1.bmp"
# Warning, this takes quite a while
# It's faster with smaller images or in 1-bit mode
display.drawImageFile(0, 0, "sd/1.bmp")
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
display.display()
# Show the image from the buffer
display.display()

View File

@ -0,0 +1,39 @@
# This example shows you how to use the GPIO expander's pins
# See below which pins are available
# Include needed libraries
import time
from PCAL6416A import *
from inkplate5 import Inkplate
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# pin = display.gpioExpanderPin(gpioExpander,pin,mode)
# Supported modes: modeINPUT, modeINPUT_PULLUP, modeINPUT_PULLDOWN, modeOUTPUT
# Supported pins on Soldered Inkplate 5 are listed below
# Declare all the available pins as output:
expander_P1_1 = display.gpioExpanderPin(9, modeOUTPUT)
expander_P1_2 = display.gpioExpanderPin(10, modeOUTPUT)
expander_P1_3 = display.gpioExpanderPin(11, modeOUTPUT)
expander_P1_4 = display.gpioExpanderPin(12, modeOUTPUT)
expander_P1_5 = display.gpioExpanderPin(13, modeOUTPUT)
expander_P1_6 = display.gpioExpanderPin(14, modeOUTPUT)
expander_P1_7 = display.gpioExpanderPin(15, modeOUTPUT)
# Take the previously declared pin 1_5 and blink it
# To see the blinking, attatch a 300Ohm resistor and LED between that pin and GND
while (1):
expander_P1_5.digitalWrite(1)
time.sleep(0.5)
expander_P1_5.digitalWrite(0)
time.sleep(0.5)
# Infinite loop, this goes on forever

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -0,0 +1,9 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia odio vitae vestibulum. Donec in efficitur leo, nec vehicula elit.
Suspendisse potenti. Nullam quis risus eget urna mollis ornare vel eu leo. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.
Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Pellentesque in ipsum id orci porta dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.
Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vivamus suscipit tortor eget felis porttitor volutpat. Cras ultricies ligula sed magna dictum porta.
Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Sed porttitor lectus nibh, et malesuada fames ac turpis egestas.

View File

@ -1,20 +1,37 @@
# This example will show you how to draw basic black and white shapes
# Also, it will draw a bitmap of the Soldered logo in the middle
# Include all the required libraries
from inkplate6 import Inkplate
from image import *
from soldered_logo import *
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Let's draw some shapes!
# This example will draw shapes around the upper left corner, and then rotate the screen
# This creates a symmetrical-looking pattern of various shapes
for r in range(4):
# Sets the screen rotation
display.setRotation(r)
# All drawing functions
# All the drawing functions
display.drawPixel(100, 100, display.BLACK)
display.drawRect(50, 50, 75, 75, display.BLACK)
display.drawCircle(200, 200, 30, display.BLACK)
@ -26,14 +43,25 @@ if __name__ == "__main__":
display.fillRoundRect(10, 100, 100, 100, 10, display.BLACK)
display.drawTriangle(300, 100, 400, 150, 400, 100, display.BLACK)
# If it's rotation 0 or 2, also add this filled triangle
if display.rotation % 2 == 0:
display.fillTriangle(500, 101, 400, 150, 400, 100, display.BLACK)
display.display()
time.sleep(5)
# Draws image from bytearray
display.setRotation(0)
display.drawBitmap(120, 200, image, 576, 100)
#Use display.partialUpdate instead of display.display() to draw only updated pixels
display.partialUpdate()
# Show on the display!
# Use display.partialUpdate instead of display.display() to draw only updated pixels
# This makes for a faster update
# IMPORTANT: the display should be fully updated every ~10 partialUpdates with display.display()
# This ensures the image retains it's quality
display.partialUpdate()
# Wait 5 seconds
time.sleep(5)
# Reset the rotation
display.setRotation(0)
# We've drawn the pattern, now let's draw the Soldered logo right in the middle
display.drawBitmap(294, 20, soldered_logo, 211, 44)
# Show on the display
display.display()

View File

@ -1,33 +1,39 @@
# Include needed libraries
# This example will show you how to draw different shades of gray using grayscale mode
# Include needed libraries
from inkplate6 import Inkplate
from image import *
from soldered_logo import *
import time
# Initialize inkplate display
# Create Inkplate object in 2-bit grayscale mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function, you can make infinite while loop inside this to run code indefinitely
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Draw palet of posible colors
#use color values 0, 1, 2, 3
# Draw pallet of posible shades
# 0 being the lightest (white), 3 being the darkest
display.writeFillRect(0, 0, 25, 600, 3)
display.writeFillRect(25, 0, 25, 600, 2)
display.writeFillRect(50, 0, 25, 600, 1)
display.writeFillRect(75, 0, 25, 600, 0)
# Show on the display
display.display()
# Wait 3 seconds
time.sleep(3)
# Draws image from bytearray
display.setRotation(0)
display.drawBitmap(120, 200, image, 576, 100)
display.display()
time.sleep(10)
# Let's draw the Soldered logo and show it on the display
display.drawBitmap(294, 278, soldered_logo, 211, 44)
display.display()

View File

@ -1,21 +1,47 @@
from inkplate6 import Inkplate
from image import *
# This example will show you how to read the voltage of the battery
# and also the temperature from the TPS and print it on the screen
# Include needed libraries
from inkplate6 import Inkplate
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Get the battery reading as a string
battery = str(display.readBattery())
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
display.printText(100, 100, "batt: " + battery + "V")
# Print the text at coordinates 100,100 (from the upper left corner)
display.printText(100, 100, "Battery voltage: " + battery + "V")
# Show it on the display
display.display()
# Wait 5 seconds
time.sleep(5)
# Get the temperature reading, also as a string
temperature = str(display.readTemperature())
display.setTextSize(2)
display.printText(100, 150, "TEMP: " + temperature + "C")
# Print the text at coordinates 100, 150, and also add the measurement unit
display.printText(100, 150, "Temperature: " + temperature + "C")
# Show it on the display
display.display()

View File

@ -0,0 +1,44 @@
# This example shows how to draw a grayscale image from the SD card
# Copy the image from Sd_card_example_files and place it on the microSD card
# NOTE: This takes quite a while as MicroPython can be a bit slow
# Include needed libraries
from inkplate6 import Inkplate
import os, time
# Init display in 2bit mode, important
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# SD Card must be initialised with this function
display.initSDCard()
# Wait one second so we're totally sure it's initialized
time.sleep(1)
# Wake the SD (power ON)
display.SDCardWake()
# Draw image in grayscale and display it
# Also print a message before and after
print("Starting to draw image from file!")
display.drawImageFile(0, 0, "sd/1.bmp", False)
display.display()
print("Finished drawing image from file!")
# Put the SD card back to sleep to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()

View File

@ -1,14 +1,19 @@
# This example will show you how to connect to WiFi
# get data from the internet and then print it
# Include needed libraries
import network
import time
from inkplate6 import Inkplate
from soldered_inkplate6 import Inkplate
# Enter your WiFi credentials here
ssid = ""
password = ""
# Function which connects to WiFi
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_basics.html
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print("connecting to network...")
@ -18,11 +23,10 @@ def do_connect():
pass
print("network config:", sta_if.ifconfig())
# This function does a HTTP GET request
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
def http_get(url):
import socket
res = ""
_, _, host, path = url.split("/", 3)
addr = socket.getaddrinfo(host, 80)[0][-1]
@ -36,25 +40,32 @@ def http_get(url):
else:
break
s.close()
return res
# Main function
if __name__ == "__main__":
# Calling functions defined above
do_connect()
response = http_get("http://micropython.org/ks/test.html")
# First, connect
do_connect()
# Initialise our Inkplate object
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page/resource, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Print response in lines
cnt = 0
for x in response.split("\n"):
display.printText(
10, 10 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 10
# Create and initialize our Inkplate object in 1-bit mode
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
# Display image from buffer
display.display()
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
# Print response line by line
cnt = 0
for x in response.split("\n"):
display.printText(
10, 20 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 20
# Display image from buffer in full refresh
display.display()

View File

@ -1,21 +1,42 @@
# For this example, copy the files from the directory "Sd_card_example_files"
# to an empty microSD card's root folder and then insert it into Inkplate
# Include required libraries
import os, time
from inkplate6 import Inkplate
# Create Inkplate object in 2-bit (grayscale) mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
display.begin()
# This prints all the files on card
print(os.listdir("/sd"))
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
f = open("sd/text.txt", "r")
# SD Card must be initialised with this function
display.initSDCard()
# Print file contents
print(f.read())
f.close()
# This prints all the files on card
print(os.listdir("/sd"))
time.sleep(5)
# Open the file text.txt in read only mode and print it's contents
f = open("sd/text.txt", "r")
print(f.read()) # This should print 5 lines of "Lorem Ipsum"
f.close() # Close the file
# Utterly slow, can take minutes :(
display.drawImageFile(0, 0, "sd/1.bmp")
# Wait 5 seconds
time.sleep(5)
display.display()
# Draw the image titled "1.bmp"
# Warning, this takes quite a while
# It's faster with smaller images or in 1-bit mode
display.drawImageFile(0, 0, "sd/1.bmp")
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# Show the image from the buffer
display.display()

View File

@ -0,0 +1,60 @@
# This example shows you how to use the GPIO expander's pins
# Soldered Inkplate6 has an internal and external GPIO expander
# See below which pins are available
# Include needed libraries
import time
from PCAL6416A import *
from soldered_inkplate6 import Inkplate
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# pin = display.gpioExpanderPin(gpioExpander,pin,mode)
# Supported gpio expanders on Inkplate 6: 1, 2 (internal, external)
# Supported modes: modeINPUT, modeINPUT_PULLUP, modeINPUT_PULLDOWN, modeOUTPUT
# Supported pins on Inkplate 6 are listed below
# Declare all the available pins as output:
expander1_P1_1 = display.gpioExpanderPin(1, 9, modeOUTPUT)
expander1_P1_2 = display.gpioExpanderPin(1, 10, modeOUTPUT)
expander1_P1_3 = display.gpioExpanderPin(1, 11, modeOUTPUT)
expander1_P1_4 = display.gpioExpanderPin(1, 12, modeOUTPUT)
expander1_P1_5 = display.gpioExpanderPin(1, 13, modeOUTPUT)
expander1_P1_6 = display.gpioExpanderPin(1, 14, modeOUTPUT)
expander1_P1_7 = display.gpioExpanderPin(1, 15, modeOUTPUT)
expander2_P0_0 = display.gpioExpanderPin(2, 0, modeOUTPUT)
expander2_P0_1 = display.gpioExpanderPin(2, 1, modeOUTPUT)
expander2_P0_2 = display.gpioExpanderPin(2, 2, modeOUTPUT)
expander2_P0_3 = display.gpioExpanderPin(2, 3, modeOUTPUT)
expander2_P0_4 = display.gpioExpanderPin(2, 4, modeOUTPUT)
expander2_P0_5 = display.gpioExpanderPin(2, 5, modeOUTPUT)
expander2_P0_6 = display.gpioExpanderPin(2, 6, modeOUTPUT)
expander2_P0_7 = display.gpioExpanderPin(2, 7, modeOUTPUT)
expander2_P1_0 = display.gpioExpanderPin(2, 8, modeOUTPUT)
expander2_P1_1 = display.gpioExpanderPin(2, 9, modeOUTPUT)
expander2_P1_2 = display.gpioExpanderPin(2, 10, modeOUTPUT)
expander2_P1_3 = display.gpioExpanderPin(2, 11, modeOUTPUT)
expander2_P1_4 = display.gpioExpanderPin(2, 12, modeOUTPUT)
expander2_P1_5 = display.gpioExpanderPin(2, 13, modeOUTPUT)
expander2_P1_6 = display.gpioExpanderPin(2, 14, modeOUTPUT)
expander2_P1_7 = display.gpioExpanderPin(2, 15, modeOUTPUT)
# Take the previously declared pin 1_5 on expander 2 and blink it
# To see the blinking, attatch a 300Ohm resistor and LED between that pin and GND
while (1):
expander2_P1_5.digitalWrite(1)
time.sleep(0.5)
expander2_P1_5.digitalWrite(0)
time.sleep(0.5)
# Infinite loop, this goes on forever

View File

@ -1,57 +1,79 @@
from inkplate6 import Inkplate
from image import *
# This example shows you how to use the touchpads
# Only older models of Inkplate6 (e-Radionica Inkplate 6) have them
# Include required libraries
from inkplate6 import Inkplate
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Create some coordinates and a radius for drawing a circle
circle_x = 400
circle_y = 300
circle_r = 40
#main function used by micropython
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# function to show text at the top of the screen
# need to be called every time we clear display
def topText():
# Function to show text at the top of the screen
# Needs to be called every time we clear the display to re-draw the text
def draw_top_text():
display.setTextSize(2)
display.printText(100, 10, "TOUCHPADS EXAMPLE! 1, 3 TO MOVE CIRCLE, 2 TO RESET")
topText()
# Call it
draw_top_text()
# Touchpads definitions
touch1, touch2, touch3 = display.TOUCH1, display.TOUCH2, display.TOUCH3
#draw initial circle for touchpad demonstration
# Draw the initial circle for touchpad demonstration
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
# Show everything on the display
display.display()
#Main loop that will run forever or until battery is dead
# Start infinite loop
while True:
#check if touchpad is pressed
# If a touchpad is pressed, move the circle and redraw everything
# Touch 1 moves the circle to the left
if touch1():
circle_x -= 40
display.clearDisplay()
topText()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
display.partialUpdate()
if touch3():
circle_x += 40
display.clearDisplay()
topText()
draw_top_text()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
# Show on the display!
# Use display.partialUpdate instead of display.display() to draw only updated pixels
# This makes for a faster update
# IMPORTANT: the display should be fully updated every ~10 partialUpdates with display.display()
# This ensures the image retains it's quality
display.partialUpdate()
# Touch 2 will reset the position of the circle
if touch2():
circle_x = 400
circle_y = 300
circle_r = 40
display.clearDisplay()
topText()
draw_top_text()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
display.partialUpdate()
display.display() # Do a full refresh also
# Touch 3 will move the circle to the right
if touch3():
circle_x += 40
display.clearDisplay()
draw_top_text()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
display.partialUpdate()

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 KiB

View File

@ -0,0 +1,9 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia odio vitae vestibulum. Donec in efficitur leo, nec vehicula elit.
Suspendisse potenti. Nullam quis risus eget urna mollis ornare vel eu leo. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.
Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Pellentesque in ipsum id orci porta dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.
Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vivamus suscipit tortor eget felis porttitor volutpat. Cras ultricies ligula sed magna dictum porta.
Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Sed porttitor lectus nibh, et malesuada fames ac turpis egestas.

View File

@ -1,22 +1,35 @@
from inkplate6_COLOR import Inkplate
from image import *
import time
# This example will show you how shapes in various colors
# Also, it will draw a bitmap of the Soldered logo in the middle, in blue
# The update speed for this display is quite slow, so no delays in this code
# Include all the required libraries
from inkplate6COLOR import Inkplate
from image import *
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Let's draw some shapes!
# This example will draw shapes around the upper left corner, and then rotate the screen
# This creates a symmetrical-looking pattern of various shapes
for r in range(4):
# Sets the screen rotation
display.setRotation(r)
# All drawing functions
# Available colors are:
# Black, white, green, blue, red, yellow, orange
display.drawPixel(100, 100, display.BLACK)
display.drawRect(50, 50, 75, 75, display.GREEN)
display.drawCircle(200, 200, 30, display.BLUE)
display.fillCircle(300, 300, 30, display.BLACK)
display.fillCircle(300, 300, 30, display.RED)
display.drawFastHLine(20, 100, 50, display.BLACK)
display.drawFastVLine(100, 20, 50, display.ORANGE)
display.drawLine(100, 100, 400, 400, display.ORANGE)
@ -24,7 +37,11 @@ if __name__ == "__main__":
display.fillRoundRect(10, 100, 100, 100, 10, display.YELLOW)
display.drawTriangle(300, 100, 400, 150, 400, 100, display.BLACK)
# Draws image from bytearray
# Reset the rotation
display.setRotation(0)
# We've drawn the pattern, now let's draw the Soldered logo in blue right in the middle
display.drawBitmap(10, 160, image, 576, 100, display.BLUE)
# Show on the display
display.display()

View File

@ -0,0 +1,25 @@
# This example will show you how to draw a color image from buffer
# Include needed libraries
from inkplate6COLOR import Inkplate
# Import the image
# It should also be copied to Inkplate when copying other libraries
# Check the README!
from color_image_inkplate6COLOR import color_image_inkplate6color
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# color_image_inkplate6color is 600x488px, draw it over the whole screen
# Arguments are x start, y start, width, height, and then the image buffer
display.drawColorImage(0, 0, 600, 488, color_image_inkplate6color)
# Show on the display
display.display()

View File

@ -1,16 +1,19 @@
# This example will show you how to connect to WiFi
# get data from the internet and then print it
# Include needed libraries
import network
import time
from inkplate6_COLOR import Inkplate
from inkplate2 import Inkplate
ssid = "e-radionica.com"
password = "croduino"
# Enter your WiFi credentials here
ssid = ""
password = ""
# Function which connects to WiFi
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_basics.html
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print("connecting to network...")
@ -20,11 +23,10 @@ def do_connect():
pass
print("network config:", sta_if.ifconfig())
# This function does a HTTP GET request
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
def http_get(url):
import socket
res = ""
_, _, host, path = url.split("/", 3)
addr = socket.getaddrinfo(host, 80)[0][-1]
@ -38,25 +40,29 @@ def http_get(url):
else:
break
s.close()
return res
# Main function
if __name__ == "__main__":
# Calling functions defined above
do_connect()
response = http_get("http://micropython.org/ks/test.html")
# First, connect
do_connect()
# Initialise our Inkplate object
display = Inkplate()
display.begin()
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page/resource, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Print response in lines
cnt = 0
for x in response.split("\n"):
display.printText(
10, 10 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 10
# Create and initialize our Inkplate object
display = Inkplate()
display.begin()
# Display image from buffer
display.display()
# Print response line by line
cnt = 0
for x in response.split("\n"):
display.printText(
10, 20 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 20
# Display image from buffer
display.display()

View File

@ -1,29 +1,41 @@
import os
import time
from inkplate6_COLOR import Inkplate
# For this example, copy the files from the directory "Sd_card_example_files"
# to an empty microSD card's root folder and then insert it into Inkplate
# Include required libraries
import os, time
from inkplate6COLOR import Inkplate
# Create Inkplate object
display = Inkplate()
display.begin()
# SD Card must be initialised with this function
display.initSDCard()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# This prints all the files on card
print(os.listdir("/sd"))
# SD Card must be initialised with this function
display.initSDCard()
f = open("sd/text.txt", "r")
# This prints all the files on card
print(os.listdir("/sd"))
# Print file contents
print(f.read())
f.close()
# Open the file text.txt in read only mode and print it's contents
f = open("sd/text.txt", "r")
print(f.read()) # This should print 5 lines of "Lorem Ipsum"
f.close() # Close the file
time.sleep(5)
# Wait 5 seconds
time.sleep(5)
display.drawImageFile(0, 0, "sd/1.bmp")
# Draw the image titled "1.bmp"
# Warning, this takes quite a while
display.drawImageFile(0, 0, "sd/1.bmp")
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
display.display()
# Show the image from the buffer
display.display()

View File

@ -1,19 +1,23 @@
# This example shows you how to use the GPIO expander's pins
# See below which pins are available
# Include needed libraries
import time
from PCAL6416A import *
from inkplate6COLOR import Inkplate
from inkplate6_COLOR import Inkplate
# Create Inkplate object
display = Inkplate()
# This script demonstrates using all the available GPIO expander pins as output
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# pin = display.gpioExpanderPin(pin,mode)
# Supported modes: modeINPUT, modeINPUT_PULLUP, modeINPUT_PULLDOWN, modeOUTPUT
# Supported pins on Inkplate 6 COLOR are listed below
# Supported pins on Inkplate 6COLOR COLOR are listed below
expander_P0_0 = display.gpioExpanderPin(0, modeOUTPUT)
expander_P0_1 = display.gpioExpanderPin(1, modeOUTPUT)
@ -32,30 +36,12 @@ if __name__ == "__main__":
expander_P1_5 = display.gpioExpanderPin(13, modeOUTPUT)
expander_P1_6 = display.gpioExpanderPin(14, modeOUTPUT)
expander_P1_7 = display.gpioExpanderPin(15, modeOUTPUT)
pins = (expander_P0_0,
expander_P0_1,
expander_P0_2,
expander_P0_3,
expander_P0_4,
expander_P0_5,
expander_P0_6,
expander_P0_7,
expander_P1_0,
expander_P1_1,
expander_P1_2,
expander_P1_3,
expander_P1_4,
expander_P1_5,
expander_P1_6,
expander_P1_7,
)
# This example writes a 0.2s pulse on the pins consecutively to test the output
# Take the previously declared pin 1_5 and blink it
# To see the blinking, attatch a 300Ohm resistor and LED between that pin and GND
while (1):
for pin in pins:
pin.digitalWrite(1)
time.sleep(0.2)
pin.digitalWrite(0)
time.sleep(0.2)
expander_P1_5.digitalWrite(1)
time.sleep(0.5)
expander_P1_5.digitalWrite(0)
time.sleep(0.5)
# Infinite loop, this goes on forever

View File

@ -1,55 +1,76 @@
from inkplate6_COLOR import Inkplate
from image import *
# This example shows you how to use the touchpads
# Only older models of Inkplate6COLOR have them
# Include required libraries
from inkplate6COLOR import Inkplate
# Create Inkplate object
display = Inkplate()
# Create some coordinates and a radius for drawing a circle
circle_x = 300
circle_y = 200
circle_r = 40
# main function used by micropython
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# function to show text at the top of the screen
# need to be called every time we clear display
def topText():
display.setTextSize(2)
display.printText(
0, 10, "TOUCHPADS EXAMPLE! 1, 3 TO MOVE CIRCLE, 2 TO RESET")
# Clear the frame buffer
display.clearDisplay()
topText()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Function to show text at the top of the screen
# Needs to be called every time we clear the display to re-draw the text
def draw_top_text():
display.setTextSize(2)
display.printText(100, 10, "TOUCHPADS EXAMPLE! 1, 3 TO MOVE CIRCLE, 2 TO RESET")
# Call it
draw_top_text()
# Touchpads definitions
touch1, touch2, touch3 = display.TOUCH1, display.TOUCH2, display.TOUCH3
# draw initial circle for touchpad demonstration
# Draw the initial circle for touchpad demonstration
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
# Show everything on the display
display.display()
# Main loop that will run forever or until battery is dead
# Start infinite loop
while True:
# check if touchpad is pressed
# If a touchpad is pressed, move the circle and redraw everything
# Touch 1 moves the circle to the left
if touch1():
circle_x -= 40
display.clearDisplay()
topText()
draw_top_text()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
# Show on the display!
display.update()
# Touch 2 will reset the position of the circle
if touch2():
circle_x = 400
circle_y = 300
circle_r = 40
display.clearDisplay()
draw_top_text()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
# Show on the display!
display.display()
# Touch 3 will move the circle to the right
if touch3():
circle_x += 40
display.clearDisplay()
topText()
draw_top_text()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
display.display()
if touch2():
circle_x = 300
circle_y = 200
circle_r = 40
display.clearDisplay()
topText()
display.drawCircle(circle_x, circle_y, circle_r, display.BLACK)
display.display()
# Show on the display
display.update()

View File

@ -1,16 +1,33 @@
from inkplate6_PLUS import Inkplate
from image import *
# This example will show you how to draw basic black and white shapes
# Also, it will draw a bitmap of the Soldered logo in the middle
# Include all the required libraries
from inkplate6PLUS import Inkplate
from soldered_logo import *
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Let's draw some shapes!
# This example will draw shapes around the upper left corner, and then rotate the screen
# This creates a symmetrical-looking pattern of various shapes
for r in range(4):
# Sets the screen rotation
display.setRotation(r)
@ -26,14 +43,25 @@ if __name__ == "__main__":
display.fillRoundRect(10, 100, 100, 100, 10, display.BLACK)
display.drawTriangle(300, 100, 400, 150, 400, 100, display.BLACK)
# If it's rotation 0 or 2, also add this filled triangle
if display.rotation % 2 == 0:
display.fillTriangle(500, 101, 400, 150, 400, 100, display.BLACK)
display.display()
time.sleep(5)
# Draws image from bytearray
display.setRotation(0)
display.drawBitmap(120, 200, image, 576, 100)
#Use display.partialUpdate instead of display.display() to draw only updated pixels
display.partialUpdate()
# Show on the display!
# Use display.partialUpdate instead of display.display() to draw only updated pixels
# This makes for a faster update
# IMPORTANT: the display should be fully updated every ~10 partialUpdates with display.display()
# This ensures the image retains it's quality
display.partialUpdate()
# Wait 5 seconds
time.sleep(5)
# Reset the rotation
display.setRotation(0)
# We've drawn the pattern, now let's draw the Soldered logo right in the middle
display.drawBitmap(406, 357, soldered_logo, 211, 44)
# Show on the display
display.display()

View File

@ -1,33 +1,39 @@
# Include needed libraries
# This example will show you how to draw different shades of gray using grayscale mode
from inkplate6_PLUS import Inkplate
from image import *
# Include needed libraries
from inkplate6PLUS import Inkplate
from soldered_logo import *
import time
# Initialize inkplate display
# Create Inkplate object in 2-bit grayscale mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function, you can make infinite while loop inside this to run code indefinitely
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Draw palet of posible colors
#use color values 0, 1, 2, 3
display.writeFillRect(0, 0, 25, 600, 3)
display.writeFillRect(25, 0, 25, 600, 2)
display.writeFillRect(50, 0, 25, 600, 1)
display.writeFillRect(75, 0, 25, 600, 0)
# Draw pallet of posible shades
# 0 being the lightest (white), 3 being the darkest
display.writeFillRect(0, 0, 25, 758, 3)
display.writeFillRect(25, 0, 25, 758, 2)
display.writeFillRect(50, 0, 25, 758, 1)
display.writeFillRect(75, 0, 25, 758, 0)
# Show on the display
display.display()
# Wait 3 seconds
time.sleep(3)
# Draws image from bytearray
display.setRotation(0)
display.drawBitmap(120, 200, image, 576, 100)
display.display()
time.sleep(10)
# Let's draw the Soldered logo and show it on the display
display.drawBitmap(184, 357, soldered_logo, 211, 44)
display.display()

View File

@ -1,22 +1,44 @@
from inkplate6_PLUS import Inkplate
# This example will show you how to read the voltage of the battery
# and also the temperature from the TPS and print it on the screen
# Include needed libraries
from inkplate6PLUS import Inkplate
from image import *
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Get the battery reading as a string
battery = str(display.readBattery())
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
display.printText(100, 100, "batt: " + battery + "V")
# Print the text at coordinates 100,100 (from the upper left corner)
display.printText(100, 100, "Battery voltage: " + battery + "V")
# Show it on the display
display.display()
# Get the temperature reading, also as a string
temperature = str(display.readTemperature())
display.setTextSize(2)
display.printText(100, 150, "TEMP: " + temperature + "C")
# Print the text at coordinates 100, 150, and also add the measurement unit
display.printText(100, 150, "Temperature: " + temperature + "C")
# Show it on the display
display.display()

View File

@ -1,14 +1,19 @@
# This example will show you how to connect to WiFi
# get data from the internet and then print it
# Include needed libraries
import network
import time
from inkplate6_PLUS import Inkplate
from inkplate6PLUS import Inkplate
ssid = "e-radionica.com"
password = "croduino"
# Enter your WiFi credentials here
ssid = ""
password = ""
# Function which connects to WiFi
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_basics.html
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print("connecting to network...")
@ -18,11 +23,10 @@ def do_connect():
pass
print("network config:", sta_if.ifconfig())
# This function does a HTTP GET request
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
def http_get(url):
import socket
res = ""
_, _, host, path = url.split("/", 3)
addr = socket.getaddrinfo(host, 80)[0][-1]
@ -36,25 +40,32 @@ def http_get(url):
else:
break
s.close()
return res
# Main function
if __name__ == "__main__":
# Calling functions defined above
do_connect()
response = http_get("http://micropython.org/ks/test.html")
# First, connect
do_connect()
# Initialise our Inkplate object
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page/resource, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Print response in lines
cnt = 0
for x in response.split("\n"):
display.printText(
10, 10 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 10
# Create and initialize our Inkplate object in 1-bit mode
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
# Display image from buffer
display.display()
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
# Print response line by line
cnt = 0
for x in response.split("\n"):
display.printText(
10, 20 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 20
# Display image from buffer in full refresh
display.display()

View File

@ -1,21 +1,42 @@
# For this example, copy the files from the directory "Sd_card_example_files"
# to an empty microSD card's root folder and then insert it into Inkplate
# Include required libraries
import os, time
from inkplate6_PLUS import Inkplate
from inkplate6PLUS import Inkplate
# Create Inkplate object in 2-bit (grayscale) mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
display.begin()
# This prints all the files on card
print(os.listdir("/sd"))
# Main function
if __name__ == "__main__":
f = open("sd/text.txt", "r")
# Init Inkplate
display.begin()
# Print file contents
print(f.read())
f.close()
# SD Card must be initialised with this function
display.initSDCard()
time.sleep(5)
# This prints all the files on card
print(os.listdir("/sd"))
# Utterly slow, can take minutes :(
display.drawImageFile(0, 0, "sd/1.bmp")
# Open the file text.txt in read only mode and print it's contents
f = open("sd/text.txt", "r")
print(f.read()) # This should print 5 lines of "Lorem Ipsum"
f.close() # Close the file
display.display()
# Wait 5 seconds
time.sleep(5)
# Draw the image titled "1.bmp"
# Warning, this takes quite a while
# It's faster with smaller images or in 1-bit mode
display.drawImageFile(0, 0, "sd/1.bmp")
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# Show the image from the buffer
display.display()

View File

@ -1,16 +1,43 @@
from inkplate6_PLUS import Inkplate
# This example will show you how to adjust the frontlight
# Include required libraries
from inkplate6PLUS import Inkplate
import time
# Create Inkplate object in 1-bit (black and white) mode
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
#display.clearDisplay()
#display.display()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Enable the frontlight
display.frontlight(True)
for i in range(0, 60):
display.setFrontlight(10)
time.sleep(2)
display.frontlight(False)
# Frontlight strength can be set from values 0 to 64
# For example:
display.setFrontlight(34)
# Wait 3 seconds
time.sleep(3)
# Slowly gradually increase the frontlight and then decrease it, infinitely
while(True):
# First, increase the brightness gradually
for i in range(0, 60):
display.setFrontlight(i)
time.sleep(0.5) # Wait for 500ms
# Then, decrease
for i in range(60, 0):
display.setFrontlight(i)
time.sleep(0.5) # Wait for 500ms

View File

@ -1,22 +1,38 @@
from inkplate6_PLUS import Inkplate
from image import *
import time
# This example shows you how to use the touchscreen on Inkplate6PLUS!
# Include needed libraries
from inkplate6PLUS import Inkplate
# Create Inkplate object in 1-bit mode, black and white colors only
display = Inkplate(Inkplate.INKPLATE_1BIT)
#main function used by micropython
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Initialize the touchscreen
display.tsInit(1)
# Draw a rectangle right in the middle of the screen and show it
display.drawRect(450, 350, 100, 100, display.BLACK)
display.display()
# Every time the user touches that rectangle, print a message
# The messags get printed to the terminal where the script was ran from
# Create the variable which counts how many times the rectangle was touched
counter = 0
while True:
#touch the square
# If a touch on the square was detected
if(display.touchInArea(450, 350, 100, 100)):
# Increment the counter and print a message
counter += 1
print(counter)
print("Touch detected! Touch #: "+str(counter))

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 KiB

View File

@ -0,0 +1,9 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia odio vitae vestibulum. Donec in efficitur leo, nec vehicula elit.
Suspendisse potenti. Nullam quis risus eget urna mollis ornare vel eu leo. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.
Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Pellentesque in ipsum id orci porta dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.
Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vivamus suscipit tortor eget felis porttitor volutpat. Cras ultricies ligula sed magna dictum porta.
Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Sed porttitor lectus nibh, et malesuada fames ac turpis egestas.

View File

@ -0,0 +1,67 @@
# This example will show you how to draw shapes and text in black, white and red
# Also, it will draw a bitmap of the Soldered logo in the middle
# Include all the required libraries
from inkplate7 import Inkplate
from soldered_logo import *
import time
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Let's draw some shapes!
# This example will draw shapes around the upper left corner, and then rotate the screen
# This creates a symmetrical-looking pattern of various shapes
for r in range(4):
# Sets the screen rotation
display.setRotation(r)
# All drawing functions
# Draw some of the elements in red so we can see the color
display.drawPixel(100, 100, display.BLACK)
display.drawRect(50, 50, 75, 75, display.RED)
display.drawCircle(200, 200, 30, display.RED)
display.fillCircle(300, 300, 30, display.BLACK)
display.drawFastHLine(20, 100, 50, display.BLACK)
display.drawFastVLine(100, 20, 50, display.BLACK)
display.drawLine(100, 100, 400, 400, display.BLACK)
display.drawRoundRect(100, 10, 100, 100, 10, display.BLACK)
display.fillRoundRect(10, 100, 100, 100, 10, display.BLACK)
display.drawTriangle(300, 100, 400, 150, 400, 100, display.BLACK)
# If it's rotation 0 or 2, also add this filled triangle
if display.rotation % 2 == 0:
display.fillTriangle(500, 101, 400, 150, 400, 100, display.RED)
# Show on the display!
# This function must be called in order for the display to update
display.display()
# Wait 5 seconds
time.sleep(5)
# Reset the rotation
display.setRotation(0)
# Let's draw the Soldered logo right in the middle
# First, fill the background of the image white
display.fillRect(214, 170, 211, 44, display.WHITE)
# Now, draw the logo
display.drawBitmap(214, 170, soldered_logo, 211, 44, display.RED)
# Show on the display
display.display()

View File

@ -0,0 +1,34 @@
# This example will show you how to read the voltage of the battery
# and also print it on the screen
# Include needed libraries
from inkplate7 import Inkplate
import time
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Get the battery reading as a string
battery = str(display.readBattery())
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
# Print the text at coordinates 100,100 (from the upper left corner)
display.printText(100, 100, "Battery voltage: " + battery + "V")
# Show it on the display
display.display()

View File

@ -0,0 +1,30 @@
# This example will show you how to draw a color image (black, white, red)
# The pixel format is four pixels per byte, each pixel two bits
# 00 is Black
# 01 is White
# 10 is Red
# For simple conversion use the Soldered Image Converter
# Include needed libraries
from inkplate7 import Inkplate
# Import the image
# It should also be copied to Inkplate when copying other libraries
# Check the README!
from color_image_inkplate7 import color_image_inkplate7
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# color_image_inkplate2 is 212x104px, draw it over the whole screen
# Arguments are x start, y start, width, height, and then the image buffer
display.drawColorImage(0, 0, 212, 104, color_image_inkplate7)
# Show it on the display
display.display()

View File

@ -0,0 +1,71 @@
# This example will show you how to connect to WiFi
# get data from the internet and then print it
# Include needed libraries
import network
import time
from inkplate7 import Inkplate
# Enter your WiFi credentials here
ssid = ""
password = ""
# Function which connects to WiFi
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_basics.html
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print("connecting to network...")
sta_if.active(True)
sta_if.connect(ssid, password)
while not sta_if.isconnected():
pass
print("network config:", sta_if.ifconfig())
# This function does a HTTP GET request
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
def http_get(url):
import socket
res = ""
_, _, host, path = url.split("/", 3)
addr = socket.getaddrinfo(host, 80)[0][-1]
s = socket.socket()
s.connect(addr)
s.send(bytes("GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n" % (path, host), "utf8"))
while True:
data = s.recv(100)
if data:
res += str(data, "utf8")
else:
break
s.close()
return res
# Main function
if __name__ == "__main__":
# First, connect
do_connect()
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page/resource, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Create and initialize our Inkplate object
display = Inkplate()
display.begin()
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
# Print response line by line
cnt = 0
for x in response.split("\n"):
display.printText(
10, 20 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 20
# Display image from buffer
display.display()

View File

@ -0,0 +1,42 @@
# For this example, copy the files from the directory "Sd_card_example_files"
# to an empty microSD card's root folder and then insert it into Inkplate
# Include required libraries
import os, time
from inkplate7 import Inkplate
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# SD Card must be initialised with this function
display.initSDCard()
# This prints all the files on card
print(os.listdir("/sd"))
# Open the file text.txt in read only mode and print it's contents
f = open("sd/text.txt", "r")
print(f.read()) # This should print 5 lines of "Lorem Ipsum"
f.close() # Close the file
# Wait 5 seconds
time.sleep(5)
# Draw the image titled "1.bmp"
# Warning, this takes quite a while
# It's faster with smaller images
display.drawImageFile(0, 0, "sd/1.bmp")
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# Show the image from the buffer
display.display()

View File

@ -0,0 +1,49 @@
# This example shows you how to use the GPIO expander's pins
# See below which pins are available
# Include needed libraries
import time
from PCAL6416A import *
from soldered_inkplate7 import Inkplate
# Create Inkplate object
display = Inkplate()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# pin = display.gpioExpanderPin(gpioExpander,pin,mode)
# Supported modes: modeINPUT, modeINPUT_PULLUP, modeINPUT_PULLDOWN, modeOUTPUT
# Supported pins on Soldered Inkplate 7 are listed below
# Declare all the available pins as output:
expander_P0_0 = display.gpioExpanderPin(0, modeOUTPUT)
expander_P0_1 = display.gpioExpanderPin(1, modeOUTPUT)
expander_P0_2 = display.gpioExpanderPin(2, modeOUTPUT)
expander_P0_3 = display.gpioExpanderPin(3, modeOUTPUT)
expander_P0_4 = display.gpioExpanderPin(4, modeOUTPUT)
expander_P0_5 = display.gpioExpanderPin(5, modeOUTPUT)
expander_P0_6 = display.gpioExpanderPin(6, modeOUTPUT)
expander_P0_7 = display.gpioExpanderPin(7, modeOUTPUT)
expander_P1_0 = display.gpioExpanderPin(8, modeOUTPUT)
expander_P1_1 = display.gpioExpanderPin(9, modeOUTPUT)
expander_P1_2 = display.gpioExpanderPin(10, modeOUTPUT)
expander_P1_3 = display.gpioExpanderPin(11, modeOUTPUT)
expander_P1_4 = display.gpioExpanderPin(12, modeOUTPUT)
expander_P1_5 = display.gpioExpanderPin(13, modeOUTPUT)
expander_P1_6 = display.gpioExpanderPin(14, modeOUTPUT)
expander_P1_7 = display.gpioExpanderPin(15, modeOUTPUT)
# Take the previously declared pin 1_5 and blink it
# To see the blinking, attatch a 300Ohm resistor and LED between that pin and GND
while (1):
expander_P1_5.digitalWrite(1)
time.sleep(0.5)
expander_P1_5.digitalWrite(0)
time.sleep(0.5)
# Infinite loop, this goes on forever

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

View File

@ -0,0 +1,9 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia odio vitae vestibulum. Donec in efficitur leo, nec vehicula elit.
Suspendisse potenti. Nullam quis risus eget urna mollis ornare vel eu leo. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.
Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Pellentesque in ipsum id orci porta dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.
Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vivamus suscipit tortor eget felis porttitor volutpat. Cras ultricies ligula sed magna dictum porta.
Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Sed porttitor lectus nibh, et malesuada fames ac turpis egestas.

View File

@ -1,16 +1,33 @@
# This example will show you how to draw basic black and white shapes
# Also, it will draw a bitmap of the Soldered logo in the middle
# Include all the required libraries
from soldered_inkplate10 import Inkplate
from soldered_logo import *
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Let's draw some shapes!
# This example will draw shapes around the upper left corner, and then rotate the screen
# This creates a symmetrical-looking pattern of various shapes
for r in range(4):
# Sets the screen rotation
display.setRotation(r)
@ -26,15 +43,25 @@ if __name__ == "__main__":
display.fillRoundRect(10, 100, 100, 100, 10, display.BLACK)
display.drawTriangle(300, 100, 400, 150, 400, 100, display.BLACK)
# If it's rotation 0 or 2, also add this filled triangle
if display.rotation % 2 == 0:
display.fillTriangle(500, 101, 400, 150, 400, 100, display.BLACK)
display.display()
# Show on the display!
# Use display.partialUpdate instead of display.display() to draw only updated pixels
# This makes for a faster update
# IMPORTANT: the display should be fully updated every ~10 partialUpdates with display.display()
# This ensures the image retains it's quality
display.partialUpdate()
# Wait 5 seconds
time.sleep(5)
# Draws image from bytearray
# Reset the rotation
display.setRotation(0)
# We've drawn the pattern, now let's draw the Soldered logo right in the middle
display.drawBitmap(494, 391, soldered_logo, 211, 44)
# Use display.partialUpdate instead of display.display() to draw only updated pixels
display.partialUpdate()
# Show on the display, this time with a full update
display.display()

View File

@ -1,30 +1,39 @@
# This example will show you how to draw different shades of gray using grayscale mode
# Include needed libraries
from soldered_inkplate10 import Inkplate
from soldered_logo import *
import time
# Initialize inkplate display
# Create Inkplate object in 2-bit grayscale mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function, you can make infinite while loop inside this to run code indefinitely
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Draw palet of posible colors
#use color values 0, 1, 2, 3
# Draw pallet of posible shades
# 0 being the lightest (white), 3 being the darkest
display.writeFillRect(0, 0, 25, 825, 3)
display.writeFillRect(25, 0, 25, 825, 2)
display.writeFillRect(50, 0, 25, 825, 1)
display.writeFillRect(75, 0, 25, 825, 0)
# Show on the display
display.display()
# Wait 3 seconds
time.sleep(3)
# Draws image from bytearray
display.setRotation(0)
# Let's draw the Soldered logo and show it on the display
display.drawBitmap(248, 391, soldered_logo, 211, 44)
display.display()
time.sleep(10)
display.display()

View File

@ -1,21 +1,46 @@
from soldered_inkplate10 import Inkplate
# This example will show you how to read the voltage of the battery
# and also the temperature from the TPS and print it on the screen
# Include needed libraries
from soldered_inkplate10 import Inkplate
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Get the battery reading as a string
battery = str(display.readBattery())
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
display.printText(100, 100, "batt: " + battery + "V")
# Print the text at coordinates 100,100 (from the upper left corner)
display.printText(100, 100, "Battery voltage: " + battery + "V")
# Show it on the display
display.display()
# Wait 5 seconds
time.sleep(5)
# Get the temperature reading, also as a string
temperature = str(display.readTemperature())
display.setTextSize(2)
display.printText(100, 150, "TEMP: " + temperature + "C")
# Print the text at coordinates 100, 150, and also add the measurement unit
display.printText(100, 150, "Temperature: " + temperature + "C")
# Show it on the display
display.display()

View File

@ -0,0 +1,44 @@
# This example shows how to draw a grayscale image from the SD card
# Copy the image from Sd_card_example_files and place it on the microSD card
# NOTE: This takes quite a while as MicroPython can be a bit slow
# Include needed libraries
from soldered_inkplate10 import Inkplate
import os, time
# Init display in 2bit mode, important
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# SD Card must be initialised with this function
display.initSDCard()
# Wait one second so we're totally sure it's initialized
time.sleep(1)
# Wake the SD (power ON)
display.SDCardWake()
# Draw image in grayscale and display it
# Also print a message before and after
print("Starting to draw image from file!")
display.drawImageFile(0, 0, "sd/1.bmp", False)
display.display()
print("Finished drawing image from file!")
# Put the SD card back to sleep to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()

View File

@ -1,15 +1,19 @@
# This example will show you how to connect to WiFi
# get data from the internet and then print it
# Include needed libraries
import network
import time
from soldered_inkplate10 import Inkplate
ssid = "Soldered"
password = "dasduino"
# Enter your WiFi credentials here
ssid = ""
password = ""
# Function which connects to WiFi
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_basics.html
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print("connecting to network...")
@ -19,11 +23,10 @@ def do_connect():
pass
print("network config:", sta_if.ifconfig())
# Does a HTTP GET request
# This function does a HTTP GET request
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
def http_get(url):
import socket
res = ""
_, _, host, path = url.split("/", 3)
addr = socket.getaddrinfo(host, 80)[0][-1]
@ -37,30 +40,32 @@ def http_get(url):
else:
break
s.close()
return res
# Main function
if __name__ == "__main__":
# Calling functions defined above
do_connect()
# First, connect
do_connect()
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page/resource, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Initialise our Inkplate object
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
# Create and initialize our Inkplate object in 1-bit mode
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
display.setTextSize(3)
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
# Print response in lines
cnt = 0
for x in response.split("\n"):
display.printText(
10, 28 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 28
# Print response line by line
cnt = 0
for x in response.split("\n"):
display.printText(
10, 20 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 20
# Display image from buffer
display.display()
# Display image from buffer in full refresh
display.display()

View File

@ -1,29 +1,42 @@
# For this example, copy the files from the directory "Sd_card_example_files"
# to an empty microSD card's root folder and then insert it into Inkplate
# Include required libraries
import os, time
from soldered_inkplate10 import Inkplate
# Create Inkplate object in 2-bit (grayscale) mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
display.begin()
# SD Card must be initialised with this function
display.initSDCard()
# Main function
if __name__ == "__main__":
# This prints all the files on card
print(os.listdir("/sd"))
# Init Inkplate
display.begin()
f = open("sd/text.txt", "r")
# SD Card must be initialised with this function
display.initSDCard()
# Print file contents
print(f.read())
f.close()
# This prints all the files on card
print(os.listdir("/sd"))
time.sleep(5)
# Open the file text.txt in read only mode and print it's contents
f = open("sd/text.txt", "r")
print(f.read()) # This should print 5 lines of "Lorem Ipsum"
f.close() # Close the file
# Draw the image titled "1.bmp"
display.drawImageFile(0, 0, "sd/1.bmp")
# Wait 5 seconds
time.sleep(5)
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# Draw the image titled "1.bmp"
# Warning, this takes quite a while
# It's faster with smaller images or in 1-bit mode
display.drawImageFile(0, 0, "sd/1.bmp")
display.display()
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# Show the image from the buffer
display.display()

View File

@ -1,21 +1,30 @@
# This example shows you how to use the GPIO expander's pins
# Soldered Inkplate10 has an internal and external GPIO expander
# See below which pins are available
# Include needed libraries
import time
from PCAL6416A import *
from soldered_inkplate10 import Inkplate
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# This script demonstrates using all the available GPIO expander pins as output
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# pin = display.gpioExpanderPin(gpioExpander,pin,mode)
# Supported gpio expanders on Soldered Inkplate 10: 1, 2
# Supported gpio expanders on Soldered Inkplate 10: 1, 2 (internal, external)
# Supported modes: modeINPUT, modeINPUT_PULLUP, modeINPUT_PULLDOWN, modeOUTPUT
# Supported pins on Soldered Inkplate 10 are listed below
# Declare all the available pins as output:
expander1_P1_1 = display.gpioExpanderPin(1, 9, modeOUTPUT)
expander1_P1_2 = display.gpioExpanderPin(1, 10, modeOUTPUT)
expander1_P1_3 = display.gpioExpanderPin(1, 11, modeOUTPUT)
expander1_P1_4 = display.gpioExpanderPin(1, 12, modeOUTPUT)
expander1_P1_5 = display.gpioExpanderPin(1, 13, modeOUTPUT)
@ -40,34 +49,11 @@ if __name__ == "__main__":
expander2_P1_6 = display.gpioExpanderPin(2, 14, modeOUTPUT)
expander2_P1_7 = display.gpioExpanderPin(2, 15, modeOUTPUT)
pins = (expander1_P1_3,
expander1_P1_4,
expander1_P1_5,
expander1_P1_6,
expander1_P1_7,
expander2_P0_0,
expander2_P0_1,
expander2_P0_2,
expander2_P0_3,
expander2_P0_4,
expander2_P0_5,
expander2_P0_6,
expander2_P0_7,
expander2_P1_0,
expander2_P1_1,
expander2_P1_2,
expander2_P1_3,
expander2_P1_4,
expander2_P1_5,
expander2_P1_6,
expander2_P1_7,
)
# This example writes a 0.2s pulse on the pins consecutively to test the output
# Take the previously declared pin 1_5 on expander 2 and blink it
# To see the blinking, attatch a 300Ohm resistor and LED between that pin and GND
while (1):
for pin in pins:
pin.digitalWrite(1)
time.sleep(0.2)
pin.digitalWrite(0)
time.sleep(0.2)
expander2_P1_5.digitalWrite(1)
time.sleep(0.5)
expander2_P1_5.digitalWrite(0)
time.sleep(0.5)
# Infinite loop, this goes on forever

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -0,0 +1,9 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia odio vitae vestibulum. Donec in efficitur leo, nec vehicula elit.
Suspendisse potenti. Nullam quis risus eget urna mollis ornare vel eu leo. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.
Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Pellentesque in ipsum id orci porta dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.
Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vivamus suscipit tortor eget felis porttitor volutpat. Cras ultricies ligula sed magna dictum porta.
Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Sed porttitor lectus nibh, et malesuada fames ac turpis egestas.

View File

@ -1,20 +1,37 @@
# This example will show you how to draw basic black and white shapes
# Also, it will draw a bitmap of the Soldered logo in the middle
# Include all the required libraries
from soldered_inkplate6 import Inkplate
from soldered_logo import *
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Let's draw some shapes!
# This example will draw shapes around the upper left corner, and then rotate the screen
# This creates a symmetrical-looking pattern of various shapes
for r in range(4):
# Sets the screen rotation
display.setRotation(r)
# All drawing functions
# All the drawing functions
display.drawPixel(100, 100, display.BLACK)
display.drawRect(50, 50, 75, 75, display.BLACK)
display.drawCircle(200, 200, 30, display.BLACK)
@ -26,15 +43,25 @@ if __name__ == "__main__":
display.fillRoundRect(10, 100, 100, 100, 10, display.BLACK)
display.drawTriangle(300, 100, 400, 150, 400, 100, display.BLACK)
# If it's rotation 0 or 2, also add this filled triangle
if display.rotation % 2 == 0:
display.fillTriangle(500, 101, 400, 150, 400, 100, display.BLACK)
display.display()
# Show on the display!
# Use display.partialUpdate instead of display.display() to draw only updated pixels
# This makes for a faster update
# IMPORTANT: the display should be fully updated every ~10 partialUpdates with display.display()
# This ensures the image retains it's quality
display.partialUpdate()
# Wait 5 seconds
time.sleep(5)
# Draws image from bytearray
# Reset the rotation
display.setRotation(0)
# We've drawn the pattern, now let's draw the Soldered logo right in the middle
display.drawBitmap(294, 20, soldered_logo, 211, 44)
# Use display.partialUpdate instead of display.display() to draw only updated pixels
display.partialUpdate()
# Show on the display
display.display()

View File

@ -1,33 +1,39 @@
# Include needed libraries
# This example will show you how to draw different shades of gray using grayscale mode
# Include needed libraries
from soldered_inkplate6 import Inkplate
from soldered_logo import *
import time
# Initialize inkplate display
# Create Inkplate object in 2-bit grayscale mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function, you can make infinite while loop inside this to run code indefinitely
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Draw palet of posible colors
#use color values 0, 1, 2, 3
# Draw pallet of posible shades
# 0 being the lightest (white), 3 being the darkest
display.writeFillRect(0, 0, 25, 600, 3)
display.writeFillRect(25, 0, 25, 600, 2)
display.writeFillRect(50, 0, 25, 600, 1)
display.writeFillRect(75, 0, 25, 600, 0)
# Show on the display
display.display()
# Wait 3 seconds
time.sleep(3)
# Draws image from bytearray
display.setRotation(0)
# Let's draw the Soldered logo and show it on the display
display.drawBitmap(294, 278, soldered_logo, 211, 44)
display.display()
time.sleep(10)
display.display()

View File

@ -1,22 +1,47 @@
from soldered_inkplate6 import Inkplate
from image import *
# This example will show you how to read the voltage of the battery
# and also the temperature from the TPS and print it on the screen
# Include needed libraries
from soldered_inkplate6 import Inkplate
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Get the battery reading as a string
battery = str(display.readBattery())
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
display.printText(100, 100, "batt: " + battery + "V")
# Print the text at coordinates 100,100 (from the upper left corner)
display.printText(100, 100, "Battery voltage: " + battery + "V")
# Show it on the display
display.display()
# Wait 5 seconds
time.sleep(5)
# Get the temperature reading, also as a string
temperature = str(display.readTemperature())
display.setTextSize(2)
display.printText(100, 150, "TEMP: " + temperature + "C")
# Print the text at coordinates 100, 150, and also add the measurement unit
display.printText(100, 150, "Temperature: " + temperature + "C")
# Show it on the display
display.display()

View File

@ -0,0 +1,44 @@
# This example shows how to draw a grayscale image from the SD card
# Copy the image from Sd_card_example_files and place it on the microSD card
# NOTE: This takes quite a while as MicroPython can be a bit slow
# Include needed libraries
from soldered_inkplate6 import Inkplate
import os, time
# Init display in 2bit mode, important
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# SD Card must be initialised with this function
display.initSDCard()
# Wait one second so we're totally sure it's initialized
time.sleep(1)
# Wake the SD (power ON)
display.SDCardWake()
# Draw image in grayscale and display it
# Also print a message before and after
print("Starting to draw image from file!")
display.drawImageFile(0, 0, "sd/1.bmp", False)
display.display()
print("Finished drawing image from file!")
# Put the SD card back to sleep to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()

View File

@ -1,7 +1,12 @@
# This example will show you how to connect to WiFi
# get data from the internet and then print it
# Include needed libraries
import network
import time
from soldered_inkplate6 import Inkplate
# Enter your WiFi credentials here
ssid = ""
password = ""
@ -9,7 +14,6 @@ password = ""
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_basics.html
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print("connecting to network...")
@ -19,11 +23,10 @@ def do_connect():
pass
print("network config:", sta_if.ifconfig())
# Does a HTTP GET request
# This function does a HTTP GET request
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
def http_get(url):
import socket
res = ""
_, _, host, path = url.split("/", 3)
addr = socket.getaddrinfo(host, 80)[0][-1]
@ -37,30 +40,32 @@ def http_get(url):
else:
break
s.close()
return res
# Main function
if __name__ == "__main__":
# Calling functions defined above
do_connect()
# First, connect
do_connect()
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page/resource, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Initialise our Inkplate object
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
# Create and initialize our Inkplate object in 1-bit mode
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
display.setTextSize(2)
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
# Print response in lines
cnt = 0
for x in response.split("\n"):
display.printText(
10, 20 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 20
# Print response line by line
cnt = 0
for x in response.split("\n"):
display.printText(
10, 20 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 20
# Display image from buffer
display.display()
# Display image from buffer in full refresh
display.display()

View File

@ -1,29 +1,42 @@
# For this example, copy the files from the directory "Sd_card_example_files"
# to an empty microSD card's root folder and then insert it into Inkplate
# Include required libraries
import os, time
from soldered_inkplate6 import Inkplate
# Create Inkplate object in 2-bit (grayscale) mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
display.begin()
# SD Card must be initialised with this function
display.initSDCard()
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# This prints all the files on card
print(os.listdir("/sd"))
# SD Card must be initialised with this function
display.initSDCard()
f = open("sd/text.txt", "r")
# This prints all the files on card
print(os.listdir("/sd"))
# Print file contents
print(f.read())
f.close()
# Open the file text.txt in read only mode and print it's contents
f = open("sd/text.txt", "r")
print(f.read()) # This should print 5 lines of "Lorem Ipsum"
f.close() # Close the file
time.sleep(5)
# Wait 5 seconds
time.sleep(5)
# Draw the image titled "1.bmp"
display.drawImageFile(0, 0, "sd/1.bmp")
# Draw the image titled "1.bmp"
# Warning, this takes quite a while
# It's faster with smaller images or in 1-bit mode
display.drawImageFile(0, 0, "sd/1.bmp")
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
display.display()
# Show the image from the buffer
display.display()

View File

@ -1,21 +1,29 @@
# This example shows you how to use the GPIO expander's pins
# Soldered Inkplate6 has an internal and external GPIO expander
# See below which pins are available
# Include needed libraries
import time
from PCAL6416A import *
from soldered_inkplate6 import Inkplate
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# This script demonstrates using all the available GPIO expander pins as output
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# pin = display.gpioExpanderPin(gpioExpander,pin,mode)
# Supported gpio expanders on Soldered Inkplate 6: 1, 2
# Supported gpio expanders on Soldered Inkplate 6: 1, 2 (internal, external)
# Supported modes: modeINPUT, modeINPUT_PULLUP, modeINPUT_PULLDOWN, modeOUTPUT
# Supported pins on Soldered Inkplate 6 are listed below
# Declare all the available pins as output:
expander1_P1_1 = display.gpioExpanderPin(1, 9, modeOUTPUT)
expander1_P1_2 = display.gpioExpanderPin(1, 10, modeOUTPUT)
expander1_P1_3 = display.gpioExpanderPin(1, 11, modeOUTPUT)
@ -42,35 +50,11 @@ if __name__ == "__main__":
expander2_P1_6 = display.gpioExpanderPin(2, 14, modeOUTPUT)
expander2_P1_7 = display.gpioExpanderPin(2, 15, modeOUTPUT)
pins = (expander1_P1_1,
expander1_P1_2,
expander1_P1_3,
expander1_P1_5,
expander1_P1_6,
expander1_P1_7,
expander2_P0_0,
expander2_P0_1,
expander2_P0_2,
expander2_P0_3,
expander2_P0_4,
expander2_P0_5,
expander2_P0_6,
expander2_P0_7,
expander2_P1_0,
expander2_P1_1,
expander2_P1_2,
expander2_P1_3,
expander2_P1_4,
expander2_P1_5,
expander2_P1_6,
expander2_P1_7,
)
# This example writes a 0.2s pulse on the pins consecutively to test the output
# Take the previously declared pin 1_5 on expander 2 and blink it
# To see the blinking, attatch a 300Ohm resistor and LED between that pin and GND
while (1):
for pin in pins:
pin.digitalWrite(1)
time.sleep(0.2)
pin.digitalWrite(0)
time.sleep(0.2)
expander2_P1_5.digitalWrite(1)
time.sleep(0.5)
expander2_P1_5.digitalWrite(0)
time.sleep(0.5)
# Infinite loop, this goes on forever

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

View File

@ -0,0 +1,9 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia odio vitae vestibulum. Donec in efficitur leo, nec vehicula elit.
Suspendisse potenti. Nullam quis risus eget urna mollis ornare vel eu leo. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.
Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Pellentesque in ipsum id orci porta dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.
Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Vivamus suscipit tortor eget felis porttitor volutpat. Cras ultricies ligula sed magna dictum porta.
Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Sed porttitor lectus nibh, et malesuada fames ac turpis egestas.

View File

@ -1,16 +1,33 @@
from soldered_inkplate6_PLUS import Inkplate
# This example will show you how to draw basic black and white shapes
# Also, it will draw a bitmap of the Soldered logo in the middle
# Include all the required libraries
from soldered_inkplate6PLUS import Inkplate
from soldered_logo import *
import time
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Let's draw some shapes!
# This example will draw shapes around the upper left corner, and then rotate the screen
# This creates a symmetrical-looking pattern of various shapes
for r in range(4):
# Sets the screen rotation
display.setRotation(r)
@ -26,15 +43,25 @@ if __name__ == "__main__":
display.fillRoundRect(10, 100, 100, 100, 10, display.BLACK)
display.drawTriangle(300, 100, 400, 150, 400, 100, display.BLACK)
# If it's rotation 0 or 2, also add this filled triangle
if display.rotation % 2 == 0:
display.fillTriangle(500, 101, 400, 150, 400, 100, display.BLACK)
display.display()
# Show on the display!
# Use display.partialUpdate instead of display.display() to draw only updated pixels
# This makes for a faster update
# IMPORTANT: the display should be fully updated every ~10 partialUpdates with display.display()
# This ensures the image retains it's quality
display.partialUpdate()
# Wait 5 seconds
time.sleep(5)
# Draws image from bytearray
# Reset the rotation
display.setRotation(0)
# We've drawn the pattern, now let's draw the Soldered logo right in the middle
display.drawBitmap(406, 357, soldered_logo, 211, 44)
#Use display.partialUpdate instead of display.display() to draw only updated pixels
display.partialUpdate()
# Show on the display
display.display()

View File

@ -1,32 +1,39 @@
from soldered_inkplate6_PLUS import Inkplate
# This example will show you how to draw different shades of gray using grayscale mode
# Include needed libraries
from soldered_inkplate6PLUS import Inkplate
from soldered_logo import *
import time
# Initialize inkplate display
# Create Inkplate object in 2-bit grayscale mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function, you can make infinite while loop inside this to run code indefinitely
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Draw pallet of posible colors
#use color values 0, 1, 2, 3
# Draw pallet of posible shades
# 0 being the lightest (white), 3 being the darkest
display.writeFillRect(0, 0, 25, 758, 3)
display.writeFillRect(25, 0, 25, 758, 2)
display.writeFillRect(50, 0, 25, 758, 1)
display.writeFillRect(75, 0, 25, 758, 0)
# Show on the display
display.display()
# Wait 3 seconds
time.sleep(3)
# Draws image from bytearray
display.setRotation(0)
# Let's draw the Soldered logo and show it on the display
display.drawBitmap(184, 357, soldered_logo, 211, 44)
display.display()
time.sleep(10)
display.display()

View File

@ -1,22 +1,44 @@
from soldered_inkplate6_PLUS import Inkplate
# This example will show you how to read the voltage of the battery
# and also the temperature from the TPS and print it on the screen
# Include needed libraries
from soldered_inkplate6PLUS import Inkplate
from image import *
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Get the battery reading as a string
battery = str(display.readBattery())
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
display.printText(100, 100, "batt: " + battery + "V")
# Print the text at coordinates 100,100 (from the upper left corner)
display.printText(100, 100, "Battery voltage: " + battery + "V")
# Show it on the display
display.display()
# Get the temperature reading, also as a string
temperature = str(display.readTemperature())
display.setTextSize(2)
display.printText(100, 150, "TEMP: " + temperature + "C")
# Print the text at coordinates 100, 150, and also add the measurement unit
display.printText(100, 150, "Temperature: " + temperature + "C")
# Show it on the display
display.display()

View File

@ -0,0 +1,44 @@
# This example shows how to draw a grayscale image from the SD card
# Copy the image from Sd_card_example_files and place it on the microSD card
# NOTE: This takes quite a while as MicroPython can be a bit slow
# Include needed libraries
from soldered_inkplate6PLUS import Inkplate
import os, time
# Init display in 2bit mode, important
display = Inkplate(Inkplate.INKPLATE_2BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# SD Card must be initialised with this function
display.initSDCard()
# Wait one second so we're totally sure it's initialized
time.sleep(1)
# Wake the SD (power ON)
display.SDCardWake()
# Draw image in grayscale and display it
# Also print a message before and after
print("Starting to draw image from file!")
display.drawImageFile(0, 0, "sd/1.bmp", False)
display.display()
print("Finished drawing image from file!")
# Put the SD card back to sleep to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()

View File

@ -1,7 +1,12 @@
# This example will show you how to connect to WiFi
# get data from the internet and then print it
# Include needed libraries
import network
import time
from soldered_inkplate6_PLUS import Inkplate
from soldered_inkplate6PLUS import Inkplate
# Enter your WiFi credentials here
ssid = ""
password = ""
@ -9,7 +14,6 @@ password = ""
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_basics.html
def do_connect():
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print("connecting to network...")
@ -19,12 +23,10 @@ def do_connect():
pass
print("network config:", sta_if.ifconfig())
# Does a HTTP GET request
# This function does a HTTP GET request
# More info here: https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
def http_get(url):
import socket
res = ""
_, _, host, path = url.split("/", 3)
addr = socket.getaddrinfo(host, 80)[0][-1]
@ -38,30 +40,32 @@ def http_get(url):
else:
break
s.close()
return res
# Main function
if __name__ == "__main__":
# Calling functions defined above
do_connect()
# First, connect
do_connect()
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Do a GET request to the micropython test page
# If you were to do a GET request to a different page/resource, change the URL here
response = http_get("http://micropython.org/ks/test.html")
# Initialise our Inkplate object
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
# Create and initialize our Inkplate object in 1-bit mode
display = Inkplate(Inkplate.INKPLATE_1BIT)
display.begin()
display.setTextSize(2)
# Set text size to double from the original size, so we can see the text better
display.setTextSize(2)
# Print response in lines
cnt = 0
for x in response.split("\n"):
display.printText(
10, 20 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 20
# Print response line by line
cnt = 0
for x in response.split("\n"):
display.printText(
10, 20 + cnt, x.upper()
) # Default font has only upper case letters
cnt += 20
# Display image from buffer
display.display()
# Display image from buffer in full refresh
display.display()

View File

@ -1,29 +1,42 @@
# For this example, copy the files from the directory "Sd_card_example_files"
# to an empty microSD card's root folder and then insert it into Inkplate
# Include required libraries
import os, time
from soldered_inkplate6_PLUS import Inkplate
from soldered_inkplate6PLUS import Inkplate
# Create Inkplate object in 2-bit (grayscale) mode
display = Inkplate(Inkplate.INKPLATE_2BIT)
display.begin()
# SD Card must be initialised with this function
display.initSDCard()
# Main function
if __name__ == "__main__":
# This prints all the files on card
print(os.listdir("/sd"))
# Init Inkplate
display.begin()
f = open("sd/text.txt", "r")
# SD Card must be initialised with this function
display.initSDCard()
# Print file contents
print(f.read())
f.close()
# This prints all the files on card
print(os.listdir("/sd"))
time.sleep(5)
# Open the file text.txt in read only mode and print it's contents
f = open("sd/text.txt", "r")
print(f.read()) # This should print 5 lines of "Lorem Ipsum"
f.close() # Close the file
# Draw the image titled "1.bmp"
display.drawImageFile(0, 0, "sd/1.bmp")
# Wait 5 seconds
time.sleep(5)
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# Draw the image titled "1.bmp"
# Warning, this takes quite a while
# It's faster with smaller images or in 1-bit mode
display.drawImageFile(0, 0, "sd/1.bmp")
display.display()
# You can turn off the power to the SD card to save power
display.SDCardSleep()
# To turn it back on, use:
# display.SDCardWake()
# Show the image from the buffer
display.display()

View File

@ -0,0 +1,38 @@
# This example will show you how to adjust the frontlight
# Include required libraries
from soldered_inkplate6PLUS import Inkplate
import time
# Create Inkplate object in 1-bit (black and white) mode
display = Inkplate(Inkplate.INKPLATE_1BIT)
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Enable the frontlight
display.frontlight(True)
# Frontlight strength can be set from values 0 to 64
# For example:
display.setFrontlight(10)
# Wait 3 seconds
time.sleep(3)
# Slowly gradually increase the frontlight, infinitely
while(True):
# First, increase the brightness gradually
for i in range(0, 60):
display.setFrontlight(i)
time.sleep(0.2) # Wait for 200ms

View File

@ -1,25 +1,33 @@
# This example shows you how to use the GPIO expander's pins
# Soldered Inkplate6PLUS has an internal and external GPIO expander
# See below which pins are available
# Include needed libraries
import time
from PCAL6416A import *
from soldered_inkplate6 import Inkplate
from soldered_inkplate6_PLUS import Inkplate
# Create Inkplate object in 1-bit mode, black and white colors only
# For 2-bit grayscale, see basicGrayscale.py
display = Inkplate(Inkplate.INKPLATE_1BIT)
# This script demonstrates using all the available GPIO expander pins as output
# Main function
if __name__ == "__main__":
# Must be called before using, line in Arduino
# Initialize the display, needs to be called only once
display.begin()
# pin = display.gpioExpanderPin(gpioExpander,pin,mode)
# Supported gpio expanders on Soldered Inkplate 6 PLUS: 1, 2
# Supported gpio expanders on Soldered Inkplate 6PLUS: 1, 2 (internal, external)
# Supported modes: modeINPUT, modeINPUT_PULLUP, modeINPUT_PULLDOWN, modeOUTPUT
# Supported pins are listed below
# Supported pins on Soldered Inkplate 6PLUS are listed below
expander1_P1_1 = display.gpioExpanderPin(1, 9, modeOUTPUT)
expander1_P1_5 = display.gpioExpanderPin(1, 13, modeOUTPUT)
expander1_P1_6 = display.gpioExpanderPin(1, 14, modeOUTPUT)
expander1_P1_7 = display.gpioExpanderPin(1, 15, modeOUTPUT)
# Declare all the available pins as output:
expander2_P0_1 = display.gpioExpanderPin(1, 1, modeOUTPUT)
expander2_P0_5 = display.gpioExpanderPin(2, 5, modeOUTPUT)
expander2_P0_6 = display.gpioExpanderPin(2, 6, modeOUTPUT)
expander2_P0_7 = display.gpioExpanderPin(2, 7, modeOUTPUT)
expander2_P0_0 = display.gpioExpanderPin(2, 0, modeOUTPUT)
expander2_P0_1 = display.gpioExpanderPin(2, 1, modeOUTPUT)
@ -39,33 +47,11 @@ if __name__ == "__main__":
expander2_P1_6 = display.gpioExpanderPin(2, 14, modeOUTPUT)
expander2_P1_7 = display.gpioExpanderPin(2, 15, modeOUTPUT)
pins = (expander1_P1_1,
expander1_P1_5,
expander1_P1_6,
expander1_P1_7,
expander2_P0_0,
expander2_P0_1,
expander2_P0_2,
expander2_P0_3,
expander2_P0_4,
expander2_P0_5,
expander2_P0_6,
expander2_P0_7,
expander2_P1_0,
expander2_P1_1,
expander2_P1_2,
expander2_P1_3,
expander2_P1_4,
expander2_P1_5,
expander2_P1_6,
expander2_P1_7,
)
# This example writes a 0.2s pulse on the pins consecutively to test the output
# Take the previously declared pin 1_5 on expander 2 and blink it
# To see the blinking, attatch a 300Ohm resistor and LED between that pin and GND
while (1):
for pin in pins:
pin.digitalWrite(1)
time.sleep(0.01)
pin.digitalWrite(0)
time.sleep(0.01)
expander2_P1_5.digitalWrite(1)
time.sleep(0.5)
expander2_P1_5.digitalWrite(0)
time.sleep(0.5)
# Infinite loop, this goes on forever

View File

@ -1,22 +1,38 @@
from soldered_inkplate6_PLUS import Inkplate
from image import *
import time
# This example shows you how to use the touchscreen on Inkplate6PLUS!
# Include needed libraries
from soldered_inkplate6PLUS import Inkplate
# Create Inkplate object in 1-bit mode, black and white colors only
display = Inkplate(Inkplate.INKPLATE_1BIT)
#main function used by micropython
# Main function
if __name__ == "__main__":
# Initialize the display, needs to be called only once
display.begin()
# Clear the frame buffer
display.clearDisplay()
# This has to be called every time you want to update the screen
# Drawing or printing text will have no effect on the display itself before you call this function
display.display()
# Initialize the touchscreen
display.tsInit(1)
# Draw a rectangle right in the middle of the screen and show it
display.drawRect(450, 350, 100, 100, display.BLACK)
display.display()
# Every time the user touches that rectangle, print a message
# The messags get printed to the terminal where the script was ran from
# Create the variable which counts how many times the rectangle was touched
counter = 0
while True:
#touch the square
# If a touch on the square was detected
if(display.touchInArea(450, 350, 100, 100)):
# Increment the counter and print a message
counter += 1
print(counter)
print("Touch detected! Touch #: "+str(counter))

View File

@ -1,3 +1,6 @@
# MicroPython driver for the PCAL6416A GPIO expander
# By Soldered Electronics
# Based on the original contribution by https://github.com/tve
from machine import Pin as mPin
from micropython import const
@ -71,7 +74,6 @@ modeOUTPUT = const(1)
modeINPUT_PULLUP = const(2)
modeINPUT_PULLDOWN = const(3)
# PCAL6416A is a minimal driver for an 16-bit I2C I/O expander
class PCAL6416A:
def __init__(self, i2c, addr=0x20):

View File

@ -5,7 +5,7 @@
The Micropython modules for the Inkplate product family can befound in this repository. Inkplate is a series of powerful, Wi-Fi and Bluetooth enabled, ESP32-based ePaper display products. Its main feature is simplicity. Just plug in a USB cable, load the MicroPython firmware and the required libraries and run your script on Inkplate itself. The Inkplate product family currently includes Inkplate 10, Inkplate 6 and Inkplate 6PLUS, Inkplate 6COLOR and Inkplate 2.
Inkplate 6 was crowdfunded on [Crowd Supply](https://www.crowdsupply.com/e-radionica/inkplate-6), as well as [Inkplate 10](https://www.crowdsupply.com/e-radionica/inkplate-10), [Inkplate 6PLUS](https://www.crowdsupply.com/e-radionica/inkplate-6plus) and [Inkplate 6COLOR](https://www.crowdsupply.com/soldered/inkplate-6color). Inkplate 2 was funded on [Kickstarter](https://www.kickstarter.com/projects/solderedelectronics/inkplate-2-a-easy-to-use-arduino-compatible-e-paper).
All available to purchase from [soldered.com](https://soldered.com/categories/inkplate/).
All available to purchase from [Soldered.com](https://soldered.com/categories/inkplate/).
Original effort to enable MicroPython support for Inkplate was done by [tve](https://github.com/tve/micropython-inkplate6). Thank you!
@ -14,27 +14,27 @@ Original effort to enable MicroPython support for Inkplate was done by [tve](htt
In order to get started with running your code on Inkplate, follow these steps:
1. Install esptool - the command line tool used to upload firmware to the ESP32. Get it from [here](https://github.com/espressif/esptool) (https://github.com/espressif/esptool). Also, install PySerial as it's a requirement. You can download PySerial [here](https://pypi.org/project/pyserial/) (https://pypi.org/project/pyserial). Place them in a both in a working directory.
2. Download or clone this repository by clicking Code -> Download as .zip. Extract to your desired working directory for your MicroPython files, make it a different one than the esptool directory.
2. Download this repository by clicking Code -> Download as .zip, or clone it. Extract to your desired working directory for your MicroPython files, make it a different one than the esptool directory.
3. Copy the esp32spiram-20220117-v1.18.bin file to the esptool directory from the MicroPython directory. Open your terminal/command prompt in the esptool directory.
3. Copy the esp32spiram-20220117-v1.18.bin file to the esptool directory from the MicroPython directory. Then,open your terminal/command prompt in the esptool directory.
4. We need to flash the MicroPython firmware to Inkplate. It is reccomended to flash the one supplied in this repository that you have copied in the previous step, version 1.18. To do this, connect Inkplate via USB-C and first erase the flash memory by running this command:
4. Now we need to flash the MicroPython firmware to Inkplate. It is reccomended to flash the one supplied in this repository that you have copied in the previous step, version 1.18. To do this, connect Inkplate via USB-C and first erase the flash memory by running this command:
```
//Linux/Mac
// Linux/Mac
python3 esptool.py --port /dev/cu.usbserial-1420 erase_flash
//Windows
// Windows
python esptool.py --port COM5 erase_flash
```
**NOTE:** You should change the serial port listed here to the one which corresponds to your connected Inkplate device.
Now it's possible to flash MicroPython firmware. Do so by running this command:
```
//Linux/Mac
// Linux/Mac
python3 esptool.py --chip esp32 --port /dev/cu.usbserial-1420 write_flash -z 0x1000 esp32spiram-20220117-v1.18.bin
// If you're having problems on Mac, use a slower baud rate with the flag "-b 115200"
//Windows
// Windows
python esptool.py --chip esp32 --port COM5 write_flash -z 0x1000 esp32spiram-20220117-v1.18.bin
```
@ -43,12 +43,12 @@ python esptool.py --chip esp32 --port COM5 write_flash -z 0x1000 esp32spiram-202
5. Open a terminal in your MicroPython folder. Now, it's required to copy all the library files and drivers for your Inkplate board, so your MicroPython script can run. Do so with the following command:
```
//Linux/Mac
python3 pyboard.py --device /dev/ttyUSB0 -f cp mcp23017.py inkplate6.py image.py shapes.py gfx.py gfx_standard_font_01.py :
// Linux/Mac
python3 pyboard.py --device /dev/ttyUSB0 -f cp mcp23017.py inkplate6.py image.py shapes.py gfx.py gfx_standard_font_01.py soldered_logo.py :
//Windows
//This one might need to be started twice
python pyboard.py --device COM5 -f cp inkplate6.py gfx.py gfx_standard_font_01.py mcp23017.py PCAL6416A.py image.py shapes.py :
// Windows
// This one might need to be started twice
python pyboard.py --device COM5 -f cp inkplate6.py gfx.py gfx_standard_font_01.py mcp23017.py PCAL6416A.py image.py shapes.py soldered_logo.py :
```
**NOTE:** here you need to again change the serial port to the one you're using and the main driver of the board to the one made specifically for your Inkplate board. Here it's inkplate6.py for Inkplate 6. If you have a newer version of Inkplate 6 (Soldered Inkplate 6) then copy soldered_inkplate6.py instead. inkplate2.py for Inkplate 2, and so on. Older Inkplate boards use 'mcp23017.py' for the IO expander and the new ones use PCAL6416A.py, so you only need to copy one of them. Check the driver file for your Inkplate board to see which one it requires.
@ -58,10 +58,10 @@ In this command you also need to include all the files your Python script uses (
7. Finally, it's time to run the MicroPython script which will actually run on the device. To demonstrate, we will run the basicBW.py example for Inkplate 6. To run the script, execute the following command:
```
//Linux/Mac
// Linux/Mac
python3 pyboard.py --device /dev/ttyUSB0 "Examples/Inkplate6/basicBW.py"
//Windows
// Windows
python pyboard.py --device COM5 "Examples/Inkplate6/basicBW.py"
```
@ -71,20 +71,22 @@ You can try other examples which will show you all the features of the device.
### Code examples
There are several examples which will indicate all the functions you can use in your own script:
* The basic examples show you drawing shapes, lines and text on the screen in different colors, also a bitmap image in a single color (color image drawing with dithering will be supported soon!)
* The basic examples show you drawing shapes, lines and text on the screen in different colors, also a bitmap image in a single color
* The network examples show you how to use the network features like doing a GET request and downloading a file
* The batteryAndTemperatureRead examples show you how to read the internal battery status and the temperature from the internal sensor
* The exampleSD example shows you how to read image files and text from the SD card
* The gpio_expander example shows how to use the GPIO expander on new Inkplate models
* The touchpad examples show you how to use the touchpad on older Inkplates
More information is provided in the examples themselves in the shape of comments.
### Documentation
Find Inkplate documentation [here](https://inkplate.readthedocs.io/).
### Battery power
Inkplate boards has two options for powering it. First one is obvious - USB port at side of the board. Just plug any micro USB cable and you are good to go. Second option is battery. Supported batteries are standard Li-Ion/Li-Poly batteries with 3.7V nominal voltage. Connector for the battery is standard 2.00mm pitch JST connector (except on Inkplate 2, it uses SMD solder pads for battery terminals). The onboard charger will charge the battery with 500mA when USB is plugged at the same time. You can use battery of any size or capacity if you don't have a enclosure. If you are using our enclosure, battery size shouldn't exceed 90mm x 40mm (3.5 x 1.57 inch) and 5mm (0.19 inch) in height (excluding Inkplate 2, it uses [this battery](https://soldered.com/product/li-ion-baterija-600mah-3-7v/). [This battery](https://soldered.com/product/li-ion-battery-1200mah-3-7v/) is good fit for the Inkplate. Also, Inkplate's hardware is specially optimized for low power consumption in deep sleep mode, making it extremely suitable for battery applications.
Inkplate boards have two options for powering it. The first one is obvious - USB port at side of the board. Just plug any microUSB/USB-C (depending on your board version) cable and you are good to go. The second option is using a battery. Supported batteries are standard Li-Ion/Li-Poly batteries with a 3.7V nominal voltage. Connector for the battery is standard 2.00mm pitch JST connector (except on Inkplate 2, it uses SMD solder pads for battery terminals). The onboard charger will charge the battery with 500mA when USB is plugged at the same time. You can use battery of any size or capacity if you don't have a enclosure. If you are using our enclosure, battery size shouldn't exceed 90mm x 40mm (3.5 x 1.57 inch) and 5mm (0.19 inch) in height (excluding Inkplate 2, it uses [this battery](https://soldered.com/product/li-ion-baterija-600mah-3-7v/). [This battery](https://soldered.com/product/li-ion-battery-1200mah-3-7v/) is a good fit for all Inkplate models. Also, Inkplate's hardware is specially optimized for low power consumption in deep sleep mode, making it extremely suitable for battery applications.
#### ⚠️ WARNING
Please check the polarity on the battery JST connector! Some batteries that can be purchased from the web have reversed polarity that can damage Inkplate board! You are safe if you are using the pouch battery from [soldered.com](https://soldered.com/categories/power-sources-batteries/batteries/lithium-batteries/) or Inkplate with the built-in battery .
@ -102,19 +104,17 @@ All of Inkplate-related development is open-sourced:
- [Arduino library](https://github.com/SolderedElectronics/Inkplate-Arduino-library)
- Hardware design:
- Soldered Inkplate 2 (comming soon!)
- Soldered Inkplate 6 (comming soon!)
- Soldered Inkplate 6PLUS (comming soon!)
- [Soldered Inkplate 2](https://github.com/SolderedElectronics/Soldered-Inkplate-2-hardware-design)
- [Soldered Inkplate 6](https://github.com/SolderedElectronics/Soldered-Inkplate-6-hardware-design)
- [Soldered Inkplate 6PLUS](https://github.com/SolderedElectronics/Soldered-Inkplate-6PLUS-hardware-design)
- [Soldered Inkplate 10](https://github.com/SolderedElectronics/Soldered-Inkplate-10-hardware-design)
- Soldered Inkplate 6COLOR (comming soon!)
- [Soldered Inkplate 6COLOR](https://github.com/SolderedElectronics/Soldered-Inkplate-6COLOR-hardware-design)
- [e-radionica.com Inkplate 6](https://github.com/SolderedElectronics/Inkplate-6-hardware)
- [e-radionica.com Inkplate 10](https://github.com/SolderedElectronics/Inkplate-10-hardware)
- [e-radionica.com Inkplate 6PLUS](https://github.com/SolderedElectronics/Inkplate-6PLUS-Hardware)
- e-radionica.com Inkplate 6COLOR (comming soon!)
- [micropython Inkplate](https://github.com/SolderedElectronics/Inkplate-micropython)
- [OSHWA cerfiticates](https://certification.oshwa.org/list.html?q=inkplate)
### Where to buy & other
### Where to buy
Inkplate boards are available for purchase via:

105
color_image_inkplate2.py Normal file
View File

@ -0,0 +1,105 @@
color_image_inkplate2 = bytearray(
b"\x55\x15\x51\x55\x45\x54\x54\x55\x15\x54\x54\x55\x45\x55\x15\x51\x10\x44\x44\x10\x42\x04\x20\x10\x44\x44\x81\x04\x10\x41\x08\x10\x44\x55\x55\x54\x55\x54\x55\x55\x55\x55\x51\x55\x15\x55\x55\x55\x55\x55\x55\x55\x55"
b"\x44\x51\x15\x11\x54\x45\x45\x45\x44\x45\x45\x44\x51\x11\x51\x14\x44\x10\x41\x04\x10\x41\x04\x04\x10\x41\x10\x41\x04\x10\x41\x04\x11\x04\x44\x45\x44\x45\x45\x11\x11\x11\x15\x11\x51\x44\x51\x11\x44\x45\x11\x11\x45"
b"\x55\x15\x45\x44\x45\x45\x14\x51\x55\x51\x51\x55\x15\x54\x54\x44\x01\x04\x11\x10\x41\x04\x11\x11\x04\x44\x44\x10\x41\x21\x10\x41\x10\x44\x55\x51\x55\x54\x54\x55\x55\x55\x51\x55\x15\x55\x15\x54\x55\x51\x55\x55\x51"
b"\x45\x44\x51\x55\x44\x51\x51\x54\x44\x54\x54\x45\x51\x15\x14\x41\x10\x41\x04\x44\x10\x41\x00\x00\x40\x44\x44\x44\x10\x41\x04\x10\x44\x44\x44\x54\x51\x45\x45\x44\x51\x44\x55\x15\x51\x15\x54\x55\x45\x15\x14\x51\x15"
b"\x51\x55\x14\x44\x55\x15\x15\x15\x15\x15\x15\x51\x15\x45\x11\x10\x04\x10\x48\x04\x10\x41\x11\x10\x11\x04\x11\x04\x44\x10\x41\x10\x10\x44\x55\x15\x45\x14\x54\x55\x15\x55\x11\x51\x15\x45\x15\x11\x51\x51\x55\x15\x51"
b"\x45\x11\x55\x55\x11\x51\x45\x45\x45\x45\x44\x55\x44\x51\x44\x04\x42\x04\x11\x11\x04\x10\x10\x44\x40\x41\x11\x10\x41\x04\x11\x04\x44\x44\x04\x51\x51\x55\x45\x45\x51\x15\x55\x55\x51\x51\x51\x55\x15\x15\x15\x51\x55"
b"\x51\x55\x11\x11\x54\x54\x51\x51\x58\x91\x55\x11\x55\x14\x41\x00\x10\x41\x01\x01\x11\x04\x04\x04\x10\x44\x10\x44\x10\x41\x04\x41\x01\x04\x44\x51\x15\x11\x54\x54\x55\x44\x51\x11\x15\x15\x15\x11\x51\x55\x45\x15\x11"
b"\x55\x11\x55\x54\x55\x15\x54\x54\x46\xa8\x85\x44\x45\x44\x44\x44\x40\x10\x44\x44\x40\x44\x41\x01\x04\x01\x04\x44\x44\x10\x40\x44\x40\x41\x11\x15\x51\x54\x45\x45\x44\x55\x15\x55\x51\x51\x51\x55\x15\x44\x55\x51\x55"
b"\x45\x15\x11\x15\x11\x44\x45\x11\x5a\xaa\xa2\x55\x44\x44\x00\x41\x04\x04\x00\x41\x11\x04\x10\x44\x10\x44\x44\x11\x04\x44\x44\x10\x11\x04\x44\x44\x55\x15\x54\x54\x55\x45\x51\x44\x55\x15\x15\x15\x51\x55\x44\x54\x55"
b"\x51\x51\x54\x51\x54\x55\x51\x54\x46\xa2\xaa\x28\x54\x41\x11\x04\x11\x01\x10\x10\x44\x41\x04\x10\x41\x00\x11\x11\x11\x04\x11\x04\x41\x04\x04\x44\x45\x44\x45\x45\x45\x51\x54\x55\x45\x51\x51\x51\x14\x51\x55\x15\x11"
b"\x54\x55\x15\x14\x45\x44\x54\x45\x5a\x9a\x2a\xa8\x88\x40\x10\x41\x00\x40\x04\x44\x10\x44\x41\x04\x10\x44\x40\x41\x10\x41\x01\x04\x10\x41\x10\x44\x51\x55\x54\x54\x54\x54\x45\x44\x54\x55\x14\x55\x45\x15\x11\x51\x55"
b"\x45\x45\x45\x45\x51\x55\x15\x14\x5a\xaa\x8a\x2a\xaa\x28\x40\x10\x44\x11\x04\x01\x04\x41\x10\x41\x04\x20\x10\x10\x44\x44\x44\x41\x04\x41\x04\x11\x14\x45\x15\x15\x45\x45\x54\x55\x45\x45\x55\x11\x51\x51\x55\x15\x14"
b"\x51\x51\x51\x51\x15\x12\x8a\xaa\x22\x89\xaa\xa2\xa2\xaa\x28\x41\x01\xa0\x41\x10\x41\x10\x11\x10\x41\x04\x04\x44\x10\x44\x10\x10\x44\x10\x41\x10\x44\x55\x45\x45\x14\x54\x55\x14\x54\x54\x45\x54\x55\x15\x15\x51\x51"
b"\x54\x54\x54\x55\x44\x5a\xa2\x22\xaa\xa9\xa2\x6a\x2a\x8a\x8a\x2a\x9a\x99\x99\xa1\x10\x44\x61\x04\x10\x41\x10\x01\x04\x41\x11\x11\x04\x44\x44\x11\x11\x11\x51\x51\x55\x45\x11\x45\x45\x45\x51\x45\x11\x51\x51\x15\x45"
b"\x45\x45\x15\x11\x55\x18\xaa\x2a\x28\x99\x9a\x2a\xa8\xa2\xa6\xa6\xaa\x2a\x66\x9a\x86\x05\xa6\x11\x04\x10\x04\x41\x04\x11\x04\x10\x41\x04\x11\x04\x44\x51\x15\x15\x14\x55\x55\x54\x54\x54\x54\x55\x55\x15\x15\x51\x55"
b"\x54\x55\x45\x54\x45\x46\x22\xa2\x8a\x2a\x66\xa2\x8a\x99\xaa\x6a\x66\xaa\x69\xa8\xa9\x46\xa1\x90\x41\x04\x40\x10\x41\x10\x44\x44\x10\x44\x40\x44\x11\x14\x51\x45\x45\x44\x44\x45\x45\x45\x45\x44\x45\x51\x51\x15\x11"
b"\x45\x44\x51\x14\x51\x5a\xa8\xa8\xaa\x88\xa1\x0a\x99\xa8\xa2\xa6\x66\x25\x9a\xaa\xaa\x66\x1a\xa4\x10\x10\x11\x04\x10\x44\x41\x04\x44\x41\x11\x01\x11\x05\x14\x54\x54\x55\x55\x51\x51\x54\x54\x55\x51\x15\x15\x51\x55"
b"\x51\x51\x55\x45\x14\x48\x8a\x2a\x22\xa8\xa8\x80\xa2\x8a\xa6\x59\x9a\xa9\x96\x28\x99\xa9\xa9\x94\x41\x04\x10\x40\x44\x04\x10\x41\x04\x10\x44\x44\x10\x44\x55\x45\x45\x45\x11\x14\x55\x15\x45\x45\x15\x51\x51\x54\x51"
b"\x54\x54\x44\x55\x45\x5a\xa2\xa2\xa2\x2a\x2a\xa6\xa8\x0a\x19\x96\x62\xaa\x66\x8a\xaa\x5a\x69\x52\x10\x41\x04\x04\x01\x01\x11\x10\x41\x04\x41\x11\x04\x44\x41\x51\x54\x55\x55\x45\x45\x44\x54\x55\x51\x15\x15\x15\x15"
b"\x45\x15\x55\x44\x54\x44\xaa\x28\xa8\x88\x88\x8a\x69\x80\x16\x66\x98\x86\x99\xa8\x69\x99\xa5\x91\x04\x10\x41\x04\x81\x10\x44\x44\x44\x44\x10\x41\x11\x11\x14\x54\x45\x44\x45\x51\x51\x55\x45\x44\x55\x51\x51\x51\x51"
b"\x51\x44\x51\x45\x45\x5a\x22\x8a\x2a\xa2\xa8\xa2\xaa\xaa\x02\x69\xaa\xaa\x99\xaa\x95\x9a\x99\x50\x41\x04\x10\x40\x40\x44\x10\x41\x04\x01\x11\x11\x04\x11\x05\x15\x54\x55\x51\x15\x14\x44\x54\x55\x11\x15\x15\x15\x15"
b"\x55\x55\x14\x54\x51\x12\xa8\xaa\x88\x8a\x2a\x2a\x66\x4a\xa8\x44\x8a\x2a\xaa\x66\x99\xaa\x66\x24\x10\x41\x04\x10\x44\x01\x04\x11\x11\x11\x01\x04\x41\x10\x44\x44\x45\x45\x15\x51\x55\x55\x15\x45\x55\x51\x51\x51\x45"
b"\x44\x45\x45\x45\x15\x58\x8a\x88\xa8\xa2\x88\xa2\xa9\xa2\x8a\xa8\x00\x88\xaa\x69\x96\x58\xa6\xaa\x88\x44\x01\x04\x01\x10\x41\x10\x41\x10\x44\x41\x11\x04\x44\x45\x54\x55\x44\x55\x11\x11\x44\x54\x44\x55\x15\x15\x51"
b"\x55\x51\x51\x55\x51\x12\xa2\xaa\x1a\xa8\xa2\x8a\x6a\x2a\xa2\x8a\xa8\x01\x26\x96\x59\x99\xa6\x22\xa8\xa2\x10\x41\x10\x04\x10\x44\x10\x44\x10\x44\x10\x44\x44\x44\x45\x44\x55\x11\x55\x54\x55\x45\x55\x11\x51\x51\x15"
b"\x44\x54\x54\x44\x55\x1a\x28\x89\x88\x8a\x28\xa2\x26\x88\xa8\xa2\x22\xa0\x02\x66\x9a\x99\x9a\xa8\x8a\x2a\xa2\x04\x04\x41\x04\x04\x44\x11\x04\x11\x04\x41\x04\x44\x51\x55\x11\x55\x14\x55\x14\x54\x45\x55\x15\x15\x51"
b"\x55\x15\x45\x55\x11\x52\x8a\xa2\xaa\xa2\x8a\x2a\x88\xaa\x2a\x2a\xa8\xaa\xa0\x69\xa8\x69\x98\x8a\xaa\x88\xa8\x62\x10\x10\x41\x10\x41\x10\x41\x04\x44\x44\x44\x44\x44\x45\x55\x15\x45\x11\x45\x45\x51\x45\x51\x51\x55"
b"\x45\x44\x54\x45\x54\x52\xa2\x28\x88\xaa\xa2\xa2\x2a\x28\xa2\xa2\x22\x22\x28\xa8\x81\x99\xa6\xa8\x88\xaa\x2a\xaa\x89\x04\x04\x04\x11\x04\x44\x40\x41\x04\x10\x44\x45\x51\x45\x44\x55\x55\x54\x54\x54\x54\x55\x15\x11"
b"\x51\x55\x45\x51\x15\x18\xa2\x8a\xaa\x22\x2a\x28\xa2\x8a\x8a\x2a\x2a\x8a\x2a\xaa\xa0\x89\x98\xaa\xaa\x22\x8a\x22\xa2\xa0\x41\x01\x11\x11\x04\x44\x10\x41\x04\x44\x44\x45\x14\x55\x44\x44\x45\x45\x45\x45\x11\x51\x55"
b"\x54\x44\x51\x15\x45\x52\x28\xa2\x22\xaa\x4a\x8a\x28\xa2\xa2\x8a\x88\xa2\x88\x9a\x4a\x84\x86\x88\x8a\xaa\xa2\xa8\xaa\xaa\x10\x41\x01\x04\x44\x11\x11\x11\x11\x04\x44\x51\x45\x44\x55\x55\x51\x51\x54\x55\x54\x54\x51"
b"\x45\x55\x15\x51\x51\x1a\x8a\x2a\x28\x88\xa2\x8a\x8a\x28\xa8\xa2\xaa\x28\x8a\x2a\xa8\xaa\x20\x06\xa2\x21\xa8\xaa\x18\x69\x01\x10\x44\x41\x04\x44\x10\x41\x04\x41\x11\x14\x54\x55\x44\x44\x54\x54\x55\x11\x15\x45\x55"
b"\x54\x45\x51\x14\x55\x52\x22\x8a\x8a\xaa\xa8\xa2\x28\xa2\x29\x28\x84\xa2\xa2\xa6\x8a\x22\xaa\x00\x06\xaa\x8a\x89\xaa\xaa\x10\x04\x01\x11\x11\x11\x04\x10\x44\x11\x11\x11\x45\x51\x55\x55\x15\x15\x11\x55\x51\x54\x45"
b"\x45\x54\x55\x55\x11\x18\xa8\xa2\x28\x88\x8a\x2a\x8a\x2a\x8a\x8a\x8a\x28\xa2\x2a\xa2\xa8\x88\xa8\x40\x04\x9a\xa8\xa8\xaa\x04\x41\x10\x10\x41\x04\x44\x44\x41\x10\x44\x44\x54\x55\x11\x15\x45\x45\x55\x11\x14\x45\x51"
b"\x54\x45\x14\x45\x55\x0a\x2a\x28\xa2\xaa\x2a\x88\xa2\x88\xa2\xa2\xa2\x8a\x2a\x20\x8a\x2a\x8a\x8a\x28\x02\xa2\x8a\xaa\x9a\x10\x10\x04\x04\x44\x44\x44\x10\x11\x04\x44\x45\x15\x11\x55\x44\x54\x54\x45\x55\x45\x51\x15"
b"\x45\x55\x51\x51\x11\x12\x88\x8a\x28\x8a\x88\xaa\x28\xa2\x28\x88\xa8\xa8\xa2\x8a\xa2\x88\xa8\xa2\x8a\x88\xaa\xaa\x1a\x29\x04\x41\x11\x04\x11\x11\x11\x11\x10\x44\x11\x11\x11\x54\x44\x55\x15\x15\x51\x11\x51\x15\x51"
b"\x54\x51\x15\x15\x44\x08\xa2\xa2\x8a\x88\xaa\x22\x8a\x2a\x22\xaa\x22\x8a\x28\xa2\x28\xa2\x8a\x28\xa2\x2a\x28\x61\xaa\xaa\x10\x10\x00\x41\x04\x44\x44\x44\x04\x11\x11\x11\x14\x45\x55\x45\x45\x45\x15\x54\x55\x51\x55"
b"\x45\x45\x45\x44\x41\x1a\x28\x8a\x22\x8a\x4a\xa8\xa2\x88\xa8\x88\xa8\xa2\x8a\x2a\x22\x28\xa2\xaa\x28\xa2\x8a\x2a\xaa\x9a\x04\x44\x44\x10\x41\x11\x11\x04\x44\x41\x04\x44\x44\x51\x11\x14\x54\x54\x54\x45\x11\x14\x44"
b"\x54\x54\x54\x54\x40\x08\x8a\xa2\xa2\xa2\x28\x8a\x68\xaa\x22\x2a\x22\x8a\x2a\x88\xaa\x8a\x2a\x22\x8a\x28\xa2\x9a\x8a\x89\x44\x01\x01\x04\x10\x41\x11\x44\x41\x10\x41\x04\x45\x15\x55\x45\x45\x45\x15\x55\x55\x55\x55"
b"\x45\x45\x45\x44\x11\x06\xa2\x28\x88\x8a\x8a\xa2\x2a\x22\x8a\x88\xa8\xa2\x88\xaa\x22\x22\x8a\x8a\x8a\x8a\x28\x9a\x9a\xaa\x04\x44\x44\x10\x44\x11\x10\x44\x50\x44\x11\x11\x11\x44\x44\x54\x54\x51\x51\x11\x44\x44\x45"
b"\x54\x54\x54\x41\x00\x48\x8a\x22\x8a\x22\x88\xaa\x8a\x8a\x28\x8a\x28\xa8\xa8\x88\xa2\xa8\xa2\xa2\xa2\x8a\x8a\x15\xa8\x6a\x41\x01\x01\x04\x01\x10\x44\x44\x11\x04\x41\x10\x44\x11\x55\x15\x15\x15\x15\x54\x55\x55\x51"
b"\x55\x55\x44\x40\x44\x0a\x22\x88\xa2\xa8\xa8\x88\xa2\xa2\x8a\x22\x8a\x2a\x2a\x8a\x28\x8a\x28\x62\x28\xa2\x28\xa6\x6a\xaa\x10\x44\x44\x10\x44\x04\x11\x11\x44\x44\x11\x04\x41\x14\x45\x45\x45\x45\x44\x45\x44\x44\x51"
b"\x45\x11\x51\x04\x01\x08\xa8\xaa\x28\x88\x8a\x8a\x28\xa8\xa2\xa8\xa2\x88\x88\xaa\x8a\x22\x8a\x2a\x8a\x28\xa2\x96\x6a\xa6\x04\x40\x41\x04\x10\x41\x11\x11\x14\x44\x41\x10\x44\x44\x51\x11\x11\x51\x55\x54\x55\x55\x15"
b"\x51\x54\x40\x41\x10\x4a\x28\x88\x8a\x28\xa2\x2a\x8a\x2a\x28\x8a\x28\xa2\xa8\x88\xa2\xa8\xa2\x88\xa2\x8a\x28\x99\x59\xaa\x10\x44\x10\x41\x04\x10\x41\x11\x11\x11\x11\x04\x10\x44\x45\x55\x54\x54\x44\x45\x44\x44\x51"
b"\x54\x44\x41\x00\x00\x06\x22\x8a\xa2\x8a\x28\xa2\x2a\x4a\x86\x88\x8a\x28\x86\xa9\x28\x8a\x28\xa2\x8a\xa2\x8a\x19\x99\x89\x04\x41\x10\x41\x01\x04\x10\x44\x45\x11\x10\x44\x44\x44\x44\x44\x45\x15\x55\x51\x51\x55\x15"
b"\x45\x50\x10\x11\x11\x0a\x28\xa2\x22\x22\x8a\x28\xa2\xa2\xa2\xa2\xa2\x8a\x88\x88\xaa\x28\x8a\x28\xa2\x28\xaa\x99\x99\xaa\x44\x11\x04\x10\x44\x41\x04\x10\x44\x51\x14\x41\x04\x11\x14\x55\x51\x45\x11\x14\x54\x51\x51"
b"\x54\x44\x04\x04\x00\x48\xa2\x8a\x28\xa8\xa2\x8a\x28\xa2\x28\xa8\x88\xa2\x2a\x8a\x22\x8a\xa2\x8a\x2a\x8a\x88\x99\x66\x5a\x01\x04\x44\x44\x40\x10\x41\x04\x44\x45\x10\x44\x41\x04\x44\x44\x55\x51\x55\x55\x15\x15\x15"
b"\x44\x41\x01\x00\x44\x0a\x28\xa2\x8a\x21\x28\x8a\x8a\x2a\x8a\x28\xa8\x8a\x88\xa2\xa8\xa1\x28\xa2\x88\x62\xa2\x99\x99\x9a\x10\x41\x04\x10\x11\x04\x10\x44\x11\x11\x11\x10\x44\x41\x11\x51\x44\x54\x44\x45\x15\x45\x51"
b"\x51\x04\x41\x10\x80\x48\x8a\x28\xa2\x8a\x22\x88\xa2\x88\xaa\x2a\x28\xa2\x2a\x28\x8a\x2a\x8a\x28\xaa\x28\xa8\x99\x99\x9a\x11\x10\x41\x05\x04\x41\x04\x41\x11\x11\x14\x44\x10\x44\x11\x15\x51\x45\x51\x51\x44\x51\x15"
b"\x10\x40\x10\x04\x10\x0a\xa2\x8a\x22\x22\x88\xa2\x28\xaa\x22\x8a\x22\x28\x48\xa8\xa2\xa2\x22\x8a\x22\x8a\x22\x16\x59\x9a\x01\x04\x11\x10\x41\x10\x44\x10\x44\x45\x11\x11\x04\x44\x44\x51\x15\x51\x15\x15\x45\x54\x51"
b"\x04\x04\x04\x80\x04\x48\x88\xa2\x28\xa8\xa8\x8a\x8a\x22\xa8\xa2\xaa\x86\x8a\x22\xa8\xa2\xa8\xa2\x88\xa2\xaa\xa5\x99\x9a\x10\x41\x11\x04\x44\x11\x01\x04\x10\x44\x54\x44\x44\x11\x11\x15\x14\x55\x45\x44\x54\x45\x45"
b"\x10\x41\x00\x11\x04\x06\x28\x8a\x28\x8a\x22\xa2\x22\x8a\x2a\x28\x88\x62\x22\x8a\x2a\x28\x8a\x28\xaa\x28\x88\x99\x99\x9a\x55\x50\x40\x44\x11\x04\x44\x41\x04\x44\x45\x14\x44\x44\x44\x51\x45\x11\x51\x55\x15\x54\x54"
b"\x08\x10\x44\x10\x40\x48\x8a\x22\x8a\x22\x28\x8a\x28\xa2\x8a\x8a\x86\x22\xa8\xa2\x88\xa2\xa2\x8a\x22\x8a\x2a\x65\x99\x98\x54\x44\x11\x04\x10\x40\x40\x10\x44\x10\x44\x51\x11\x11\x11\x15\x51\x54\x54\x51\x44\x45\x45"
b"\x04\x04\x01\x00\x10\x0a\xa2\xa8\xa1\xa2\x88\xa2\x88\x88\xa2\x28\xa2\xa8\x88\xa2\x2a\x28\xa8\xa2\x88\xa2\x88\x66\x66\x6a\x94\x11\x10\x41\x04\x44\x11\x04\x41\x04\x45\x15\x44\x44\x45\x11\x45\x45\x15\x14\x55\x54\x51"
b"\x41\x01\x10\x44\x04\x48\x88\x8a\x22\x28\xa2\x28\x4a\x2a\x28\xaa\x28\x8a\x28\x8a\x88\x8a\x2a\x28\xa8\xa2\xa2\x65\x96\x6a\x11\x01\x04\x11\x10\x41\x11\x10\x10\x44\x44\x44\x51\x11\x11\x45\x51\x55\x45\x45\x44\x45\x15"
b"\x00\x40\x04\x01\x00\x08\xa2\x88\xa2\x88\x8a\x88\xa2\x88\x8a\x21\xa2\xa2\x8a\x22\x2a\xa2\x88\xaa\x22\x28\x8a\x59\x99\x99\x95\x44\x12\x10\x44\x11\x04\x11\x04\x44\x11\x14\x54\x51\x51\x51\x15\x11\x51\x51\x55\x51\x51"
b"\x10\x11\x20\x48\x44\x4a\x28\xa2\x28\x8a\x22\x28\x88\xa2\xa2\xa8\xa8\xa8\xa2\xa2\x88\x8a\x2a\x22\x8a\x8a\x28\x65\x99\x9a\x54\x55\x41\x04\x04\x44\x41\x04\x41\x04\x41\x11\x14\x44\x51\x15\x45\x54\x45\x14\x44\x55\x15"
b"\x04\x40\x40\x10\x00\x08\x8a\x2a\x22\x88\xa8\x8a\x2a\x28\x84\x8a\x2a\x22\x28\x88\xa2\x28\xa2\xa1\xa2\x22\x8a\x66\x66\x62\x95\x55\x55\x41\x10\x80\x10\x41\x10\x41\x11\x11\x45\x15\x15\x44\x51\x14\x51\x45\x45\x11\x45"
b"\x10\x10\x11\x01\x04\x4a\x88\x88\xa8\xa2\x22\xa2\x88\x88\xa8\xa2\x8a\x2a\x8a\x2a\x22\x8a\x28\xa8\xa2\xa8\xa2\x65\x96\x5a\x95\x51\x54\x55\x21\x11\x11\x04\x10\x44\x11\x11\x11\x45\x44\x55\x15\x45\x54\x51\x51\x54\x51"
b"\x01\x04\x00\x40\x40\x04\xa2\x8a\x22\x2a\x28\x88\x8a\x2a\x22\x28\xa2\xa2\xa2\x88\xa8\xa2\x4a\x22\x28\x8a\x28\x59\x99\xaa\x45\x15\x55\x55\x55\x04\x10\x41\x04\x11\x10\x44\x44\x51\x55\x11\x51\x14\x45\x14\x54\x45\x55"
b"\x10\x01\x10\x10\x11\x0a\x28\xa2\x28\x88\x8a\x28\xa2\x82\x2a\x28\xa2\x28\x8a\x28\x8a\x28\xa2\x2a\x8a\x8a\x2a\x66\x66\x66\x95\x55\x45\x45\x14\x55\x04\x10\x44\x41\x04\x44\x44\x54\x45\x45\x15\x45\x51\x45\x15\x51\x11"
b"\x08\x40\x04\x04\x00\x42\x8a\x28\x8a\x8a\x88\x8a\x28\xa2\x88\x8a\x2a\x8a\xa2\x8a\x22\x22\x2a\x22\x28\xa2\x88\x65\x99\x6a\x95\x55\x55\x55\x55\x51\x51\x04\x10\x10\x41\x10\x45\x11\x14\x51\x51\x51\x15\x51\x44\x55\x15"
b"\x04\x11\x01\x04\x44\x08\xa2\x22\xa2\x22\x2a\x22\x88\x88\x8a\x22\x88\xa2\x28\xa2\x8a\x2a\x22\xa2\x8a\x28\xa2\x59\x66\x6a\x55\x51\x55\x45\x14\x55\x44\x41\x04\x44\x10\x44\x41\x15\x45\x15\x14\x45\x44\x51\x15\x11\x51"
b"\x01\x00\x41\x00\x02\x0a\x22\x88\x88\xa2\x88\xa8\x8a\x2a\x22\xa2\x28\xa2\x8a\x28\xa2\x88\xa2\x28\xa2\x8a\x28\x99\x99\xaa\x94\x55\x51\x55\x55\x55\x04\x11\x10\x11\x04\x11\x11\x44\x51\x51\x45\x51\x55\x11\x41\x14\x45"
b"\x10\x10\x40\x44\x40\x48\xa8\xa8\xa2\x28\x8a\x22\x22\x88\xa2\x22\x8a\x28\xa2\x8a\x28\xa2\x28\x8a\x28\xa2\x8a\x59\x99\x6a\x95\x55\x55\x55\x45\x44\x44\x41\x04\x40\x44\x41\x11\x15\x14\x54\x54\x51\x11\x44\x51\x45\x51"
b"\x04\x04\x20\x00\x10\x4a\x22\x22\x2a\x22\x88\x8a\x88\x8a\x28\xa2\x22\x8a\x2a\xa2\x8a\x28\x8a\x8a\x22\x28\xa1\x99\x99\xa6\x95\x55\x15\x51\x54\x54\x41\x04\x10\x11\x04\x10\x45\x45\x45\x15\x11\x51\x54\x54\x44\x51\x14"
b"\x01\x01\x04\x44\x04\x04\x8a\x2a\x22\x88\xa2\x88\xa2\x88\x8a\x22\x88\xa2\x88\x8a\xa2\x8a\x88\xa2\x8a\x8a\x2a\x59\x66\x6a\x95\x51\x55\x15\x55\x50\x40\x41\x04\x40\x41\x04\x41\x14\x51\x45\x45\x14\x45\x11\x11\x11\x45"
b"\x80\x40\x10\x01\x01\x0a\x22\x88\xa2\x2a\x28\x92\x28\xa2\x88\xa2\x28\x88\xa8\xa2\x28\xa2\x28\x88\xa2\x22\x89\x99\x99\xaa\x15\x15\x55\x55\x55\x44\x11\x10\x42\x10\x10\x44\x15\x51\x45\x44\x51\x45\x51\x51\x44\x44\x54"
b"\x10\x11\x01\x10\x40\x42\xa2\x28\x8a\x22\x12\x28\x8a\x28\x62\x28\x8a\x2a\x2a\x2a\x28\x88\x8a\x28\xa2\xa8\xa1\x96\x66\x69\x95\x55\x55\x51\x51\x01\x10\x11\x10\x11\x04\x41\x44\x54\x54\x55\x15\x14\x44\x44\x51\x11\x15"
b"\x04\x00\x40\x04\x10\x18\x8a\x88\xa2\x89\x28\x8a\x22\x22\x28\x8a\x22\x88\x88\xa2\x8a\x8a\x88\x8a\x28\x89\x29\x66\x66\x6a\x95\x55\x45\x15\x54\x44\x04\x40\x84\x41\x10\x44\x55\x15\x45\x11\x45\x45\x51\x51\x11\x44\x44"
b"\x04\x44\x04\x40\x81\x08\xa2\x28\x88\x92\x8a\x22\x8a\x28\x8a\x22\x88\xa2\x8a\x28\xa2\x62\x2a\x88\x8a\x12\x8a\x66\x66\x62\x95\x55\x55\x55\x51\x01\x10\x11\x04\x10\x04\x45\x11\x44\x51\x55\x14\x51\x14\x45\x11\x14\x44"
b"\x40\x00\x40\x10\x10\x0a\x22\x8a\x28\x88\x88\xa2\x22\x8a\x22\x88\xa2\x28\xa2\x8a\x18\x8a\x88\xa2\x88\xa2\x21\x99\x99\xaa\x95\x45\x55\x54\x44\x44\x04\x10\x41\x04\x44\x44\x54\x55\x15\x11\x45\x14\x44\x51\x45\x11\x14"
b"\x04\x44\x04\x04\x04\x4a\x28\x88\x86\x28\xa2\x28\xa8\x88\xa2\x28\x8a\x22\x28\x92\x8a\xa2\x28\x84\xa2\x28\xa9\x99\x99\xa6\x91\x55\x51\x55\x41\x04\x41\x04\x10\x44\x41\x15\x14\x45\x45\x14\x51\x51\x45\x11\x11\x14\x45"
b"\x04\x02\x10\x41\x00\x04\x8a\x2a\x22\x8a\x2a\x22\x22\x8a\x28\x8a\x22\x8a\x21\x28\xa2\x2a\x8a\x2a\x2a\x2a\x21\x96\x66\x6a\x15\x55\x15\x45\x10\x41\x20\x41\x04\x41\x11\x11\x45\x51\x51\x45\x14\x44\x41\x11\x45\x45\x10"
b"\x00\x40\x04\x20\x44\x4a\xa2\x88\xa8\x88\x88\xa8\xa2\x22\x8a\x22\xa2\x22\x4a\x28\xa2\x88\xa2\x88\x88\x88\xa9\x66\x66\x6a\x95\x55\x55\x54\x04\x12\x04\x10\x40\x10\x44\x54\x51\x14\x44\x51\x45\x54\x51\x44\x44\x41\x14"
b"\x10\x04\x40\x04\x00\x08\x88\x8a\x22\x8a\x22\x22\x28\xa8\x88\xa2\x28\x92\x22\x8a\x28\xa2\x28\xa2\x8a\x28\x8a\x66\x66\x62\x95\x55\x54\x51\x11\x04\x41\x04\x11\x04\x11\x15\x15\x14\x55\x14\x51\x05\x14\x44\x44\x51\x11"
b"\x08\x40\x04\x40\x41\x0a\x28\xa2\x28\xa2\x8a\x28\x8a\x22\x28\xa2\x8a\x28\xa2\x22\x8a\x2a\x8a\x28\xa2\x88\xa1\x99\x99\xa9\x95\x45\x45\x44\x04\x40\x44\x04\x10\x41\x15\x11\x45\x45\x11\x45\x14\x51\x11\x11\x11\x11\x11"
b"\x00\x10\x40\x10\x10\x12\x8a\x28\x88\x88\xa2\x8a\x22\x28\x8a\x28\x88\x8a\x22\x88\xa2\x88\xa2\x8a\x22\x28\x89\x96\x66\x6a\x94\x55\x55\x01\x01\x04\x01\x01\x04\x11\x11\x44\x51\x11\x45\x11\x44\x44\x44\x45\x11\x11\x11"
b"\x11\x00\x11\x01\x01\x08\x8a\x22\xa2\x8a\x22\x22\x8a\x22\x88\x88\x8a\x22\x28\xa2\x28\xa2\x28\xa2\x28\x8a\x29\x99\x99\xa2\x55\x55\x54\x44\x48\x41\x11\x10\x41\x04\x54\x55\x15\x14\x51\x54\x51\x11\x11\x44\x51\x11\x10"
b"\x00\x11\x00\x40\x10\x00\x48\xa8\x88\xa2\x28\xa2\x22\x88\xa2\x8a\x22\x8a\x22\x28\x88\x8a\x8a\x28\x8a\x22\x89\x99\x99\x2a\x95\x54\x54\x10\x10\x11\x04\x10\x10\x41\x11\x44\x51\x45\x14\x44\x44\x44\x44\x44\x44\x44\x45"
b"\x11\x00\x84\x04\x02\x10\x08\x22\x8a\x22\x8a\x28\xa8\xa2\x28\x88\xa2\x22\x8a\x22\x8a\x28\xa2\x8a\xa2\x88\xa1\x99\x66\xaa\x15\x45\x50\x41\x04\x40\x40\x44\x01\x11\x14\x45\x11\x44\x51\x14\x44\x44\x44\x44\x44\x44\x41"
b"\x00\x48\x00\x40\x80\x04\x01\x00\x62\x88\xa2\x22\x22\x28\x88\xa2\x28\xa2\x22\x28\xa2\x8a\x28\xa2\x28\xa2\x29\x96\x66\xa1\x95\x55\x41\x04\x40\x11\x04\x01\x10\x45\x15\x51\x44\x55\x14\x51\x11\x04\x44\x45\x11\x11\x10"
b"\x10\x01\x10\x20\x11\x02\x10\x10\x08\xa8\x8a\x28\x8a\x22\x8a\x28\x8a\x22\x8a\x22\x22\x22\x8a\x28\x8a\x28\x86\x66\x66\x6a\x55\x54\x10\x42\x11\x00\x41\x10\x41\x11\x44\x44\x55\x11\x15\x14\x41\x10\x44\x44\x45\x11\x11"
b"\x21\x10\x04\x01\x00\x40\x01\x08\x40\x06\x22\x8a\x22\x28\xa2\x12\x88\xa2\x22\x8a\x28\xa2\x22\x8a\x88\x8a\x26\x66\x9a\xa6\x95\x15\x04\x10\x04\x11\x10\x04\x10\x44\x54\x51\x11\x44\x44\x44\x41\x04\x11\x11\x11\x11\x11"
b"\x01\x01\x01\x10\x10\x21\x20\x80\x21\x00\x28\x88\xa2\x88\x86\x28\xa2\x28\xa2\x22\x88\x8a\x28\xa2\x8a\x8a\x29\x99\xa6\x6a\x95\x54\x41\x04\x41\x10\x04\x41\x04\x55\x14\x45\x44\x45\x45\x11\x10\x44\x41\x11\x11\x11\x10"
b"\x10\x10\x10\x01\x01\x00\x00\x12\x00\x48\x00\x8a\x28\x8a\x22\x88\x8a\x22\x28\xa2\x22\x88\x8a\x28\xa2\x22\x86\x66\x66\x89\x91\x50\x10\x41\x10\x04\x40\x40\x45\x44\x45\x14\x45\x44\x51\x10\x04\x01\x10\x44\x44\x44\x44"
b"\x01\x01\x02\x10\x10\x10\x44\x00\x42\x01\x10\x02\x22\x88\xa2\x28\xa2\x28\x8a\x22\x88\xa2\xa2\x88\x8a\x88\xa6\x59\x9a\x6a\x95\x41\x04\x20\x04\x40\x44\x11\x10\x51\x51\x44\x51\x15\x14\x44\x41\x10\x11\x05\x11\x11\x11"
b"\x10\x20\x00\x04\x08\x08\x02\x10\x10\x40\x08\x40\x42\x28\x88\x8a\x22\x8a\x22\x28\x8a\x28\x88\x8a\x12\x8a\x26\x65\x99\xaa\x15\x04\x21\x04\x01\x04\x11\x04\x45\x15\x14\x51\x45\x44\x51\x01\x04\x11\x04\x41\x11\x11\x14"
b"\x01\x01\x04\x40\x80\x40\x40\x08\x00\x08\x00\x20\x04\x08\xa2\x88\x88\x88\xa2\x88\xa2\x22\x28\xa2\xa2\x8a\x26\x59\x99\xa1\x94\x12\x00\x41\x10\x11\x00\x44\x45\x44\x45\x14\x50\x45\x14\x44\x41\x00\x41\x11\x11\x14\x44"
b"\x10\x10\x80\x01\x04\x04\x08\x41\x21\x01\x21\x04\x00\x41\x22\x22\x8a\x28\x88\x8a\x22\x28\x88\x88\x88\xa2\x85\x96\x59\xaa\x90\x80\x44\x10\x04\x00\x44\x11\x11\x15\x11\x45\x15\x11\x44\x40\x10\x11\x10\x01\x04\x44\x44"
b"\x01\x00\x10\x40\x00\x42\x00\x00\x00\x80\x00\x00\x88\x00\x04\x88\xa2\x22\x28\xa2\x22\x88\xa2\x8a\x2a\x28\xa9\x99\x9a\x9a\x81\x04\x01\x01\x01\x10\x04\x11\x44\x45\x14\x44\x44\x51\x11\x04\x04\x40\x04\x44\x41\x11\x11"
b"\x20\x11\x00\x10\x40\x00\x44\x10\x48\x12\x12\x10\x00\x48\x00\x02\x22\x8a\x22\x22\x28\x8a\x22\x22\x88\x8a\x25\x99\x9a\xaa\x10\x10\x40\x41\x10\x04\x41\x14\x51\x41\x44\x51\x51\x15\x10\x41\x10\x11\x10\x10\x10\x44\x44"
b"\x01\x00\x10\x00\x21\x04\x01\x00\x00\x00\x00\x08\x40\x01\x08\x48\x08\xa2\x28\x8a\x22\x22\x22\x88\x8a\x22\x89\x66\x69\xa4\x04\x04\x10\x10\x04\x40\x10\x44\x44\x54\x45\x11\x14\x45\x10\x10\x41\x01\x04\x11\x04\x11\x11"
b"\x10\x21\x01\x21\x00\x40\x80\x20\x44\x10\x44\x00\x12\x10\x80\x04\x04\x12\x88\xa2\x22\x8a\x28\x8a\x22\x88\xa6\x59\x9a\x90\x41\x01\x04\x04\x40\x11\x04\x44\x44\x44\x51\x11\x11\x41\x04\x04\x10\x44\x41\x00\x44\x11\x11"
b"\x04\x00\x10\x00\x10\x08\x00\x04\x00\x04\x02\x04\x00\x00\x10\x80\x40\x00\x8a\x22\x88\xa2\x22\x22\x88\xa8\x86\x66\xaa\x41\x00\x40\x41\x00\x04\x00\x01\x11\x45\x14\x44\x51\x44\x50\x41\x11\x04\x10\x10\x44\x01\x04\x41"
b"\x41\x11\x00\x10\x02\x00\x44\x40\x08\x40\x81\x02\x04\x20\x00\x04\x21\x08\x41\x22\x28\x88\x88\xa2\x28\x8a\x26\x59\xa4\x10\x20\x11\x00\x44\x41\x11\x11\x11\x45\x44\x51\x11\x14\x44\x10\x04\x04\x04\x04\x01\x10\x40\x44"
b"\x00\x00\x08\x01\x10\x40\x00\x08\x40\x08\x10\x20\x02\x01\x20\x40\x00\x81\x00\x04\x88\x8a\x28\x88\x88\xa2\xa5\x9a\xa4\x01\x04\x40\x11\x00\x04\x00\x44\x44\x44\x45\x11\x44\x44\x41\x04\x41\x01\x01\x11\x10\x44\x04\x11"
b"\x12\x04\x01\x00\x04\x10\x48\x00\x08\x40\x42\x01\x20\x10\x01\x08\x48\x10\x22\x08\x0a\x22\x88\x89\x22\x22\x26\x6a\x41\x10\x04\x04\x00\x11\x01\x11\x14\x44\x44\x44\x44\x45\x14\x10\x40\x10\x41\x10\x00\x10\x01\x04\x40"
b"\x00\x40\x40\x11\x00\x00\x01\x04\x00\x04\x00\x40\x01\x00\x42\x00\x00\x02\x00\x00\x40\x48\x88\xa2\x28\x88\x99\xa6\x11\x08\x00\x40\x44\x00\x40\x04\x11\x14\x44\x51\x11\x11\x44\x44\x04\x04\x10\x04\x44\x04\x44\x40\x11"
b"\x21\x00\x10\x80\x81\x04\x10\x00\x44\x80\x84\x01\x00\x48\x20\x44\x04\x20\x11\x10\x04\x00\x62\x22\x22\x28\x99\xa8\x00\x81\x10\x10\x01\x10\x11\x04\x44\x44\x44\x44\x51\x11\x44\x01\x01\x01\x04\x41\x01\x10\x00\x11\x04"
b"\x00\x12\x01\x04\x10\x02\x01\x04\x00\x04\x01\x00\x10\x80\x04\x00\x80\x04\x00\x02\x00\x20\x02\x88\x88\x88\x99\xa1\x11\x00\x04\x08\x40\x04\x00\x51\x44\x44\x44\x45\x11\x51\x11\x10\x10\x40\x00\x40\x44\x04\x44\x40\x40"
b"\x11\x00\x00\x00\x04\x20\x00\x00\x20\x40\x40\x92\x04\x04\x00\x08\x01\x00\x42\x00\x10\x04\x08\x0a\x22\x88\xa6\x10\x40\x44\x01\x04\x10\x40\x44\x11\x14\x51\x44\x44\x44\x11\x44\x04\x04\x11\x04\x11\x04\x10\x44\x11\x04"
b"\x00\x41\x04\x44\x40\x01\x04\x82\x04\x00\x20\x00\x42\x01\x02\x00\x40\x20\x00\x41\x02\x02\x00\x40\x28\x88\x9a\x04\x20\x01\x10\x40\x04\x01\x01\x11\x14\x11\x11\x11\x44\x51\x11\x01\x01\x00\x10\x04\x10\x40\x01\x00\x41"
b"\x10\x10\x10\x00\x08\x40\x40\x00\x40\x84\x04\x10\x00\x10\x20\x44\x08\x01\x04\x00\x20\x41\x10\x01\x00\x62\x24\x10\x04\x41\x00\x04\x10\x40\x44\x45\x05\x11\x44\x51\x11\x11\x01\x10\x40\x11\x01\x01\x00\x11\x10\x44\x10"
b"\x04\x01\x02\x04\x10\x04\x01\x04\x01\x02\x01\x02\x10\x02\x00\x00\x01\x00\x80\x82\x00\x20\x08\x10\x04\x02\x90\x01\x00\x10\x11\x01\x00\x10\x81\x11\x41\x11\x14\x11\x11\x11\x10\x04\x11\x00\x10\x40\x44\x41\x01\x01\x04"
b"\x81\x00\x10\x00\x00\x40\x20\x42\x00\x10\x40\x20\x04\x80\x10\x42\x10\x10\x08\x00\x04\x01\x00\x00\x80\x80\x04\x10\x44\x01\x00\x40\x11\x04\x11\x44\x51\x14\x45\x44\x44\x44\x04\x41\x00\x11\x00\x10\x00\x04\x10\x40\x41")

File diff suppressed because it is too large Load Diff

106
color_image_inkplate7.py Normal file
View File

@ -0,0 +1,106 @@
color_image_inkplate7 = bytearray(
b"\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"
b"\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"
b"\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45"
b"\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"
b"\x55\x15\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55\x45\x54\x55"
b"\x51\x54\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51\x55\x15\x51"
b"\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"
b"\x55\x45\x51\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45"
b"\x51\x55\x15\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"
b"\x55\x55\x55\x45\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"
b"\x54\x51\x54\x55\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14\x51\x45\x14"
b"\x55\x55\x45\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"
b"\x45\x55\x55\x54\x55\x15\x15\x45\x45\x51\x51\x54\x54\x55\x15\x15\x45\x45\x51\x51\x54\x54\x55\x15\x15\x45\x45\x51\x51\x54\x54\x55\x15\x15\x45\x45\x51\x51\x54\x54\x55\x15\x15\x45\x45\x51\x51\x54\x54\x55\x15\x15\x45"
b"\x55\x14\x55\x45\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55"
b"\x55\x55\x51\x55\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x55"
b"\x51\x55\x15\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x51"
b"\x55\x45\x55\x45\x55\x15\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15"
b"\x55\x55\x54\x55\x51\x54\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x56\x55\x15\x55\x45\x55\x51\x59\x54\x55\x55\x15\x55\x45\x65\x51\x51\x54\x55\x55\x15\x95\x45\x55\x51\x55\x55"
b"\x51\x51\x45\x55\x15\x55\x51\x55\x51\x51\x54\x54\x55\x15\x15\x45\x45\x51\x51\x54\x54\x55\x15\x15\x45\x45\x51\x55\x54\x54\x55\x15\x15\x45\x55\x51\x51\x54\x54\x55\x15\x55\x55\x55\x51\x51\x54\x55\x55\x15\x15\x45\x55"
b"\x55\x55\x55\x51\x55\x45\x55\x45\x55\x15\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x45\x45\x55\x55\x55\x55\x55\x15\x15\x55\x55\x65\x55\x54\x54\x55\x45\x55\x95\x55\x51\x51\x55\x55\x55\x15"
b"\x54\x55\x55\x15\x55\x55\x15\x55\x15\x55\x45\x45\x51\x51\x54\x54\x55\x15\x15\x45\x45\x51\x51\x54\x54\x55\x15\x54\x55\x45\x51\x64\x54\x55\x51\x55\x15\x45\x55\x51\x55\x55\x51\x55\x15\x55\x45\x55\x15\x51\x54\x55\x51"
b"\x55\x51\x45\x55\x51\x55\x54\x55\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x54\x55\x55\x55\x15\x55\x55\x51\x55\x55\x54\x55\x14\x55\x45\x45\x55\x59\x54\x51\x55\x15\x55\x55\x45\x51\x55"
b"\x45\x55\x55\x55\x15\x45\x55\x51\x51\x45\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x55\x55\x51\x55\x55\x15\x45\x55\x55\x45\x55\x55\x55\x54\x55\x55\x15\x15\x45\x55\x51\x55\x54\x55\x55\x55\x55"
b"\x55\x15\x15\x15\x55\x55\x15\x55\x55\x55\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x55\x15\x45\x45\x15\x45\x55\x54\x55\x15\x14\x56\x45\x65\x45\x45\x54\x55\x55\x54\x55\x54\x55\x51\x45\x51\x55\x15\x15"
b"\x55\x55\x55\x51\x54\x55\x51\x45\x15\x55\x15\x55\x45\x45\x51\x51\x54\x54\x55\x15\x15\x45\x45\x51\x51\x54\x55\x55\x55\x55\x14\x55\x55\x55\x55\x65\x66\x45\x55\x55\x55\x51\x51\x55\x55\x15\x55\x55\x55\x55\x45\x55\x51"
b"\x51\x51\x51\x55\x45\x51\x55\x55\x54\x51\x54\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x54\x55\x55\x51\x51\x51\x58\xa2\x18\x66\x11\x95\x15\x55\x55\x91\x55\x55\x45\x15\x55\x15\x55\x51\x55"
b"\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x15\x15\x45\x45\x51\x51\x54\x54\x55\x15\x15\x45\x55\x51\x45\x51\x55\x15\x55\x55\x58\x59\x99\xa1\x56\x15\x54\x54\x64\x65\x85\x45\x55\x54\x51\x54\x54\x55\x55"
b"\x55\x15\x15\x14\x55\x15\x14\x51\x45\x45\x45\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x45\x55\x55\x55\x45\x55\x45\x45\x16\xa9\x89\x99\x95\x65\x45\x65\x99\x86\x54\x55\x15\x55\x55\x55\x55\x55\x15"
b"\x51\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x15\x55\x54\x55\x55\x15\x55\x45\x55\x51\x55\x54\x55\x54\x55\x15\x95\x96\x55\x54\x55\x55\x6a\x18\x66\x89\x64\x61\x96\x51\x46\x59\x59\x59\x54\x51\x55\x45\x45\x45\x51"
b"\x55\x51\x51\x51\x55\x51\x51\x54\x54\x54\x54\x55\x54\x55\x45\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x55\x55\x54\x51\x45\x51\x45\x55\x16\x19\xa9\xa8\x9a\x45\x99\x59\x16\x99\x24\x51\x55\x45\x55\x45\x55\x55\x55\x55"
b"\x55\x55\x55\x55\x55\x55\x55\x45\x55\x55\x55\x51\x55\x51\x55\x51\x55\x54\x55\x55\x15\x55\x45\x55\x51\x45\x51\x55\xa2\x64\x65\x55\x51\x54\xa8\xa2\x59\xa8\x55\x66\x45\x69\x26\x55\x56\x91\x55\x95\x54\x54\x54\x54\x55"
b"\x51\x45\x45\x15\x14\x55\x15\x55\x45\x45\x45\x55\x45\x55\x55\x15\x45\x45\x51\x51\x54\x54\x55\x15\x95\x55\x15\x45\x16\x61\x98\x69\x15\x66\x6a\x66\x66\x26\x59\x12\x56\x46\x69\x26\x65\x15\x59\x45\x15\x55\x55\x55\x51"
b"\x55\x55\x55\x55\x55\x51\x54\x55\x55\x55\x55\x15\x55\x15\x15\x55\x55\x55\x55\x55\x55\x55\x55\x59\x15\x55\x55\x55\x59\x19\x85\x91\xa6\x56\x28\xa2\x46\x49\x95\x65\x64\x5a\x66\x64\x49\x55\x14\x55\x55\x45\x45\x45\x55"
b"\x54\x54\x55\x51\x55\x15\x55\x51\x54\x54\x55\x54\x55\x55\x59\x51\x59\x54\x55\x15\x45\x65\x51\x92\x49\x19\x65\x95\x56\x66\x59\x99\x91\x91\xa6\x9a\x64\xa2\x51\x92\x55\x98\x61\x95\x59\x95\x55\x55\x54\x55\x55\x55\x15"
b"\x55\x55\x51\x55\x45\x55\x45\x55\x45\x55\x51\x55\x51\x51\x54\x55\x45\x15\x51\x56\x55\x14\x55\x98\xa2\x62\x44\x54\x51\x48\x64\x99\x1a\x1a\xa2\xa9\x19\x99\x95\x65\x85\x86\x66\x46\x64\x51\x59\x14\x55\x56\x51\x51\x55"
b"\x45\x45\x55\x45\x55\x54\x55\x15\x55\x45\x55\x45\x55\x55\x45\x55\x55\x55\x55\x54\x55\x55\x64\x8a\x69\x2a\x19\x99\x65\x56\x66\x46\x65\x99\x29\x82\x59\xa8\x54\x52\x54\x66\x98\x55\x85\x55\x45\x55\x51\x51\x55\x55\x51"
b"\x55\x55\x15\x55\x51\x45\x55\x54\x55\x55\x15\x55\x15\x15\x55\x45\x15\x51\x45\x45\x51\x54\x8a\x6a\x2a\x99\xa8\x46\x18\x65\x18\x68\x99\x2a\x6a\xa6\x98\x66\x45\xa6\x56\x69\x26\x64\x56\x54\x56\x55\x15\x55\x45\x15\x55"
b"\x54\x55\x54\x54\x55\x55\x55\x55\x51\x59\x54\x55\x55\x54\x54\x55\x54\x55\x55\x55\x55\x46\xa8\x22\x49\x29\x16\xa8\x62\x15\xa5\x96\x21\x56\x24\xa9\x95\x8a\x59\x61\x65\x86\x66\x55\x65\x15\x64\x51\x55\x54\x55\x54\x55"
b"\x55\x51\x55\x55\x55\x55\x45\x15\x15\x45\x55\x51\x51\x55\x55\x55\x55\x66\x99\x55\x15\x55\x2a\x86\xaa\xa2\x65\x92\x15\x99\x51\x91\x66\x66\x4a\x62\x12\x61\x95\x99\x51\x96\x49\x19\x19\x56\x55\x55\x54\x65\x55\x65\x51"
b"\x55\x55\x45\x45\x45\x14\x55\x51\x55\x55\x15\x55\x55\x45\x95\x51\x46\x11\x21\x45\x54\x56\x48\x9a\xa2\x9a\x49\x98\xa9\x64\x66\x16\x98\x91\xa2\x19\x99\x89\x91\x86\x56\x49\x99\x56\x54\x65\x16\x55\x55\x55\x64\x55\x55"
b"\x45\x15\x55\x55\x55\x55\x55\x55\x54\x55\x54\x54\x54\x58\x48\x55\x54\x99\x94\x55\x55\x55\xa6\xa2\xaa\x28\xa1\x66\x21\x91\xa1\x69\x85\x16\x4a\xa6\xa6\x69\x16\x61\x45\x95\x18\x91\x45\x51\x51\x45\x16\x45\x15\x51\x86"
b"\x55\x54\x54\x54\x54\x55\x45\x15\x65\x51\x55\x45\x55\x46\xa5\x96\x28\x59\x54\x66\x16\x44\x62\x8a\x86\x8a\x66\x91\x86\x56\x66\x91\x59\x69\xa2\x68\x64\x6a\x65\x15\x59\x19\x69\x96\x56\x55\x95\x55\x54\x55\x59\x59\x55"
b"\x55\x45\x55\x55\x55\x51\x55\x54\x55\x55\x45\x55\x45\x49\x45\x89\x99\x96\x62\x25\x45\x55\x66\x1a\x2a\x9a\xa8\x66\x68\x66\x48\x5a\x99\x94\x46\x86\x99\x92\x91\xa5\x96\x64\x56\x64\x65\x16\x15\x51\x65\x54\x54\x45\xa6"
b"\x51\x55\x45\x45\x45\x55\x55\x55\x51\x45\x55\x55\x66\x56\x59\x98\xa8\x61\x26\x62\x61\x26\x60\xa9\xa1\xa8\xa6\xa1\x96\x61\x55\x95\x11\x86\x69\xa2\x86\x69\x26\x25\x14\x66\x61\x45\x55\x55\x54\x55\x45\x65\x99\x99\x19"
b"\x55\x55\x55\x55\x55\x15\x14\x51\x55\x55\x51\x45\x91\x22\x28\x88\x66\x4a\xa2\x16\x96\x51\x26\x52\x28\x8a\x4a\x1a\x99\xa6\x99\x49\x69\x59\x94\x99\x99\x86\xaa\x95\x56\x49\x56\x5a\x46\x46\x55\x58\x56\x19\x91\x66\x64"
b"\x55\x14\x54\x54\x55\x55\x55\x55\x54\x54\x55\x55\x48\xa9\x99\xa6\x86\x66\x64\xa5\x19\x96\x61\x99\x96\x16\xa9\xa9\x24\x18\x94\x58\x58\x66\x49\xa2\x21\x9a\x61\x86\x62\x86\x48\x65\x55\x94\x51\x45\x99\x61\x96\x61\x99"
b"\x51\x55\x55\x55\x51\x51\x55\x15\x15\x55\x55\x22\x99\x92\x86\x88\x59\x91\x89\x59\x99\x66\x55\x99\x55\x65\x5a\x62\x69\x68\x19\x9a\x56\x21\x9a\x4a\x69\x8a\x26\xa4\x58\x51\x96\x46\x24\x66\x15\x95\x51\x96\x46\x66\x16"
b"\x55\x55\x45\x45\x55\x55\x45\x55\x55\x45\x94\xa4\xa6\xa6\x69\x99\xa6\x66\x58\x64\x61\x14\x61\x51\x19\x91\x14\x64\x92\x65\x95\x91\x85\x65\x91\xa4\x92\x19\xa9\x25\x66\xaa\x58\x66\x59\x61\xa6\x58\x65\xa9\x99\x29\x99"
b"\x55\x45\x55\x55\x15\x15\x55\x51\x51\x59\x8a\x8a\x48\x0a\x86\x62\x64\x52\x99\x56\x55\x65\x99\x25\x54\x46\x66\x62\x19\x91\x61\x99\x65\x92\x66\x8a\xa4\xa2\x62\x6a\x22\x14\x66\x61\x91\x9a\x61\x15\x98\x46\x66\x61\x65"
b"\x51\x55\x15\x15\x55\x54\x54\x55\x55\x22\x18\x66\xaa\x64\x64\xa6\x86\x65\x09\x85\x64\x59\x56\x56\x65\x59\x85\x19\x96\x46\x5a\x48\x69\x18\x89\x92\x2a\x1a\x26\x21\x64\x69\x59\x99\x64\x98\x98\x66\x46\x65\x18\x96\x45"
b"\x55\x51\x55\x55\x45\x45\x55\x55\x19\xa9\xaa\x8a\x1a\xaa\xa9\x61\x99\x1a\x58\x59\x16\x94\x85\x65\x45\x95\x56\x68\x99\x59\x84\x66\x89\x64\xa2\x2a\x11\xa1\x22\x64\x89\x84\x91\x86\x1a\x19\x92\x66\x61\x99\x26\x66\x56"
b"\x54\x55\x51\x51\x55\x55\x45\x45\x52\x12\x0a\xaa\xa9\x26\x46\x96\x9a\x65\x99\x96\x65\x25\x56\x44\x56\x45\x15\x56\x24\x64\x69\xa1\x92\x21\x84\x99\x22\x1a\x62\x09\x28\x5a\x65\x61\x99\x86\x69\x92\x19\x92\x69\x91\x65"
b"\x55\x55\x55\x55\x54\x55\x55\x55\x58\x2a\x86\x18\x62\x68\xa8\x69\x19\x14\x59\x91\x51\x66\x54\x59\x95\x55\x62\x65\x49\x92\x86\x1a\x62\x9a\x2a\x44\x86\x44\x99\xa6\x85\x92\x48\x86\x46\x66\x26\x26\x56\x26\x62\x16\x61"
b"\x45\x45\x15\x15\x15\x51\x51\x51\x55\x62\xa9\xa6\x66\x86\x66\x46\x91\x65\x92\x15\x96\x51\x45\x66\x61\x46\x56\x46\x06\x65\x99\xa4\xa6\x21\x84\x62\x64\x99\x82\x11\x18\x64\x96\x28\x61\x18\x62\x49\x9a\x62\x59\x65\x92"
b"\x55\x55\x55\x55\x55\x55\x55\x55\x45\x59\x18\xa8\x98\x99\x91\xa4\x56\x66\x55\x66\x59\x25\x59\x14\x55\x55\x15\x41\x09\x18\x88\x9a\x18\x62\x49\x91\x80\x64\x55\x99\x92\x44\x46\x14\x98\x86\x66\x08\x62\x20\x91\x58\x65"
b"\x54\x55\x51\x51\x51\x45\x15\x15\x56\x2a\xaa\x66\x69\x99\x19\x65\x99\x14\x61\x94\x46\x56\x59\x99\x64\x65\x64\x49\x22\x19\x92\x49\x86\x86\x61\x99\x18\x46\x49\x11\x12\x5a\x21\x22\x05\x20\x48\x61\x99\x24\x96\x46\xa6"
b"\x55\x51\x55\x55\x55\x55\x55\x54\x59\x86\x26\x86\x19\x99\x66\x59\x45\x99\x55\x55\x55\x64\x51\x55\x45\x51\x55\x89\x89\x98\x8a\x62\x61\x61\x56\x46\x46\x48\x21\x20\x64\x84\x48\x84\x60\x92\x89\x96\x22\xa8\x65\x9a\x59"
b"\x55\x55\x45\x45\x15\x55\x51\x55\x50\xa2\x62\x69\xa4\x64\x55\x14\x59\x56\x59\x19\x91\x45\x55\x85\x96\x66\x46\x61\x8a\x66\x62\x21\x18\x86\x45\x44\x40\x81\x10\x46\x08\x12\x16\x10\x92\x08\x42\x26\x59\x99\x98\x64\x86"
b"\x45\x15\x55\x55\x54\x51\x55\x45\x65\x56\x16\x1a\x66\x46\xa1\x65\x99\x18\x65\x54\x56\x55\x98\x55\x15\x15\x55\x5a\x48\x91\x84\x62\x89\x18\x64\x84\x48\x52\x06\x10\x41\x10\x40\x1a\x41\x91\x28\x45\x22\x46\x46\x89\x99"
b"\x55\x54\x54\x55\x55\x55\x15\x55\x15\x15\x59\xa4\x89\x99\xa6\x66\x52\x65\x91\x45\x99\x59\x15\x59\x59\x51\x86\x12\x61\xa6\x6a\x66\x62\x86\x21\x06\x11\x05\x44\x48\x12\x11\x04\x84\x66\x10\x04\x98\x64\x64\xa8\x66\x22"
b"\x55\x45\x55\x51\x45\x45\x54\x55\x55\x59\xa6\x2a\x66\x66\x49\x91\x65\x99\x15\x96\x51\x45\x56\x44\x64\x56\x55\x65\x1a\x18\x96\x16\x16\x62\x86\x60\x06\x44\x61\x51\x04\x48\x61\x12\x11\x22\x28\x88\x99\x66\x19\xa2\x89"
b"\x51\x55\x45\x55\x55\x55\x55\x51\x51\x61\x22\x68\x68\x44\xa6\x24\x59\x25\x51\x65\x15\x96\x45\x56\x45\x65\x19\x99\x99\xa9\x85\x65\x92\x29\x28\x54\x80\x61\x14\x86\x11\x11\x00\x08\x42\x04\x04\x86\x44\x49\x91\x19\x9a"
b"\x55\x55\x55\x15\x51\x55\x15\x15\x99\x9a\x66\x86\x9a\xaa\x6a\x6a\x91\x91\x9a\x50\x59\x45\x98\x65\x66\x51\x64\x4a\x62\x84\x66\x46\x66\x5a\x85\x88\x66\x18\x88\x51\x18\x62\x12\x01\x24\x80\x82\x22\x12\x56\x1a\x99\x96"
b"\x55\x14\x55\x54\x55\x45\x55\x55\x48\x8a\x99\xa9\x86\x66\x24\x91\x19\x66\x64\x66\x64\x59\x55\x59\x15\x16\x59\xa8\xa6\x66\x58\x59\x19\x18\x5a\x66\x21\x86\x61\x22\x21\x20\x25\x52\x48\x48\x18\x65\xa1\xa1\x65\x19\x21"
b"\x51\x55\x51\x55\x54\x55\x45\x58\xa6\x64\x88\x62\x92\x49\xa9\xa6\x9a\x48\x66\x58\x55\x94\x51\x91\x69\xa6\x64\x86\x49\x99\x15\x91\x61\x95\x91\x12\x66\x68\x96\x61\x9a\x45\x12\x24\x21\x91\x99\x92\x46\x16\x66\x51\x98"
b"\x55\x55\x55\x45\x45\x56\x55\x16\x46\x8a\x66\x99\xa6\xa2\x64\x99\x24\x55\x91\x45\x99\x65\x65\x56\x92\x61\x29\xa6\x99\x11\x99\x1a\x56\x46\x65\x96\x18\x65\x92\x18\x91\x99\x88\x61\x99\x19\x24\x66\xa9\x98\x45\x96\x65"
b"\x55\x45\x15\x55\x55\x54\x55\x8a\xa8\x66\x9a\xa8\xa8\x66\x89\x9a\x56\x69\x15\x96\x51\x51\x51\x98\x6a\x1a\x92\x64\x51\x66\x46\x54\x65\x64\x46\x59\x65\x91\x89\xa1\x98\x48\x9a\x9a\x61\xa2\x26\x88\x42\x19\x11\x86\x18"
b"\x51\x55\x54\x54\x55\x95\x51\x98\x66\x99\x91\x86\x9a\xa9\x99\x91\x99\x56\x55\x65\x15\x96\x66\x44\xa6\x28\xa6\x15\x9a\x64\x55\x19\x51\x26\x64\x45\x11\x9a\x19\x19\x15\x98\x86\x24\xa6\x19\x91\x99\x99\x65\x99\x59\x86"
b"\x55\x54\x55\x55\x51\x45\x68\xaa\x29\x99\x2a\xa8\xa1\x91\x94\x65\x46\x19\x64\x55\x59\x46\x5a\xaa\x22\x99\x99\x86\x64\x95\x99\x66\x16\x19\x98\x64\x19\x21\x89\x66\x66\x59\x66\x61\x85\x65\x99\x19\x19\x99\x96\x66\x59"
b"\x54\x55\x55\x15\x95\x55\x06\x26\x64\x64\x92\x19\x99\x26\x45\x96\x59\x54\x55\x86\x54\x69\x24\x66\x66\x8a\x24\x59\x1a\x46\x51\x91\x65\x92\x26\x59\x66\x66\x99\x94\x51\x46\x46\x16\x59\x92\x46\x61\x91\x84\x61\x91\x96"
b"\x55\x51\x51\x54\x55\x51\x55\x62\x85\x59\xaa\xaa\x9a\x66\x59\x64\x65\x91\x64\x55\x19\xa6\x9a\x88\xa8\x65\x99\x99\x64\x55\x16\x46\x2a\x29\x55\x16\x59\x28\xa4\x45\x56\x54\x59\x66\x64\xa6\x99\x55\x66\x66\x65\x19\x46"
b"\x45\x55\x55\x55\x51\x55\x59\x24\x59\x98\x88\x61\x26\x64\x66\x45\x94\x56\x45\x66\x58\x92\x8a\x2a\x86\x9a\x66\x46\x45\x66\x69\x26\x51\xa6\x45\x59\x22\xa9\x86\x56\x19\x25\x51\x59\x29\x98\x68\x99\x14\x65\x19\x66\x69"
b"\x55\x15\x15\x45\x55\x15\x51\x85\x66\x26\x2a\x1a\x61\x86\x91\x59\x45\x99\x56\x59\x64\xaa\x26\x98\x69\xa4\x86\x65\x56\x61\x92\x66\xaa\x45\x55\x14\x66\x49\x99\x91\x59\x65\x96\x45\x52\x45\xa6\x65\x59\x51\x55\x94\x55"
b"\x55\x55\x54\x55\x15\x54\x54\x59\x61\x88\x66\x65\x9a\x69\x9a\x9a\x66\x51\x96\x45\x16\x66\x68\xaa\xa8\x66\xa4\x51\x99\x1a\x26\x64\x46\x55\x15\x68\x98\xa6\x19\x15\x91\x14\x59\x56\x55\x99\x86\x14\x56\x55\x64\x55\x51"
b"\x51\x51\x55\x55\x55\x45\x59\x9a\x1a\xaa\x19\x5a\x26\xa4\xa9\x28\x68\x55\x45\x59\xaa\x28\xaa\x61\x99\x89\x95\x95\x86\xaa\x19\x88\x99\x51\x51\x45\xaa\x89\xa4\x59\x59\x65\x45\x14\x65\x19\x59\xa6\x64\x59\x95\x45\x95"
b"\x55\x55\x45\x51\x51\x55\x55\x22\xaa\x19\x94\xa1\xa8\x8a\xa2\x9a\x95\x98\x66\x92\x49\xaa\x8a\xaa\x86\x99\x19\x66\x69\x18\x64\x66\x54\x55\x55\x9a\x46\x6a\x19\x54\x46\x51\x55\x65\x45\x51\x91\x86\x45\x51\x45\x59\x45"
b"\x55\x15\x55\x15\x55\x55\x15\x9a\x21\xa5\x62\x6a\xaa\x6a\x69\xa1\x69\x86\x64\x66\xa6\x24\x9a\x19\xa9\x19\x91\x46\x1a\xa6\x66\x89\x15\x51\x59\x18\xaa\x26\xa4\x66\x99\x15\x64\x54\x55\x55\x16\x59\x96\x55\x56\x54\x55"
b"\x51\x54\x55\x55\x45\x45\x58\xa1\xa6\x54\x69\xa1\x86\xaa\x2a\x16\x44\x99\x9a\xa9\x2a\xaa\xa9\xa8\x62\x66\x56\x69\xa2\x61\x98\x95\x55\x15\x85\x66\x62\xa2\x45\x51\x91\x56\x45\x65\x59\x15\x66\x61\x25\x19\x14\x55\x55"
b"\x55\x55\x51\x54\x55\x55\x86\x8a\x15\x66\xa2\x2a\xaa\x26\x65\xaa\xa9\xaa\x86\x46\xa4\x8a\x18\x9a\x96\x61\x46\x86\x9a\x2a\x89\x99\x45\x55\x56\x48\xa6\x26\x9a\x65\x65\x64\x55\x46\x51\x55\x51\x56\x69\x65\x65\x65\x91"
b"\x55\x45\x55\x45\x54\x55\x68\x69\x59\x12\x1a\x9a\x4a\x62\x61\x98\x6a\x64\x69\x9a\x2a\x98\xaa\xa1\x99\x96\x59\xa8\xa9\x99\x26\x54\x56\x51\x45\x99\xa2\x86\x65\x14\x56\x45\x54\x55\x15\x51\x55\x19\x84\x51\x56\x44\x55"
b"\x51\x55\x15\x55\x55\x51\x2a\x15\x56\xaa\xaa\x28\xa6\x16\x6a\x8a\x92\x8a\x98\x66\x62\x8a\x86\x66\x61\xa5\xa2\x99\x8a\x62\x99\x45\x54\x55\x55\x1a\x66\x6a\x19\x59\x45\x55\x45\x91\x55\x55\x15\x99\x62\x96\x45\x55\x55"
b"\x55\x55\x54\x55\x95\x56\x89\x65\x12\x4a\x26\xa6\xa1\x66\x28\x99\xaa\x66\x66\xa2\x8a\x21\xaa\x19\x1a\x46\x1a\x2a\x66\x29\x94\x55\x45\x51\x91\x62\x1a\x86\x91\x95\x54\x59\x55\x55\x54\x55\x55\x44\x56\x64\x56\x46\x45"
b"\x54\x51\x55\x51\x45\x14\x65\x55\x68\xa9\x8a\x22\x56\x6a\x69\xa8\xa6\x28\xa9\x16\x54\xaa\x46\x66\xa6\x66\xaa\x64\xa2\x99\x45\x56\x55\x95\x55\x66\xa8\x6a\x65\x44\x65\x45\x19\x15\x95\x45\x51\x55\x99\x45\x95\x65\x55"
b"\x55\x55\x45\x55\x55\x54\x54\x51\x8a\xa8\xa2\x65\x95\xa2\x8a\x8a\x4a\x66\x61\xa9\x6a\x46\x99\xa1\x98\x68\x62\xaa\x69\xa4\x55\x45\x51\x51\x45\x91\xa6\xa8\x94\x55\x56\x56\x65\x59\x45\x55\x15\x55\x94\x66\x64\x51\x59"
b"\x45\x55\x55\x15\x51\x55\x55\x54\xa6\x8a\x9a\x59\x46\x1a\xa8\xaa\xa6\x9a\x99\x96\x92\xa4\x64\x9a\x49\xa6\xaa\x46\x22\x45\x59\x54\x55\x15\x55\x16\x8a\x89\x95\x66\x45\x15\x45\x51\x55\x51\x55\x91\x45\x99\x45\x95\x91"
b"\x55\x14\x55\x54\x55\x59\x45\x66\x8a\x98\x65\x15\x5a\xa8\x69\x98\x69\x21\x86\x46\x26\x66\x6a\x66\x9a\x8a\x22\xaa\xa5\x55\x94\x55\x59\x56\x51\x59\x9a\x9a\x46\x54\x55\x64\x55\x15\x51\x55\x54\x55\x56\x54\x69\x65\x15"
b"\x55\x55\x51\x55\x55\x14\x55\x12\x08\x89\x91\x54\x62\x8a\x8a\x86\xa2\x66\x56\x69\xa9\x9a\x1a\x29\x29\xa2\xa6\x48\x59\x99\x45\x65\x91\x64\x55\x96\x28\x62\x55\x15\x64\x65\x55\x55\x15\x45\x65\x55\x55\x19\xa2\x51\x55"
b"\x51\x55\x15\x45\x45\x55\x55\x52\x9a\x65\x55\x65\xa6\x9a\x98\x6a\x66\x99\x64\xa8\x98\x61\xa6\x5a\x64\x98\x82\x26\x64\x54\x55\x51\x55\x45\x66\x51\x5a\xa6\x65\x66\x55\x95\x64\x55\x55\x55\x15\x45\x15\x56\x59\x95\x59"
b"\x55\x45\x55\x55\x55\x55\x45\x4a\x21\x56\x56\x5a\x28\x88\xaa\xaa\x89\x56\x2a\x66\x66\x66\xa1\xa1\xa6\x6a\x0a\x69\x95\x45\x59\x15\x45\x55\x51\x56\x64\x89\x18\x51\x45\x45\x15\x51\x54\x55\x54\x55\x54\x64\x59\x19\x95"
b"\x55\x55\x54\x54\x54\x51\x55\x50\x55\x64\x51\x86\xa2\xa9\x86\x46\x56\x46\x66\x28\x66\x2a\x66\x9a\x46\x86\x66\x91\x45\x55\x95\x55\x56\x59\x15\x85\x99\x99\x55\x95\x55\x55\x55\x55\x45\x51\x55\x55\x45\x55\x65\x64\x51"
b"\x51\x51\x45\x55\x55\x55\x54\x55\x65\x45\x66\x68\xa6\x2a\xaa\xa4\x65\x58\xa2\x99\x92\x64\x69\x25\x99\x9a\xa1\xa6\x56\x64\x51\x51\x51\x45\x66\x59\x18\xa1\xa5\x59\x64\x54\x51\x45\x55\x55\x45\x51\x55\x51\x46\x45\x55"
b"\x55\x55\x55\x51\x45\x54\x55\x55\x54\x55\x92\x8a\x8a\x92\x44\x65\x54\x66\x9a\x66\x6a\xa9\x92\x64\x64\xa8\x9a\x19\x64\x55\x55\x55\x95\x96\x51\x66\x66\x66\x44\x51\x45\x55\x55\x55\x54\x55\x55\x15\x55\x15\x54\x59\x55"
b"\x54\x55\x55\x15\x55\x15\x51\x64\x55\x54\xaa\xa4\xa2\x29\xa5\x55\x45\x4a\xa9\x86\x26\x46\xa6\x66\x6a\x9a\x69\x94\x59\x46\x54\x59\x45\x64\x66\x46\x9a\x19\x55\x95\x55\x45\x55\x54\x55\x51\x55\x55\x45\x55\x65\x65\x19"
b"\x55\x51\x45\x55\x55\x55\x15\x55\x55\x66\x24\xaa\x26\x62\x59\x45\x55\xa9\x24\x99\xa8\x69\x19\x99\x86\x8a\x8a\x66\x64\x55\x15\x51\x56\x15\x96\x59\x21\xa4\x99\x54\x55\x55\x14\x55\x45\x55\x85\x54\x55\x54\x56\x51\x55"
b"\x45\x55\x55\x54\x51\x51\x55\x15\x14\x52\xaa\x88\x88\x95\x45\x55\x16\x2a\xa9\xaa\x45\x9a\x64\x61\xaa\x69\xa4\x99\x19\x65\x59\x95\x55\x66\x46\x4a\x66\x99\x54\x55\x51\x51\x55\x45\x55\x15\x55\x15\x55\x15\x51\x56\x64"
b"\x55\x15\x14\x55\x55\x55\x55\x55\x55\x4a\x28\x64\x95\x54\x55\x51\x59\xa4\x6a\x64\x66\xa4\x56\x5a\x92\x8a\x29\x91\x99\x51\x54\x54\x61\x91\x99\x99\xaa\x46\x45\x64\x55\x95\x55\x55\x55\x54\x55\x55\x51\x55\x55\x15\x45"
b"\x55\x55\x55\x51\x55\x15\x45\x45\x51\xaa\x62\xa1\x51\x65\x54\x55\x58\xaa\x92\x86\x69\x45\x99\xa1\xaa\x69\xa6\x66\x91\x95\x85\x55\x55\x66\x62\x64\xa4\x99\x59\x45\x55\x55\x45\x15\x14\x55\x51\x51\x55\x51\x45\x58\x56"
b"\x51\x51\x55\x15\x45\x54\x55\x55\x15\x22\x26\x16\x55\x55\x55\x55\x5a\x48\xa6\x66\x64\x65\x92\x9a\x24\xa8\xa9\x1a\x15\x55\x55\x86\x45\x46\x19\x8a\x69\x96\x56\x55\x91\x45\x55\x55\x55\x59\x55\x55\x45\x55\x55\x55\x65"
b"\x55\x55\x45\x55\x55\x55\x54\x55\x55\xa6\x89\x55\x54\x51\x45\x45\x92\x89\xa8\x66\x46\x59\xa6\x89\x9a\x86\x91\xa9\x66\x46\x59\x55\x56\x56\x6a\x59\x8a\x64\x64\x59\x55\x54\x55\x51\x55\x94\x54\x54\x55\x15\x55\x15\x51"
b"\x55\x15\x55\x54\x54\x51\x55\x51\x56\x02\x55\x95\x15\x55\x55\x55\x1a\x18\x66\x64\x65\x99\x29\x99\x4a\xaa\x9a\x61\x95\x54\x51\x91\x95\x54\x64\xaa\x99\x15\x55\x54\x54\x55\x51\x55\x45\x15\x55\x55\x55\x54\x51\x54\x55"
b"\x51\x54\x54\x55\x55\x55\x45\x55\x45\x45\x95\x45\x55\x54\x54\x55\x61\xaa\x86\x66\x66\x61\x98\x65\xa4\x98\x66\x99\x51\x45\x96\x65\x45\x15\x86\x61\x29\x65\x85\x85\x55\x55\x55\x15\x55\x55\x15\x15\x51\x55\x55\x55\x66"
b"\x55\x55\x55\x51\x51\x55\x55\x15\x55\x55\x45\x55\x51\x45\x55\x51\x6a\x98\x66\x46\x59\x1a\xa6\x54\x6a\xaa\x92\x19\x15\x99\x64\x54\x55\x55\x5a\x66\x92\x51\x55\x55\x45\x45\x15\x54\x55\x45\x55\x54\x55\x45\x55\x45\x55"
b"\x55\x45\x45\x55\x55\x45\x55\x54\x54\x55\x54\x54\x55\x55\x45\x55\x46\x26\x99\x99\x19\xa6\x15\x45\x52\x49\xa6\x65\x59\x99\x25\x45\x55\x45\x54\x86\x25\x95\x99\x15\x55\x55\x55\x45\x51\x55\x45\x45\x55\x55\x14\x55\x45"
b"\x51\x55\x55\x15\x15\x54\x51\x55\x55\x51\x55\x55\x55\x15\x55\x15\x9a\x98\x64\x65\x92\x61\x54\x55\x6a\xa8\x6a\x65\x94\x61\x99\x55\x51\x55\x19\x69\xa6\x59\x45\x54\x54\x59\x45\x55\x55\x54\x55\x55\x45\x51\x55\x54\x55"
)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 KiB

View File

@ -1,4 +1,6 @@
# Copyright © 2020 by Thorsten von Eicken.
# MicroPython driver for Inkplate 10
# Contributed by: https://github.com/tve
# Copyright © 2020 by Thorsten von Eicken
import time
import micropython
import framebuf
@ -814,9 +816,13 @@ class Inkplate:
def setRotation(self, x):
self.rotation = x % 4
if self.rotation == 0 or self.rotation == 2:
self.GFX.width = D_COLS
self.GFX.height = D_ROWS
self._width = D_COLS
self._height = D_ROWS
elif self.rotation == 1 or self.rotation == 3:
self.GFX.width = D_ROWS
self.GFX.height = D_COLS
self._width = D_ROWS
self._height = D_COLS

View File

@ -1,3 +1,6 @@
# MicroPython driver for Inkplate 2
# By Soldered Electronics
# Based on the original contribution by https://github.com/tve
import time
import os
from machine import ADC, I2C, SPI, Pin
@ -16,6 +19,7 @@ EPAPER_CLK = const(18)
EPAPER_DIN = const(23)
pixelMaskLUT = [0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80]
pixelMaskGLUT = [0xF, 0xF0]
# ePaper resolution
# For Inkplate2 height and width are swapped in relation to the default rotation
@ -211,9 +215,13 @@ class Inkplate:
def setRotation(self, x):
self.rotation = x % 4
if self.rotation == 0 or self.rotation == 2:
self.GFX.width = E_INK_WIDTH
self.GFX.height = E_INK_HEIGHT
self._width = E_INK_WIDTH
self._height = E_INK_HEIGHT
elif self.rotation == 1 or self.rotation == 3:
self.GFX.width = E_INK_HEIGHT
self.GFX.height = E_INK_WIDTH
self._width = E_INK_HEIGHT
self._height = E_INK_WIDTH
@ -370,3 +378,16 @@ class Inkplate:
if byte & 0x80:
self.writePixel(x + i, y + j, c)
self.endWrite()
@classmethod
def drawColorImage(self, x, y, w, h, buf):
scaled_w = int(-(-(w / 4.0) // 1))
for i in range(h):
for j in range(scaled_w):
self.writePixel(4 * j + x, i + y, (buf[scaled_w * i + j] & 0xC0) >> 6)
if 4 * j + x + 1 < w:
self.writePixel(4 * j + x + 1, i + y, (buf[scaled_w * i + j] & 0x30) >> 4)
if 4 * j + x + 2 < w:
self.writePixel(4 * j + x + 2, i + y, (buf[scaled_w * i + j] & 0x0C) >> 2)
if 4 * j + x + 3 < w:
self.writePixel(4 * j + x + 3, i + y, (buf[scaled_w * i + j] & 0x03))

577
inkplate4.py Normal file
View File

@ -0,0 +1,577 @@
# MicroPython driver for Inkplate 4
# By Soldered Electronics
# Based on the original contribution by https://github.com/tve
import time
import os
from machine import ADC, I2C, SPI, Pin
from micropython import const
from shapes import Shapes
from PCAL6416A import *
from gfx import GFX
from gfx_standard_font_01 import text_dict as std_font
# Connections between ESP32 and color Epaper
EPAPER_RST_PIN = const(19)
EPAPER_DC_PIN = const(33)
EPAPER_CS_PIN = const(27)
EPAPER_BUSY_PIN = const(32)
EPAPER_CLK = const(18)
EPAPER_DIN = const(23)
# ePaper resolution
E_INK_WIDTH = 400
E_INK_HEIGHT = 300
E_INK_NUM_PIXELS = E_INK_HEIGHT * E_INK_WIDTH
E_INK_BUFFER_SIZE = E_INK_NUM_PIXELS // 8
pixelMaskLUT = [0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80]
busy_timeout_ms = 30000
class Inkplate:
# Colors
WHITE = 0b00000000
BLACK = 0b00000001
RED = 0b00000010
_width = E_INK_WIDTH
_height = E_INK_HEIGHT
rotation = 0
textSize = 1
_panelState = False
_framebuf_BW = bytearray(([0xFF] * E_INK_BUFFER_SIZE))
_framebuf_RED = bytearray(([0x00] * E_INK_BUFFER_SIZE))
@classmethod
def begin(self):
self.wire = I2C(0, scl=Pin(22), sda=Pin(21))
self.spi = SPI(2)
# Init gpio expander
self._PCAL6416A = PCAL6416A(self.wire)
# Pin to init SD card
self.SD_ENABLE = gpioPin(self._PCAL6416A, 10, modeOUTPUT)
self.SD_ENABLE.digitalWrite(1) # Initially disable the SD card
# Set battery enable pin
self.VBAT_EN = gpioPin(self._PCAL6416A, 9, modeOUTPUT)
self.VBAT_EN.digitalWrite(1)
# Set battery read pin
self.VBAT = ADC(Pin(35))
self.VBAT.atten(ADC.ATTN_11DB)
self.VBAT.width(ADC.WIDTH_12BIT)
self.setRotation(0)
self.clearDisplay()
self.GFX = GFX(
E_INK_WIDTH,
E_INK_HEIGHT,
self.writePixel,
self.writeFastHLine,
self.writeFastVLine,
self.writeFillRect,
None,
None,
)
# Wake the panel and init it
if not (self.setPanelDeepSleepState(False)):
return False
# Put it back to sleep
self.setPanelDeepSleepState(True)
return True
@classmethod
def getPanelDeepSleepState(self):
return self._panelState
@classmethod
def setPanelDeepSleepState(self, state):
# False wakes the panel up
# True puts it to sleep
if not state:
self.spi.init(baudrate=4000000, firstbit=SPI.MSB,
polarity=0, phase=0)
self.EPAPER_BUSY_PIN = Pin(EPAPER_BUSY_PIN, Pin.IN)
self.EPAPER_RST_PIN = Pin(EPAPER_RST_PIN, Pin.OUT)
self.EPAPER_DC_PIN = Pin(EPAPER_DC_PIN, Pin.OUT)
self.EPAPER_CS_PIN = Pin(EPAPER_CS_PIN, Pin.OUT)
time.sleep_ms(10)
self.resetPanel()
# Reinit the panel
self.sendCommand(b"\x12")
_timeout = time.ticks_ms()
while self.EPAPER_BUSY_PIN.value() and (time.ticks_ms() - _timeout) < busy_timeout_ms:
pass
self.sendCommand(b"\x74")
self.sendData(b"\x54")
self.sendCommand(b"\x7E")
self.sendData(b"\x3B")
self.sendCommand(b"\x2B")
self.sendData(b"\x04")
self.sendData(b"\x63")
self.sendCommand(b"\x0C")
self.sendData(b"\x8B")
self.sendData(b"\x9C")
self.sendData(b"\x96")
self.sendData(b"\x0F")
self.sendCommand(b"\x01")
self.sendData(b"\x2B")
self.sendData(b"\x01")
self.sendData(b"\x00")
self.sendCommand(b"\x11")
self.sendData(b"\x01")
self.sendCommand(b"\x44")
self.sendData(b"\x00")
self.sendData(b"\x31")
self.sendCommand(b"\x45")
self.sendData(b"\x2B")
self.sendData(b"\x01")
self.sendData(b"\x00")
self.sendData(b"\x00")
self.sendCommand(b"\x3C")
self.sendData(b"\x01")
self.sendCommand(b"\x18")
self.sendData(b"\x80")
self.sendCommand(b"\x22")
self.sendData(b"\xB1")
self.sendCommand(b"\x20")
self._panelState = True
return True
else:
# Put the panel to sleep
self.sendCommand(b"\x50")
self.sendData(b"\xF7")
self.sendCommand(b"\x02")
time.sleep_ms(10)
# Wait for ePaper
_timeout = time.ticks_ms()
while self.EPAPER_BUSY_PIN.value() and (time.ticks_ms() - _timeout) < busy_timeout_ms:
pass
self.sendCommand(b"\x07")
self.sendData(b"\xA5")
time.sleep_ms(1)
# Turn off SPI
self.spi.deinit()
self.EPAPER_BUSY_PIN = Pin(EPAPER_BUSY_PIN, Pin.IN)
self.EPAPER_RST_PIN = Pin(EPAPER_RST_PIN, Pin.IN)
self.EPAPER_DC_PIN = Pin(EPAPER_DC_PIN, Pin.IN)
self.EPAPER_CS_PIN = Pin(EPAPER_CS_PIN, Pin.IN)
self._panelState = False
return False
@classmethod
def resetPanel(self):
self.EPAPER_RST_PIN.value(0)
time.sleep_ms(15)
self.EPAPER_RST_PIN.value(1)
time.sleep_ms(15)
@classmethod
def sendCommand(self, command):
self.EPAPER_DC_PIN.value(0)
self.EPAPER_CS_PIN.value(0)
self.spi.write(command)
self.EPAPER_CS_PIN.value(1)
@classmethod
def sendData(self, data):
self.EPAPER_CS_PIN.value(0)
self.EPAPER_DC_PIN.value(1)
self.spi.write(data)
self.EPAPER_CS_PIN.value(1)
time.sleep_ms(1)
@classmethod
def clearDisplay(self):
self._framebuf_BW = bytearray(([0xFF] * E_INK_BUFFER_SIZE))
self._framebuf_RED = bytearray(([0x00] * E_INK_BUFFER_SIZE))
@classmethod
def display(self):
# Wake the display
self.setPanelDeepSleepState(False)
time.sleep_ms(10)
# Write b/w pixels
self.sendCommand(b"\x24")
self.sendData(self._framebuf_BW)
time.sleep_ms(10)
# Write red pixels
self.sendCommand(b"\x26")
self.sendData(self._framebuf_RED)
time.sleep_ms(10)
# EPD update
self.sendCommand(b"\x22")
self.sendData(b"\xF7")
self.sendCommand(b"\x20")
time.sleep_ms(10)
_timeout = time.ticks_ms()
while self.EPAPER_BUSY_PIN.value() and (time.ticks_ms() - _timeout) < busy_timeout_ms:
pass
# Put the display back to sleep
self.setPanelDeepSleepState(True)
@classmethod
def width(self):
return self._width
@classmethod
def height(self):
return self._height
# Arduino compatibility functions
@classmethod
def setRotation(self, x):
self.rotation = x % 4
if self.rotation == 0 or self.rotation == 2:
self.GFX.width = E_INK_WIDTH
self.GFX.height = E_INK_HEIGHT
self._width = E_INK_WIDTH
self._height = E_INK_HEIGHT
elif self.rotation == 1 or self.rotation == 3:
self.GFX.width = E_INK_HEIGHT
self.GFX.height = E_INK_WIDTH
self._width = E_INK_HEIGHT
self._height = E_INK_WIDTH
@classmethod
def getRotation(self):
return self.rotation
@classmethod
def drawPixel(self, x, y, c):
self.startWrite()
self.writePixel(x, y, c)
self.endWrite()
@classmethod
def startWrite(self):
pass
@classmethod
def writePixel(self, x, y, c):
if x > self.width() - 1 or y > self.height() - 1 or x < 0 or y < 0:
return
if (c > 2):
return
# Fix for ePaper buffer
y += 1
if (y == 300):
y = 0
if self.rotation == 3:
x, y = y, x
y = self.width() - y - 1
x = self.height() - x - 1
elif self.rotation == 0:
x = self.width() - x - 1
elif self.rotation == 1:
x, y = y, x
elif self.rotation == 2:
y = self.height() - y - 1
pass
_x = x // 8
_x_sub = x % 8
_position = E_INK_WIDTH // 8 * y + _x
# Clear both black and red frame buffer
# Write the pixel to the according buffer
if (c < 2):
self._framebuf_BW[_position] |= (pixelMaskLUT[7 - _x_sub])
self._framebuf_BW[_position] &= ~(c << (7 - _x_sub))
self._framebuf_RED[_position] &= ~(pixelMaskLUT[7 - _x_sub])
else:
self._framebuf_RED[_position] |= (pixelMaskLUT[7 - _x_sub])
@classmethod
def writeFillRect(self, x, y, w, h, c):
for j in range(w):
for i in range(h):
self.writePixel(x + j, y + i, c)
@classmethod
def writeFastVLine(self, x, y, h, c):
for i in range(h):
self.writePixel(x, y + i, c)
@classmethod
def writeFastHLine(self, x, y, w, c):
for i in range(w):
self.writePixel(x + i, y, c)
@classmethod
def writeLine(self, x0, y0, x1, y1, c):
self.GFX.line(x0, y0, x1, y1, c)
@classmethod
def endWrite(self):
pass
@classmethod
def drawFastVLine(self, x, y, h, c):
self.startWrite()
self.writeFastVLine(x, y, h, c)
self.endWrite()
@classmethod
def drawFastHLine(self, x, y, w, c):
self.startWrite()
self.writeFastHLine(x, y, w, c)
self.endWrite()
@classmethod
def fillRect(self, x, y, w, h, c):
self.startWrite()
self.writeFillRect(x, y, w, h, c)
self.endWrite()
@classmethod
def fillScreen(self, c):
self.fillRect(0, 0, self.width(), self.height(), c)
@classmethod
def drawLine(self, x0, y0, x1, y1, c):
self.startWrite()
self.writeLine(x0, y0, x1, y1, c)
self.endWrite()
@classmethod
def drawRect(self, x, y, w, h, c):
self.GFX.rect(x, y, w, h, c)
@classmethod
def drawCircle(self, x, y, r, c):
self.GFX.circle(x, y, r, c)
@classmethod
def fillCircle(self, x, y, r, c):
self.GFX.fill_circle(x, y, r, c)
@classmethod
def drawTriangle(self, x0, y0, x1, y1, x2, y2, c):
self.GFX.triangle(x0, y0, x1, y1, x2, y2, c)
@classmethod
def fillTriangle(self, x0, y0, x1, y1, x2, y2, c):
self.GFX.fill_triangle(x0, y0, x1, y1, x2, y2, c)
@classmethod
def drawRoundRect(self, x, y, q, h, r, c):
self.GFX.round_rect(x, y, q, h, r, c)
@classmethod
def fillRoundRect(self, x, y, q, h, r, c):
self.GFX.fill_round_rect(x, y, q, h, r, c)
@classmethod
def setTextSize(self, s):
self.textSize = s
@classmethod
def setFont(self, f):
self.GFX.font = f
@classmethod
def printText(self, x, y, s, c=BLACK):
self.GFX._very_slow_text(x, y, s, self.textSize, c)
@classmethod
def drawBitmap(self, x, y, data, w, h, c=BLACK):
byteWidth = (w + 7) // 8
byte = 0
self.startWrite()
for j in range(h):
for i in range(w):
if i & 7:
byte <<= 1
else:
byte = data[j * byteWidth + i // 8]
if byte & 0x80:
self.writePixel(x + i, y + j, c)
self.endWrite()
@classmethod
def gpioExpanderPin(self, pin, mode):
return gpioPin(self._PCAL6416A, pin, mode)
@classmethod
def initSDCard(self):
self.SD_ENABLE.digitalWrite(0)
time.sleep_ms(10)
try:
os.mount(
SDCard(
slot=3,
miso=Pin(12),
mosi=Pin(13),
sck=Pin(14),
cs=Pin(15)),
"/sd"
)
except:
print("Sd card could not be read")
@classmethod
def SDCardSleep(self):
self.SD_ENABLE.digitalWrite(1)
time.sleep_ms(5)
@classmethod
def SDCardWake(self):
self.SD_ENABLE.digitalWrite(0)
time.sleep_ms(5)
@classmethod
def drawImageFile(self, x, y, path, invert=False):
with open(path, "rb") as f:
header14 = f.read(14)
if header14[0] != 0x42 or header14[1] != 0x4D:
return 0
header40 = f.read(40)
w = int(
(header40[7] << 24)
+ (header40[6] << 16)
+ (header40[5] << 8)
+ header40[4]
)
h = int(
(header40[11] << 24)
+ (header40[10] << 16)
+ (header40[9] << 8)
+ header40[8]
)
dataStart = int((header14[11] << 8) + header14[10])
depth = int((header40[15] << 8) + header40[14])
totalColors = int((header40[33] << 8) + header40[32])
rowSize = 4 * ((depth * w + 31) // 32)
if totalColors == 0:
totalColors = 1 << depth
palette = None
if depth <= 8:
palette = [0 for i in range(totalColors)]
p = f.read(totalColors * 4)
for i in range(totalColors):
palette[i] = (
54 * p[i * 4] + 183 * p[i * 4 + 1] + 19 * p[i * 4 + 2]
) >> 14
# print(palette)
f.seek(dataStart)
for j in range(h):
# print(100 * j // h, "% complete")
buffer = f.read(rowSize)
for i in range(w):
val = 0
if depth == 1:
px = int(
invert
^ (palette[0] < palette[1])
^ bool(buffer[i >> 3] & (1 << (7 - i & 7)))
)
val = palette[px]
elif depth == 4:
px = (buffer[i >> 1] & (0x0F if i & 1 == 1 else 0xF0)) >> (
0 if i & 1 else 4
)
val = palette[px]
if invert:
val = 3 - val
elif depth == 8:
px = buffer[i]
val = palette[px]
if invert:
val = 3 - val
elif depth == 16:
px = (buffer[(i << 1) | 1] << 8) | buffer[(i << 1)]
r = (px & 0x7C00) >> 7
g = (px & 0x3E0) >> 2
b = (px & 0x1F) << 3
val = (54 * r + 183 * g + 19 * b) >> 14
if invert:
val = 3 - val
elif depth == 24:
r = buffer[i * 3]
g = buffer[i * 3 + 1]
b = buffer[i * 3 + 2]
val = (54 * r + 183 * g + 19 * b) >> 14
if invert:
val = 3 - val
elif depth == 32:
r = buffer[i * 4]
g = buffer[i * 4 + 1]
b = buffer[i * 4 + 2]
val = (54 * r + 183 * g + 19 * b) >> 14
if invert:
val = 3 - val
val >>= 1
self.drawPixel(x + i, y + h - j, val)
@classmethod
def read_battery(self):
self.VBAT_EN.digitalWrite(0)
# Probably don't need to delay since Micropython is slow, but we do it anyway
time.sleep_ms(5)
value = self.VBAT.read()
self.VBAT_EN.digitalWrite(1)
result = (value / 4095.0) * 1.1 * 3.548133892 * 2
return result

Some files were not shown because too many files have changed in this diff Show More