7
mirror of https://github.com/tenderlove/initial-v.git synced 2024-11-22 14:24:59 +00:00
initial-v/firmware/reset.rb
Aaron Patterson e8c6c03ade
some scripts
2023-02-11 15:08:38 -08:00

20 lines
366 B
Ruby

require "uchip/mcp2221"
# Find the first connected chip
chip = UChip::MCP2221.first || raise("Couldn't find the chip!")
p chip.gpio_value 0
p chip.gpio_value 1
chip.set_gpio_value 0, 0
chip.set_gpio_value 1, 0
chip.set_gpio_value 0, 1
chip.set_gpio_value 1, 0
chip.set_gpio_value 0, 0
chip.set_gpio_value 1, 1
chip.set_gpio_value 0, 0
chip.set_gpio_value 1, 0