Looks convincing to me....Code:
david@rp5book101064ssk:~ $ python3Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import RPi.GPIO as GPIO>>> GPIO.setmode(GPIO.BCM)>>> GPIO.setup(17,GPIO.out)Traceback (most recent call last): File "<stdin>", line 1, in <module>AttributeError: module 'RPi.GPIO' has no attribute 'out'. Did you mean: 'OUT'?>>> GPIO.setup(17,GPIO.OUT)>>> GPIO.output(17,GPIO.HIGH)>>> GPIO.output(17,GPIO.LOW)>>> GPIO.RPI_INFO{'P1_REVISION': 3, 'REVISION': 'd04170', 'TYPE': 'Pi 5 Model B', 'MANUFACTURER': 'Sony UK', 'PROCESSOR': 'BCM2712', 'RAM': '8GB'}>>> GPIO.VERSION'0.7.2'>>>
Environment is an RPi5-8G running 64-bit RasPiOS Bookworm
Great answer. Besides this, here's how my platform-insensitive code change:
Code:
import redef detectModel() -> str: with open('/proc/device-tree/model') as f: model = f.read() return modelrex = re.compile('^Raspberry Pi [5-9] ')if rex.match(detectModel()): print("Running on Pi 5+") import RPi.GPIO as GPIO[
Statistics: Posted by delovelady — Mon Jun 24, 2024 3:22 am