Add minimalist example 4

This commit is contained in:
Daniel Rojas 2020-05-24 15:10:56 +02:00
parent 09bc282506
commit 06a9188e83
2 changed files with 21 additions and 8 deletions

View File

@ -7,7 +7,7 @@ PINOUT_I2C = ('GND','+5V','SCL','SDA')
COLORS_I2C = ('BK', 'RD', 'YE', 'GN') COLORS_I2C = ('BK', 'RD', 'YE', 'GN')
PINOUT_SPI_DATAONLY = ('MISO','MOSI','SCK') PINOUT_SPI_DATAONLY = ('MISO','MOSI','SCK')
h.add_node('X1',type='Molex KK 254', gender='female', pinout=('GND', h.add_node('X1', type='Molex KK 254', gender='female', pinout=('GND',
'+5V', '+5V',
'SCL', 'SCL',
'SDA', 'SDA',

13
src/example4.py Normal file
View File

@ -0,0 +1,13 @@
import wireviz
h = wireviz.Harness()
h.add_cable('W1', show_name=False, show_num_wires=False, num_wires=4, color_code='DIN')
h.add_cable('W2', show_name=False, show_num_wires=False, num_wires=4, color_code='DIN')
h.add_node('X1', num_pins=4, show_num_pins=False)
h.add_node('X2', num_pins=4, show_num_pins=False)
h.add_node('X3', num_pins=4, show_num_pins=False)
h.connect_all_straight('W1','X1','X2')
h.connect_all_straight('W2','X2','X3')
h.output(filename='output', format=('png','svg'), view=False)