Network Connected RGB Matrix Clock

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
ishankum
 
Posts: 24
Joined: Tue Dec 21, 2021 10:46 am

Network Connected RGB Matrix Clock

Post by ishankum »

I have just built the "Network Connected RGB Matrix Clock"- By John Park. Using matrix portal m4 ( from adafruit) and adafruit 64x32 RGB LED Matrix - 4mm pitch (from mouser). I am not getting anything on the display. This is my first project with circuit python. Appreciate any help. thanks

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Network Connected RGB Matrix Clock

Post by dastels »

More context would help. Photos of the setup/wiring/connections. The code you are using. REPL output when it runs. Etc. Simply saying "It didn't work" doesn't give us much to work from.

Dave

User avatar
ishankum
 
Posts: 24
Joined: Tue Dec 21, 2021 10:46 am

Re: Network Connected RGB Matrix Clock

Post by ishankum »

Hello Dave
Have attached my files and a picture.
[attachment=0]rbg clock.rar[/attachment
Attachments
rbg clock.rar
Files for the clock project
(7.44 KiB) Downloaded 38 times

User avatar
ishankum
 
Posts: 24
Joined: Tue Dec 21, 2021 10:46 am

Re: Network Connected RGB Matrix Clock

Post by ishankum »

rbg clock.txt
(126.44 KiB) Downloaded 44 times
one more file from the project

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Network Connected RGB Matrix Clock

Post by dastels »

What is it with RARs today (or really any day since 2000)? Can you just paste the test/image rather than expecting us to click a suspicious looking link?

Dave

User avatar
ishankum
 
Posts: 24
Joined: Tue Dec 21, 2021 10:46 am

Re: Network Connected RGB Matrix Clock

Post by ishankum »

code.py
(5.93 KiB) Downloaded 37 times
IMG_20211221_154428_556.jpg
IMG_20211221_154428_556.jpg (144.37 KiB) Viewed 1152 times

User avatar
ishankum
 
Posts: 24
Joined: Tue Dec 21, 2021 10:46 am

Re: Network Connected RGB Matrix Clock

Post by ishankum »

Screenshot (3).png
Screenshot (3).png (176.28 KiB) Viewed 1151 times

User avatar
ishankum
 
Posts: 24
Joined: Tue Dec 21, 2021 10:46 am

Re: Network Connected RGB Matrix Clock

Post by ishankum »

Screenshot (4).png
Screenshot (4).png (159.39 KiB) Viewed 1150 times

User avatar
ishankum
 
Posts: 24
Joined: Tue Dec 21, 2021 10:46 am

Re: Network Connected RGB Matrix Clock

Post by ishankum »

Screenshot (5).png
Screenshot (5).png (206.2 KiB) Viewed 1150 times

User avatar
ishankum
 
Posts: 24
Joined: Tue Dec 21, 2021 10:46 am

Re: Network Connected RGB Matrix Clock

Post by ishankum »

Screenshot (6).png
Screenshot (6).png (181.21 KiB) Viewed 1149 times

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Network Connected RGB Matrix Clock

Post by dastels »

You have a code.py and secrtets.py in CIRCUITPY/lib as well as CIRCUITPY/. I don't think that will cause a problem (well, code.py shouldn't) but it's unusual and probably a mistake.

Please paste code as text, not a screenshot.

What do you see in the REPL when you run the code?

Dave

User avatar
ishankum
 
Posts: 24
Joined: Tue Dec 21, 2021 10:46 am

Re: Network Connected RGB Matrix Clock

Post by ishankum »

Code: Select all

# Metro Matrix Clock
# Runs on Airlift Metro M4 with 64x32 RGB Matrix display & shield

import time import board import displayio import terminalio
from adafruit_display_text.label import Label
from adafruit_bitmap_font import bitmap_font
from adafruit_matrixportal.network import Network
from adafruit_matrixportal.matrix import Matrix

BLINK = True DEBUG = False

# Get wifi details and more from a secrets.py file
try:
from secrets import secrets
except ImportError :
print("WiFi secrets are kept in secrets.py, please add them there!" )
raise
print("	Metro Minimal Clock" )
print("Time will be set for {}" .format(secrets["timezone"]))

# --- Display setup --- matrix = Matrix() display = matrix.display
network = Network(status_neopixel =board.NEOPIXEL, debug=False) # --- Drawing setup ---

group = displayio.Group() # Create a Group
bitmap = displayio.Bitmap(64, 32, 2) # Create a bitmap object,width, height, bit depth
color = displayio.Palette(4) # Create a color palette color[0] = 0x000000 # black background
color[1] = 0xFF0000 # red color[2] = 0xCC4000 # amber color[3] = 0x85FF00 # greenish

# Create a TileGrid using the Bitmap and Palette
tile_grid = displayio.TileGrid(bitmap, pixel_shader =color) group.append(tile_grid) # Add the TileGrid to the Group display.show(group)

if not DEBUG:
font = bitmap_font .load_font("/IBMPlexMono-Medium-24_jep.bdf" )
else:
font = terminalio.FONT clock_label = Label(font)

def update_time (*, hours=None, minutes=None, show_colon =False): now = time.localtime() # Get the time values we need
if hours is None: hours = now[3]
if hours >= 18 or hours < 6: # evening hours to morning clock_label .color = color[1]
else:
clock_label .color = color[3] # daylight hours
if hours > 12: # Handle times later than 12:59 hours -= 12
elif not hours: # Handle times between 0:00 and 0:59 hours = 12

if minutes is None: minutes = now[4]

if BLINK:
colon = ":" if show_colon or now[5] % 2 else " "
else:
colon = ":"

clock_label .text = "{hours}{colon}{minutes:02d}" .format( hours=hours, minutes=minutes, colon=colon
)
bbx, bby, bbwidth, bbh = clock_label .bounding_box # Center the label
clock_label .x = round(display.width / 2 - bbwidth / 2) clock_label .y = display.height // 2
if DEBUG:
print("Label bounding box: {},{},{},{}" .format(bbx, bby, bbwidth, bbh))
print("Label x: {} y: {}" .format(clock_label .x, clock_label .y))


last_check = None
update_time (show_colon =True) # Display whatever time is on the board group.append(clock_label ) # add the clock label to the group

while True:
if last_check is None or time.monotonic() > last_check + 3600:
try:
update_time (
show_colon =True
) # Make sure a colon is displayed while updating network.get_local_time () # Synchronize Board's clock to Internet last_check = time.monotonic()
except RuntimeError as e:
print("Some error occured, retrying! -" , e)

User avatar
ishankum
 
Posts: 24
Joined: Tue Dec 21, 2021 10:46 am

Re: Network Connected RGB Matrix Clock

Post by ishankum »

output on repl
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.

User avatar
ishankum
 
Posts: 24
Joined: Tue Dec 21, 2021 10:46 am

Re: Network Connected RGB Matrix Clock

Post by ishankum »

have removed code.py and secrets.py from the lib folder

User avatar
dastels
 
Posts: 15653
Joined: Tue Oct 20, 2015 3:22 pm

Re: Network Connected RGB Matrix Clock

Post by dastels »

The indentation of your code got lost somehow.. and there's weird whitespace issues. Can you try again and make sure it looks exactly like what's in CIRCUITPY/code.py.

You can use the

Code: Select all

 tags to surround it.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Clock Kits (discontinued)”