bluebie / littlewire.rb Goto Github PK
View Code? Open in Web Editor NEWA little library for a littlewire.cc, in Ruby 1.9 and 2.0.
Home Page: http://creativepony.com/littlewire/
License: Other
A little library for a littlewire.cc, in Ruby 1.9 and 2.0.
Home Page: http://creativepony.com/littlewire/
License: Other
Make a subclass and use it, and make the nunchuck gadget auto retry on that kind of error.
I'm probably being dense, but it doesn't say in the docs. Do I install the Latest on the little wire device? "https://github.com/Bluebie/littlewire.rb/blob/master/firmware/latest.hex" So, first install micronucleus, then upload the firmware hex, then speak to the device with the ruby library?
Thanks
add a voltages
command to `littlewire.rb which displays a live updating ascii graphing volt meter, kind of like an oscilloscope, right there in your terminal window. Use the 'colored' library to color code the different lines on the volt meter display - the same library digiusb rubygem uses for it's terminal thingo.
The current I2C#send has no way to send arrays of less than 4 bytes length.
In order to properly use devices that send encrypted data, such as the Wii nunchuck, you need to be able to send messages of 1 and 2 bytes length.
rdoc?
why not markdown?
whatevs.
The line https://github.com/Bluebie/littlewire.rb/blob/master/lib/i2c.rb#L33 has an error, in that the param end_with_stop
is a boolean, but the expected value is an integer ala https://github.com/Bluebie/littlewire.rb/blob/master/lib/i2c.rb#L22
Hi!
I am trying to run the littlewire.rb using a digispark that I have loaded littlewire on, using littlewire_v12.hex that I downloaded from http://littlewire.cc/downloads.html.
I was able to get the blinky example working fine using :pin1:
require 'littlewire'
wire = LittleWire.connect
wire.pin_mode :pin1 => :input
loop do
wire.digital_write(:pin1, true) # set the LED on for half a second
sleep 0.5
wire.digital_write(:pin1, false) # set the LED off for half a second
sleep 0.5
end
I then attached a switch with a pull-down resistor to pin1, along with +5 and GND (http://arduino.cc/en/tutorial/button circuit), and have been trying this code:
require 'littlewire'
wire = LittleWire.connect
wire.pin_mode :pin1 => :input
loop do
puts wire.digital_read(:pin1)
sleep 0.5
end
No matter which pin I connect to (sticking to p1/p2/p5 on the digispark, of course) digital_read always returns false. When I am plugged into :pin1 the LED on the digispark lights up as I would expect from pushing the button, so it would appear I have continuity.
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.