GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update of Raspberry Pi GPIO App · LeoJr2015/python@2350688

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • GPIO_GUI
    • gpio.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎GPIO_GUI/gpio.py‎

Copy file name to clipboardExpand all lines: GPIO_GUI/gpio.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ def __init__(self,parent,pin=0,name=None,**kw):
100100
self.led.grid(column=3,row=0)
101101

102102
self.set_state.config(state=DISABLED)
103-
self.updateCurrentFunction()
103+
function = self.updateCurrentFunction()
104+
if function not in ['Input','Output']:
105+
self.mode_sel['state'] = DISABLED
104106

105107
## def _configurePin(self, y):
106108
## """Future capability to setup pull up/down"""
@@ -128,11 +130,11 @@ def setMode(self):
128130
def getPinFunctionName(self,pin):
129131
functions = {pi.IN:'Input',
130132
pi.OUT:'Output',
133+
pi.I2C:'I2C',
131134
pi.SPI:'SPI',
132135
pi.HARD_PWM:'HARD_PWM',
133136
pi.SERIAL:'Serial',
134-
pi.UNKNOWN:'Unknown'}
135-
137+
pi.UNKNOWN:'Unknown'}
136138
return functions[pi.gpio_function(pin)]
137139

138140

@@ -176,6 +178,7 @@ def updateInput(self):
176178
def updateCurrentFunction(self):
177179
pinFunction = self.getPinFunctionName(self.pin)
178180
self.current_mode.set(pinFunction)
181+
return pinFunction
179182
##print("GPIO %s is an %s" % (self.pin,pinFunction))
180183

181184

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.