Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
7b7b239
changed from bpi to pi0
directive0 Nov 12, 2021
3a5f538
Merge remote-tracking branch 'origin/spacecat' into spacecat
directive0 Nov 12, 2021
db65868
cleanup
directive0 Nov 14, 2021
17c944e
button test
directive0 Nov 20, 2021
3cf8dea
more feedback
directive0 Nov 20, 2021
7b1080e
feedback
directive0 Nov 20, 2021
e41c200
feedback
directive0 Nov 20, 2021
01e99ec
pcf8575
directive0 Nov 20, 2021
71ff705
test stuff
directive0 Nov 20, 2021
94b0209
test
directive0 Nov 20, 2021
6bb6f62
pipe into eventlist
directive0 Nov 20, 2021
87418ca
sensors on.
directive0 Nov 20, 2021
9acfc88
address change
directive0 Nov 20, 2021
4e36b49
attemptying to unify codebases
directive0 Nov 20, 2021
0a7ee6b
Merge branch 'master' into spacecat
directive0 Feb 16, 2022
a741390
spacecat tests
directive0 Feb 19, 2022
ad2a2be
adding display "2" behaviours
directive0 Feb 20, 2022
0241993
tft24t changes to main lcars_clr
directive0 Feb 20, 2022
a641396
== not =
directive0 Feb 20, 2022
3905558
fix
directive0 Feb 21, 2022
6540a08
fix
directive0 Feb 21, 2022
ed27c50
test
directive0 Feb 21, 2022
28cd84d
fix
directive0 Feb 21, 2022
cf0335b
fix
directive0 Feb 21, 2022
342f818
fix
directive0 Feb 21, 2022
b81afe9
tests for various components.
directive0 Feb 25, 2022
a8d3e0c
video slide tests
directive0 Feb 25, 2022
40e5b95
fixes for video screen.
directive0 Feb 25, 2022
ddbb49b
fixes video
directive0 Feb 25, 2022
31c189c
video fixes
directive0 Feb 25, 2022
6067084
video fixes
directive0 Feb 25, 2022
9b5210d
display module groundwork
directive0 Mar 1, 2022
f0aff16
fixes
directive0 Mar 1, 2022
b55c80e
fixes
directive0 Mar 1, 2022
d33f80e
fixes
directive0 Mar 1, 2022
65f04ee
fixes
directive0 Mar 1, 2022
83d06e7
fixes
directive0 Mar 1, 2022
829ba4c
Merge branch 'spacecat' into dev
directive0 Mar 1, 2022
9811efb
fixes
directive0 Mar 1, 2022
4e98499
wifi band map
directive0 Mar 2, 2022
b4e205d
fix
directive0 Mar 2, 2022
d82d751
fix
directive0 Mar 2, 2022
7d6d544
fix attempt
directive0 Mar 2, 2022
0c139c0
fix attempt
directive0 Mar 2, 2022
8b2773a
fix
directive0 Mar 2, 2022
ca7b4f9
fix
directive0 Mar 2, 2022
902982d
fix
directive0 Mar 2, 2022
a326c4d
compromise
directive0 Mar 2, 2022
c114530
fix
directive0 Mar 2, 2022
ef23480
fix
directive0 Mar 2, 2022
990280c
test
directive0 Mar 2, 2022
fdbbc77
fix
directive0 Mar 2, 2022
ed99601
fix
directive0 Mar 2, 2022
c390c14
fix
directive0 Mar 2, 2022
164b559
fix
directive0 Mar 2, 2022
268554f
fix
directive0 Mar 2, 2022
7056c7e
added dots
directive0 Mar 3, 2022
6f92182
fix
directive0 Mar 3, 2022
c069beb
fix
directive0 Mar 3, 2022
4d4c813
wifi channel scan
directive0 Mar 3, 2022
161eb20
fix
directive0 Mar 3, 2022
42ad8d2
fixes
directive0 Mar 3, 2022
2ea9338
fixes
directive0 Mar 3, 2022
ef4552d
fixes
directive0 Mar 3, 2022
254a173
burger full background fix
directive0 Mar 3, 2022
6a0d72d
pillow test
directive0 Mar 3, 2022
4366883
test2
directive0 Mar 3, 2022
00cfd55
tweaks to layout
directive0 Mar 3, 2022
2d94208
ui tweaks
directive0 Mar 3, 2022
8b3de3c
ui tweak
directive0 Mar 3, 2022
bd403ea
ui tweaks
directive0 Mar 3, 2022
e2b2d13
ui tweaks
directive0 Mar 3, 2022
14a75e3
ui tweaks
directive0 Mar 3, 2022
03ffc4c
ui tweak
directive0 Mar 3, 2022
82da9e2
layout tweaks
directive0 Mar 3, 2022
b388883
ui tweak
directive0 Mar 3, 2022
911d9e5
ui tweaks
directive0 Mar 3, 2022
f0059a0
ui tweaks
directive0 Mar 3, 2022
3a87754
ui tweaks
directive0 Mar 3, 2022
3373c52
ui tweaks
directive0 Mar 3, 2022
4c2a13e
Added scaling settings for TR-108 mode_a graph screen to INI file con…
Mar 12, 2022
f65c57e
Provides video pygame player support (see https://github.com/ree1261/…
Mar 12, 2022
31de855
Aesthetic adjustment to mode_a graph screen height limits for TR-108
Mar 12, 2022
e7d4395
Added ffpyplayer=4.3.2 to requirements. The PyVidPlayer.py module ne…
Mar 13, 2022
9b225fe
Now plays Edith Keeler video on mode_c
Mar 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ sudo apt-get update

sudo apt-get upgrade

sudo apt install libsdl2-2.0-0 libsdl2-gfx-1.0-0 libsdl2-image-2.0-0 libsdl2-mixer-2.0-0 libsdl2-net-2.0-0 libsdl2-ttf-2.0-0

sudo apt-get install libatlas-base-dev libsdl2-dev libopenjp2-7-dev libtiff5 python3-pandas python3-psutil

pip3 install --upgrade colour luma.lcd luma.emulator adafruit-circuitpython-bme680 sense-hat adafruit-circuitpython-mpr121 pygame==2.0.0
Expand Down
Binary file modified assets/lcarsburgerframefull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/videobg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
127 changes: 60 additions & 67 deletions display.py
Original file line number Diff line number Diff line change
@@ -1,70 +1,63 @@

# -*- coding: utf-8 -*-
# Originally found: https://github.com/rm-hull/luma.examples/blob/master/examples/demo_opts.py
# Modified for PicorderOS
# Copyright (c) 2014-18 Richard Hull and contributors
# See LICENSE.rst for details.

print("Unified Display Module loading")
import sys
import logging

from luma.core import cmdline, error


# logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)-15s - %(message)s'
)
# ignore PIL debug messages
logging.getLogger('PIL').setLevel(logging.ERROR)


