The Digispark > Digispark Projects

digiterm and digiusb rubygem

(1/2) > >>

before digistump made their program for talking to digiusb on your computer, I made this little rubygem which gets the job done: - now that there's an official one, the ruby version needs to remain competitive with edgy new features!

the digiusb rubygem gives you classes which let you read and write strings, characters and bytes to and from your digispark through it's digiusb library (provided by digistump built in to the arduino program). today I added some new features:

-> digiterm now has coloured output so you can see which chars were from the digispark and which you typed yourself
-> digiusb's inpect method is a little nicer
-> digiusb/digiblink exists now - a simple little abstraction for the digiblink sketch

the digiblink abstraction is literally 15 lines long, but it means you can do this in ruby: DigiBlink.sparks.first.color = 'red' and it totes makes the first spark it finds turn red!

look, I know you guys love python. python is a really lovely guy and all, but I really think you should consider ruby. ruby is a lovely place to be. ruby has all sorts of great friends who are all really excited to meet you. I think you'll get along great with ruby!

P.S. I tried to run the digistump one and nothing happened? IDK what to do with it.

update: 1.0.0 - improve digiterm to use about 1.8% cpu instead of about 16% by limiting read speed when digispark drains out of characters.

Awesome work on this! :)

Hi Bluebie -- unfortunately, my ruby skills suck, so I\'m not sure where to go with this, but I\'m getting this when trying to read from my digispark:

Looking for Digispark running DigiUSB...
/var/lib/gems/1.9.1/gems/libusb-0.2.2/lib/libusb/context.rb:72:in `get_pointer\': invalid memory read at address=0x00000000000000 (FFI::NullPointerError)
   from /var/lib/gems/1.9.1/gems/libusb-0.2.2/lib/libusb/context.rb:72:in `block in device_list\'
   from /var/lib/gems/1.9.1/gems/libusb-0.2.2/lib/libusb/context.rb:71:in `times\'
   from /var/lib/gems/1.9.1/gems/libusb-0.2.2/lib/libusb/context.rb:71:in `device_list\'
   from /var/lib/gems/1.9.1/gems/libusb-0.2.2/lib/libusb/context.rb:109:in `devices\'
   from /var/lib/gems/1.9.1/gems/digiusb-0.0.4/lib/digiusb.rb:17:in `sparks\'
   from /var/lib/gems/1.9.1/gems/digiusb-0.0.4/bin/digiterm:8:in `\'
   from /usr/local/bin/digiterm:23:in `load\'
   from /usr/local/bin/digiterm:23:in `\'

@Matir which operating system?


[0] Message Index

[#] Next page

Go to full version