Evelios / space-team

The space ship flying simulation experience
0 stars 0 forks source link

No typing module installed on Pico #5

Open Evelios opened 3 months ago

Evelios commented 3 months ago

Running the current code errors our with ImportError: No module named 'typing'. This is a result of using the MicroPython library which doesn't include the typing module by default. The easiest way of fixing this issue is through the MicroPython Stubs library. This allows for the use of typing library for static type checking without the overhead at runtime.

Evelios commented 3 months ago
Evelios commented 3 months ago

Installing the typing.mpy stubs onto the Pico cleared up this issue and the new current compile issue is

Traceback (most recent call last):
  File "main.py", line 20, in <module>
  File "main.py", line 15, in main
  File "spaceteam.py", line 22, in __init__
  File "hardware/pin_manager.py", line 26, in __init__
  File "hardware/mcp23017.py", line 182, in __init__
  File "hardware/mcp23017.py", line 186, in init
AttributeError: 'int' object has no attribute 'scan'
Evelios commented 3 months ago

The I2C scan was called on an int because the parameter arguments for the Mcp23017 were in the wrong order. The game now runs, but there are connection issues with the Mcp23017. I need to now go through and do hardware verifications of the different parts of the board. The current software crash is

Traceback (most recent call last):
  File "main.py", line 20, in <module>
  File "main.py", line 15, in main
  File "spaceteam.py", line 22, in __init__
  File "hardware/pin_manager.py", line 26, in __init__
  File "hardware/mcp23017.py", line 184, in __init__
  File "hardware/mcp23017.py", line 189, in init
OSError: MCP23017 not found at I2C address 0x20