def display_settings(device, args):
"""
Display a short summary of the settings.
:rtype: str
"""
iface = ''
display_types = cmdline.get_display_types()
if args.display not in display_types['emulator']:
iface = 'Interface: {}\n'.format(args.interface)

lib_name = cmdline.get_library_for_display_type(args.display)
if lib_name is not None:
lib_version = cmdline.get_library_version(lib_name)
else:
lib_name = lib_version = 'unknown'

import luma.core
version = 'luma.{} {} (luma.core {})'.format(
lib_name, lib_version, luma.core.__version__)

return 'Version: {}\nDisplay: {}\n{}Dimensions: {} x {}\n{}'.format(
version, args.display, iface, device.width, device.height, '-' * 60)


def get_device(actual_args=None):
"""
Create device from command-line arguments and return it.
"""
if actual_args is None:
actual_args = sys.argv[1:]
parser = cmdline.create_parser(description='luma.examples arguments')
args = parser.parse_args(actual_args)

if args.config:
# load config from file
config = cmdline.load_config(args.config)
args = parser.parse_args(config + actual_args)

# create device
try:
device = cmdline.create_device(args)
print(display_settings(device, args))
return device

except error.Error as e:
parser.error(e)
return None
from objects import *

if configure.display == 1:
from luma.core.interface.serial import spi
from luma.core.render import canvas
from luma.lcd.device import st7735
from luma.emulator.device import pygame

# Raspberry Pi hardware SPI config:
DC = 23
RST = 24
SPI_PORT = 0
SPI_DEVICE = 0

if not configure.pc:
serial = spi(port = SPI_PORT, device = SPI_DEVICE, gpio_DC = DC, gpio_RST = RST)
device = st7735(serial, width = 160, height = 128, mode = "RGB")
else:
device = pygame(width = 160, height = 128)

# for TFT24T screens
elif configure.display == 2:
# Details pulled from https://github.com/BehindTheSciences/ili9341_SPI_TouchScreen_LCD_Raspberry-Pi/blob/master/BTS-ili9341-touch-calibration.py
from lib_tft24T import TFT24T
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
import spidev
DC = 24
RST = 25
LED = 15
PEN = 26
device = TFT24T(spidev.SpiDev(), GPIO)
# Initialize display and touch.
TFT.initLCD(DC, RST, LED)

class GenericDisplay(object):

def __init__(self):

# lib_tft24 screens require us to create a drawing surface for the screen
# and add to it.
if configure.display == 2:
self.surface = device.draw()


# Display takes a PILlow based drawobject and pushes it to screen.
def display(self,frame):

# the following is only for screens that use Luma.LCD
if configure.display == 1:
device.display(frame)

# the following is only for TFT24T screens
elif configure.display == 2:
# Resize the image and rotate it so it's 240x320 pixels.
frame = frame.rotate(90,0,1).resize((240, 320))
# Draw the image on the display hardware.
self.surface.pasteimage(frame,(0,0))
device.display()
20 changes: 13 additions & 7 deletions input.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@

if configure.input_pcf8575:
from pcf8575 import PCF8575
i2c_port_num = 0
i2c_port_num = 1
pcf_address = 0x20
pcf = PCF8575(i2c_port_num, pcf_address)

button_table = [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,0,3,2,4]

# the input class receives and relays control events for user interaction
class Inputs(object):
Expand Down Expand Up @@ -190,7 +191,7 @@ def read(self):
# if the alert pin is brought LOW
if GPIO.input(configure.ALERTPIN) == 0 and configure.eventready[0] == False:

print("touch received")
#print("touch received")

# collect the event list from the chip
reading = cap1208.get_input_status()
Expand Down Expand Up @@ -401,24 +402,29 @@ def read(self):
if configure.input_pcf8575:

if not configure.eventready[0]:
print("button state = ", pcf.port)
for this, button in enumerate(pcf.port):
this_frame = list(pcf.port)

for this, button in enumerate(this_frame):

# if an item is pressed
if not button:

#if it wasn't pressed last time
if not self.pressed[this]:

# mark it in the pressed list
print("pad press registered")
self.pressed[this] = True
print("pad press registered at ", this)
print("raising an event at address ", button_table[this])

self.pressed[button_table[this]] = True
configure.eventready[0] = True
configure.beep_ready[0] = True
else:
self.pressed[this] = False
self.pressed[button_table[this]] = False

configure.eventlist[0] = self.pressed


def keypress(self):
pygame.event.get()
#pygame.time.wait(50)
Expand Down
Loading