Author Topic: Littlewire BASIC  (Read 3289 times)

airship

  • Newbie
  • *
  • Posts: 11
Littlewire BASIC
« on: March 14, 2013, 02:18:19 pm »
Has anyone tried creating any sketches for the DigiSpark using Littlewire BASIC?  Just curious...

https://github.com/littlewire/bas-for-little-wire

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: Littlewire BASIC
« Reply #1 on: March 14, 2013, 04:23:30 pm »
Just to be clear to anyone reading this: This tool doesn't compile basic in to programs which are installed in to the digispark, it runs the programs on your computer and simply uses the digispark (which has had the littlewire firmware installed following the instructions in this forum) for electronic IO.

kehribar

  • Newbie
  • *
  • Posts: 18
Re: Littlewire BASIC
« Reply #2 on: March 15, 2013, 01:28:59 am »
Hi All,

This was a contribution from a member from Dangerous Prototypes forum. As also Jenna mentioned this library is just to control LittleWire's features from computer side. At the time being, i didn't have a Mac to test it. I tried but I couldn't use it with Linux either. I just forked a copy to main littlewire account for further reference.

Also, this library is created when the V1.0 firmware for Little Wire was around, therefore it is probably not suitable / compatible for V1.1 ...

Have fun
ihsan.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: Littlewire BASIC
« Reply #3 on: March 15, 2013, 02:37:39 am »
I'd personally recommend using Ruby over BASIC these days if you're writing code on your computer to control stuff via USB. I already have a partially complete littlewire rubygem available which can do all the basic stuff like servo control, pwm, analog, digital stuff. I didn't get around to testing all the i2c and SPI support, and didn't get around to even writing the OneWire support since I haven't needed to use any of those things so far. Check out the littlewire rubygem site for a little example of how you can use it to write code on your computer. It looks fairly similar to the code you write in the Arduino software but with better debugging and you can use the 'irb' interactive ruby program to type in line by line and see results immediately.


The coolest part is that you can 'require' any other ruby libraries and hook your hardware projects up to stuff like sound cards, 3d graphics, game controllers, facebook, twitter, media centres, system services, email, phone calls, sms. The possibilities for connecting your own electronics to the worldwide system of computers are pretty incredible and really easy using the littlewire rubygem!


Ruby is a really nice language with a friendly textual grammar similar to basic but more forgiving and more powerful. It supports a lot of more modern programming concepts which allow for cleaner clearer programs and has an absolutely enormous collection of libraries called "gems" which can be installed by typing just one line in to your terminal app. You can check out the available libraries at rubygems.org.


If you want to quick and dirty learn the basic stuff about ruby, do the interactive Try Ruby tutorial
If you're feeling more silly and have a bit of time to kill Why's (poignant) Guide to Ruby is incredible!


If you ever find yourself needing to use special libraries in the digispark to interface with specialised hardware you can use the DigisparkUSB library in your arduino sketch to pass strings back and forth to ruby through my digiusb rubygem. It's a bit like using a serial port on a regular arduino.