This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
wiki:make_treat_dispenser [2020/09/28 16:51] vizycam |
wiki:make_treat_dispenser [2022/03/08 10:28] vizycam [Testing] |
||
---|---|---|---|
Line 172: | Line 172: | ||
- | Then attach the extension cord to pins 2 and 4 on Vizy's terminal block. | + | Then attach the extension cord to pins 2 (12V) and 4 (B0) on Vizy's terminal block. |
Line 186: | Line 186: | ||
- | Or you can punch in some simple lines of Python. Just type into a Python instance (you can bring up a Python instance by pointing your browser to ''http://vizy.local/python''.) | + | Or you can punch in some simple lines of Python. Just type into a Python instance (you can bring up a Python instance by pointing your browser to ''http://vizy.local/python'' or by selecting **Python** in the [[wiki:vizy_editor#the-settings-menu|Settings Menu]].) |
<Code:python> | <Code:python> | ||
- | import vizy | + | import vizy.vizypowerboard as vpb |
- | power = vizy.VizyPowerBoard() | + | power = vpb.VizyPowerBoard() |
- | power.vcc12(1) | + | power.vcc12(True) |
power.io_set_mode(vizy.IO_MODE_HIGH_CURRENT) | power.io_set_mode(vizy.IO_MODE_HIGH_CURRENT) | ||
</Code> | </Code> | ||
Line 197: | Line 197: | ||
You can then trigger the solenoid (open shutter) with: | You can then trigger the solenoid (open shutter) with: | ||
<Code:python> | <Code:python> | ||
- | power.io_write_bits(1) | + | power.io_set_bit(0) |
</Code> | </Code> | ||
Line 203: | Line 203: | ||
<Code:python> | <Code:python> | ||
- | power.io_write_bits(0) | + | power.io_reset_bit(0) |
</Code> | </Code> | ||