Python RPi.GPIO.VERSION Examples
The following are 13
code examples of RPi.GPIO.VERSION().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
RPi.GPIO
, or try the search function
.
Example #1
Source File: radio4.py From piradio with GNU General Public License v3.0 | 6 votes |
def displayInfo(lcd,ipaddr,mpd_version): ver = "version " if lcd.getWidth() < 20: ver = "ver " if len(ipaddr) < 1: ipmsg = "No IP network" else: ipmsg = "IP "+ ipaddr radioVersion = "Radio " + ver + radio.getVersion() mpdVersion = "MPD " + ver + mpd_version gpioVersion = "GPIO " + ver + GPIO.VERSION lcd.line2(radioVersion) lcd.line3(mpdVersion) lcd.line4(gpioVersion) lcd.scroll1(ipmsg, interrupt) return # Check Timer fired
Example #2
Source File: rradio4.py From piradio with GNU General Public License v3.0 | 6 votes |
def displayInfo(lcd,ipaddr,mpd_version): ver = "version " if lcd.getWidth() < 20: ver = "ver " if len(ipaddr) < 1: ipmsg = "No IP network" else: ipmsg = "IP "+ ipaddr radioVersion = "Radio " + ver + radio.getVersion() mpdVersion = "MPD " + ver + mpd_version gpioVersion = "GPIO " + ver + GPIO.VERSION lcd.line2(radioVersion) lcd.line3(mpdVersion) lcd.line4(gpioVersion) lcd.scroll1(ipmsg, interrupt) return # Check Timer fired
Example #3
Source File: rradiobp4.py From piradio with GNU General Public License v3.0 | 6 votes |
def displayInfo(lcd,ipaddr,mpd_version): ver = "version " if lcd.getWidth() < 20: ver = "ver " if len(ipaddr) < 1: ipmsg = "No IP network" else: ipmsg = "IP "+ ipaddr radioVersion = "Radio " + ver + radio.getVersion() mpdVersion = "MPD " + ver + mpd_version gpioVersion = "GPIO " + ver + GPIO.VERSION lcd.line2(radioVersion) lcd.line3(mpdVersion) lcd.line4(gpioVersion) lcd.scroll1(ipmsg,interrupt) return # Check Timer fired
Example #4
Source File: index.py From rpiapi with MIT License | 6 votes |
def index(environ, response): modes = { -1: "MODE_UNKNOWN", 10: "BOARD", 11: "BCM", 40: "SERIAL", 41: "SPI", 42: "I2C", 43: "PWM" } status = "200 OK" header = [("Content-Type", "application/json")] result = { "GPIO.RPI_INFO": GPIO.RPI_INFO, "GPIO.VERSION": GPIO.VERSION, "MODE": modes[ GPIO.getmode() ] } response(status, header) return [json.dumps(result).encode()]
Example #5
Source File: RFExplorer.py From RFExplorer-for-Python with GNU Lesser General Public License v3.0 | 6 votes |
def ResetIOT_HW(cls, bMode): """Set Raspberry pi GPIO pins and reset RF Explorer device Parameters: bMode -- True if the baudrate is set to 500000bps, False to 2400bps """ try: import RPi.GPIO as GPIO #print("RPi info: " + str(GPIO.RPI_INFO)) #information about your RPi: #print("RPi.GPio version: " + GPIO.VERSION) #version of RPi.GPIO: GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) #refer to the pin numbers on the P1 header of the Raspberry Pi board GPIO.setup(12, GPIO.OUT) #set /reset (pin 12) to output GPIO.output(12, False) #set /reset (pin 12) to LOW GPIO.setup(21, GPIO.OUT) #set GPIO2 (pin 21) to output GPIO.output(21, bMode) #set GPIO2 (pin 21) to HIGH (for 500Kbps) time.sleep(0.1) #wait 100ms GPIO.output(12, True) #set /reset to HIGH time.sleep(2.5) #wait 2.5sec GPIO.setup(21, GPIO.IN) #set GPIO2 to input GPIO.cleanup() #clean up GPIO channels except RuntimeError: print("Error importing RPi.GPIO! This is probably because you need superuser privileges. You can achieve this by using 'sudo' to run your script")
Example #6
Source File: radio4x40.py From piradio with GNU General Public License v3.0 | 5 votes |
def displayInfo(lcd,ipaddr,mpd_version): lcd.line2("Radio version " + radio.getVersion()) lcd.line3(mpd_version) lcd.line4("GPIO version " + GPIO.VERSION) if ipaddr is "": lcd.line3("No IP network") else: lcd.scroll1("IP "+ ipaddr,interrupt) return # Check Timer fired
Example #7
Source File: radio4x40.py From piradio with GNU General Public License v3.0 | 5 votes |
def displayInfo(lcd,ipaddr,mpd_version): lcd.line2("Radio version " + radio.getVersion()) lcd.line3(mpd_version) lcd.line4("GPIO version " + GPIO.VERSION) if ipaddr is "": lcd.line3("No IP network") else: lcd.scroll1("IP "+ ipaddr,interrupt) return # Check Timer fired
Example #8
Source File: __init__.py From Octoprint-Filament-Reloaded with GNU General Public License v3.0 | 5 votes |
def initialize(self): self._logger.info("Running RPi.GPIO version '{0}'".format(GPIO.VERSION)) if GPIO.VERSION < "0.6": # Need at least 0.6 for edge detection raise Exception("RPi.GPIO must be greater than 0.6") GPIO.setwarnings(False) # Disable GPIO warnings
Example #9
Source File: stm32control.py From arminarm with GNU General Public License v2.0 | 5 votes |
def setup(): print "GPIO version: " + str(GPIO.VERSION) print "Pi revision " + str(GPIO.RPI_REVISION)
Example #10
Source File: __init__.py From OctoPrint-LEDStripControl with Apache License 2.0 | 5 votes |
def on_after_startup(self): self._logger.debug(u"LEDStripControl Startup") if GPIO: self._logger.debug(u"RPi.GPIO version %s" % (GPIO.VERSION,))
Example #11
Source File: __init__.py From OctoPrint-PSUControl with GNU Affero General Public License v3.0 | 4 votes |
def _configure_gpio(self): if not self._hasGPIO: self._logger.error("RPi.GPIO is required.") return self._logger.info("Running RPi.GPIO version %s" % GPIO.VERSION) if GPIO.VERSION < "0.6": self._logger.error("RPi.GPIO version 0.6.0 or greater required.") GPIO.setwarnings(False) for pin in self._configuredGPIOPins: self._logger.debug("Cleaning up pin %s" % pin) try: GPIO.cleanup(self._gpio_get_pin(pin)) except (RuntimeError, ValueError) as e: self._logger.error(e) self._configuredGPIOPins = [] if GPIO.getmode() is None: if self.GPIOMode == 'BOARD': GPIO.setmode(GPIO.BOARD) elif self.GPIOMode == 'BCM': GPIO.setmode(GPIO.BCM) else: return if self.sensingMethod == 'GPIO': self._logger.info("Using GPIO sensing to determine PSU on/off state.") self._logger.info("Configuring GPIO for pin %s" % self.senseGPIOPin) if self.senseGPIOPinPUD == 'PULL_UP': pudsenseGPIOPin = GPIO.PUD_UP elif self.senseGPIOPinPUD == 'PULL_DOWN': pudsenseGPIOPin = GPIO.PUD_DOWN else: pudsenseGPIOPin = GPIO.PUD_OFF try: GPIO.setup(self._gpio_get_pin(self.senseGPIOPin), GPIO.IN, pull_up_down=pudsenseGPIOPin) self._configuredGPIOPins.append(self.senseGPIOPin) except (RuntimeError, ValueError) as e: self._logger.error(e) if self.switchingMethod == 'GPIO': self._logger.info("Using GPIO for On/Off") self._logger.info("Configuring GPIO for pin %s" % self.onoffGPIOPin) try: if not self.invertonoffGPIOPin: initial_pin_output=GPIO.LOW else: initial_pin_output=GPIO.HIGH GPIO.setup(self._gpio_get_pin(self.onoffGPIOPin), GPIO.OUT, initial=initial_pin_output) self._configuredGPIOPins.append(self.onoffGPIOPin) except (RuntimeError, ValueError) as e: self._logger.error(e)
Example #12
Source File: sample_board.py From raspberry-gpio-emulator with Apache License 2.0 | 4 votes |
def main(): import RPi.GPIO as GPIO import time try: print(GPIO.VERSION) print(GPIO.RPI_INFO) GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(12, GPIO.OUT) GPIO.setup(11, GPIO.OUT, initial=GPIO.HIGH) GPIO.setup(13, GPIO.IN) GPIO.setup(15, GPIO.OUT) GPIO.setup([16, 18], GPIO.OUT) GPIO.setup((8, 10), GPIO.OUT) GPIO.setup([21, 19], GPIO.IN) GPIO.setup(3, GPIO.IN) GPIO.cleanup(3) GPIO.setup([5, 7], GPIO.OUT) GPIO.cleanup([5, 7]) GPIO.setup([5, 7], GPIO.IN) GPIO.cleanup((5, 7)) while True: GPIO.output(12, GPIO.HIGH) GPIO.output(11, 0) GPIO.output(15, True) GPIO.output([16, 18], not GPIO.input(16)) GPIO.output((8, 10), [GPIO.HIGH, GPIO.LOW]) time.sleep(1) GPIO.output(12, GPIO.LOW) GPIO.output(11, 1) GPIO.output(15, False) GPIO.output((16, 18), not GPIO.input(16)) GPIO.output([8, 10], (GPIO.LOW, GPIO.HIGH)) time.sleep(1) finally: GPIO.cleanup()
Example #13
Source File: sample_bcm.py From raspberry-gpio-emulator with Apache License 2.0 | 4 votes |
def main(): import RPi.GPIO as GPIO import time try: print(GPIO.VERSION) print(GPIO.RPI_INFO) GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(18, GPIO.OUT) GPIO.setup(17, GPIO.OUT, initial=GPIO.HIGH) GPIO.setup(27, GPIO.IN) GPIO.setup(22, GPIO.OUT) GPIO.setup([23, 24], GPIO.OUT) GPIO.setup((14, 15), GPIO.OUT) GPIO.setup([9, 10], GPIO.IN) GPIO.setup(2, GPIO.IN) GPIO.cleanup(2) GPIO.setup([3, 4], GPIO.OUT) GPIO.cleanup([3, 4]) GPIO.setup([3, 4], GPIO.IN) GPIO.cleanup((3, 4)) while True: GPIO.output(18, GPIO.HIGH) GPIO.output(17, 0) GPIO.output(22, True) GPIO.output([23, 24], not GPIO.input(23)) GPIO.output((14, 15), [GPIO.HIGH, GPIO.LOW]) time.sleep(1) GPIO.output(18, GPIO.LOW) GPIO.output(17, 1) GPIO.output(22, False) GPIO.output((23, 24), not GPIO.input(23)) GPIO.output([14, 15], (GPIO.LOW, GPIO.HIGH)) time.sleep(1) finally: GPIO.cleanup()