User Tools

Site Tools


inverted_led_display

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
inverted_led_display [2017/04/04 22:11] – created walkeradmininverted_led_display [2023/03/09 22:35] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Inverted LED Display ====== ====== Inverted LED Display ======
 +<color darkorange>Apr 2017</color>
 \\  \\ 
 \\  \\ 
  
 +----
 +==== I made a mistake ====
 +\\ 
 +When I designed the PCB for this project. I did what most people would do and I made the PCB the 'right way up' with 40 Way Raspberry pi header and the 7 Segment LED also the normal way up (so you can read it). Later on I realised this was a bit of a mistake, because this means the Raspberry Pi Zero Power and USB connections are now at the bottom, so you can't power this up and put it on a table :(.
 +\\ 
 +\\ 
 +Fear not though, with some help I have edited the code so that it writes the time upside-down, so if you rotate your Raspberry Pi 180° you can read the time correctly, and still put it on the table. Below is the adjusted code.
 +\\ 
 +\\ 
 +<color #ed1c24>Please NOTE: </color> You do <color #ed1c24>NOT</color> have to rotate the 7 Segment LED on the PCB, the code does this for you.
 +\\ 
 +\\ 
 +{{:ntp_normal.jpg?300|}}    {{:ntp_inverted.jpg?300|}}
 +\\ 
 +\\ 
 +Above we can see the Clock working in 'Normal' mode on the left, and in 'Inverted' mode on the right.
 +\\ 
 +\\ 
  
 +---- 
 +==== The Python Code ==== 
 +\\ 
 <sxh [py][; options for SyntaxHighlighter]> <sxh [py][; options for SyntaxHighlighter]>
 #! /usr/bin/python #! /usr/bin/python
Line 24: Line 45:
                      
 # Define GPIO ports for the digits 0-3 # Define GPIO ports for the digits 0-3
-gpioDigits = (18,23,24,25) 
 gpioDigits = (25,24,23,18) gpioDigits = (25,24,23,18)
 # Pins (12,9,8,6) select digits 0-3 respectively reading LTR on display # Pins (12,9,8,6) select digits 0-3 respectively reading LTR on display
inverted_led_display.1491340281.txt.gz · Last modified: 2023/03/09 22:35 (external edit)