Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tenderlove/uchip
Ruby library for interacting with MCP2221 and MCP2221a
https://github.com/tenderlove/uchip
mcp2221 mcp2221a microchip ruby
Last synced: 18 days ago
JSON representation
Ruby library for interacting with MCP2221 and MCP2221a
- Host: GitHub
- URL: https://github.com/tenderlove/uchip
- Owner: tenderlove
- License: mit
- Created: 2020-08-16T02:55:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-14T04:10:10.000Z (about 3 years ago)
- Last Synced: 2024-11-30T03:33:22.583Z (22 days ago)
- Topics: mcp2221, mcp2221a, microchip, ruby
- Language: Ruby
- Homepage:
- Size: 37.1 KB
- Stars: 14
- Watchers: 5
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UChip
This is a library for controlling Microchip Chips. Specifically the MCP2221 and
MCP2221A.## Examples
See the `examples` folder for more examples, but here is an example of using
GP0 as a GPIO:```ruby
require "uchip/mcp2221"def hit_bell pin
pin.value = 0
pin.value = 1
sleep 0.009
pin.value = 0
end# Find the first connected chip
chip = UChip::MCP2221.first || raise("Couldn't find the chip!")pin = chip.pin 0
pin.output!loop do
hit_bell pin
sleep 2
end
```## Problems
Right now this library doesn't support DAC or ADC, but it should be trivial to
implement.