Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
blog:car_stuff_pycosworth_hardware [2021/08/18 18:16] – [Connections] john | blog:car_stuff_pycosworth_hardware [2021/08/18 19:05] (current) – [Making a Gauge Pod] john | ||
---|---|---|---|
Line 13: | Line 13: | ||
//Note: None of the examples here are necessary if you only intend to use PyCosworth on a laptop using the basic USB to serial cable connected to your ECU.// | //Note: None of the examples here are necessary if you only intend to use PyCosworth on a laptop using the basic USB to serial cable connected to your ECU.// | ||
- | ===== Connecting an OLED Screen ===== | + | ===== Connecting an SPI-based OLED Screen ===== |
+ | |||
+ | TBC | ||
+ | |||
+ | ===== Connecting an I2C-based | ||
You can use PyCosworth without any display functions, but.... it would be //pretty limited//. Here's how you connect up a relatively standard OLED display when using PyCosworth on a Raspberry Pi. | You can use PyCosworth without any display functions, but.... it would be //pretty limited//. Here's how you connect up a relatively standard OLED display when using PyCosworth on a Raspberry Pi. | ||
Line 198: | Line 202: | ||
</ | </ | ||
+ | //Note: if the power/ | ||
==== Other Considerations ==== | ==== Other Considerations ==== | ||
Line 235: | Line 240: | ||
' | ' | ||
' | ' | ||
- | ' | + | ' |
' | ' | ||
' | ' | ||
Line 296: | Line 301: | ||
{{: | {{: | ||
+ | |||
+ | Painted and with buttons and screen fitted: | ||
+ | |||
+ | {{: | ||
=== Connections === | === Connections === | ||
Line 316: | Line 325: | ||
Normally these are not user-accessible on a laptop or desktop PC, but there is a way to add them, and use them for prototyping your OLED based user interfaces without having to resort to running a development environment entirely on a Raspberry Pi. | Normally these are not user-accessible on a laptop or desktop PC, but there is a way to add them, and use them for prototyping your OLED based user interfaces without having to resort to running a development environment entirely on a Raspberry Pi. | ||
+ | A very small, very cheap [[http:// | ||
==== Parts/Tools ==== | ==== Parts/Tools ==== | ||
Line 322: | Line 332: | ||
==== Connections ==== | ==== Connections ==== | ||
+ | |||
+ | The Digispark board, when flashed with the i2c-tiny-usb firmware, gives you the standard 4 pins needed for an I2C connection: | ||
{{: | {{: | ||
+ | |||
+ | The connections from these pins to your standard 4-pin OLED display module are the same as if you were connecting to a Pi. | ||
==== Software Configuration ==== | ==== Software Configuration ==== | ||
+ | First, you need to install the software needed to flash the i2c-tiny-usb firmware to the Digispark board. This uses the Arduino IDE and supporting toolset, which is documented for the Digispark board here: http:// | ||
+ | |||
+ | Ultimately, you only need the // | ||
+ | |||
+ | On my Linux desktop, the Digispark board appears as I2C bus #08 when plugged in: | ||
+ | |||
+ | < | ||
+ | i2cdetect 8 | ||
+ | WARNING! This program can confuse your I2C bus, cause data loss and worse! | ||
+ | I will probe file /dev/i2c-8. | ||
+ | I will probe address range 0x03-0x77. | ||
+ | Continue? [Y/n] y | ||
+ | | ||
+ | 00: -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 70: -- -- -- -- -- -- -- -- | ||
+ | </ | ||
+ | |||
+ | If you plug your OLED module in to the Digisparks pin connectors, as detailed above, it should show up in the output of i2cdetect. | ||
+ | |||
+ | Remember to change your PyCosworth // | ||
+ | |||
+ | < | ||
+ | GFX_MASTER_WINDOW = { | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | That's it. All I2C comms (including the graphics routines used by Luma.oled and in turn by PyCosworth) will work unmodified and you can run your OLED display from your PC: | ||
+ | |||
+ | {{: | ||
===== My Current Setup ===== | ===== My Current Setup ===== | ||