ok also ich versuche gerade ein mcp23017 zu nutzen ich habe ihn so wie hier angeschlossen (https://www.raspberrypi-spy.co.uk/2013/07/how-to…erry-pi-part-1/)
und das ist mein code:
Python
import time
import board
import busio
import digitalio
from adafruit_mcp230xx.mcp23017 import MCP23017
i2c = busio.I2C(board.SCL, board.SDA)
mcp = MCP23017(i2c) # MCP23017
pin1 = mcp.get_pin(6)
pin1.value = True
Alles anzeigen
und das der error code
Code
Traceback (most recent call last):
File "/home/chess/.local/lib/python3.9/site-packages/adafruit_bus_device/i2c_device.py", line 176, in __probe_for_device
self.i2c.writeto(self.device_address, b"")
File "/home/chess/.local/lib/python3.9/site-packages/busio.py", line 175, in writeto
return self._i2c.writeto(address, buffer, stop=stop)
File "/home/chess/.local/lib/python3.9/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 52, in writeto
self._i2c_bus.write_bytes(address, buffer[start:end])
File "/home/chess/.local/lib/python3.9/site-packages/Adafruit_PureIO/smbus.py", line 314, in write_bytes
self._device.write(buf)
OSError: [Errno 121] Remote I/O error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/chess/.local/lib/python3.9/site-packages/adafruit_bus_device/i2c_device.py", line 182, in __probe_for_device
self.i2c.readfrom_into(self.device_address, result)
File "/home/chess/.local/lib/python3.9/site-packages/busio.py", line 165, in readfrom_into
return self._i2c.readfrom_into(address, buffer, stop=stop)
File "/home/chess/.local/lib/python3.9/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 59, in readfrom_into
readin = self._i2c_bus.read_bytes(address, end - start)
File "/home/chess/.local/lib/python3.9/site-packages/Adafruit_PureIO/smbus.py", line 181, in read_bytes
return self._device.read(number)
OSError: [Errno 121] Remote I/O error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/chess/Desktop/vs/test/mcp-test.py", line 10, in <module>
mcp = MCP23017(i2c) # MCP23017
File "/home/chess/.local/lib/python3.9/site-packages/adafruit_mcp230xx/mcp23017.py", line 57, in __init__
super().__init__(i2c, address)
File "/home/chess/.local/lib/python3.9/site-packages/adafruit_mcp230xx/mcp23xxx.py", line 38, in __init__
self._device = i2c_device.I2CDevice(bus_device, address)
File "/home/chess/.local/lib/python3.9/site-packages/adafruit_bus_device/i2c_device.py", line 63, in __init__
self.__probe_for_device()
File "/home/chess/.local/lib/python3.9/site-packages/adafruit_bus_device/i2c_device.py", line 185, in __probe_for_device
raise ValueError("No I2C device at address: 0x%x" % self.device_address)
ValueError: No I2C device at address: 0x20
Alles anzeigen
von daher das ich mich mit dem Thema nicht sehr gut auskenne hab ich erst gegoogelt und dann das hier versucht
daraus kam
Code
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
und dann
Code
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- 37 -- -- 3a -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- 49 -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- 59 -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
schlauer wurde ich daraus aber auch nicht also ich weiß nicht ganz was ich von hier aus machen kann
bedanke mich für jede hilfe schonmal im vorraus