Instructables
Picture of littleBits Serial Data

littleBits are fun little electronic modules you can use to build things. With the release of an Arduino module, you can now connect littleBits to your computer to control applications and other things running on your desktop.

 
Remove these adsRemove these ads by Signing Up

Step 1: Grab your bits

Picture of Grab your bits

You'll need:

  1. Power
  2. Dimmer
  3. Arduino

You'll also need a 9 volt battery and a computer with a USB port.

Step 2: Connect your bits

Picture of Connect your bits

The great thing about littleBits is that you really can't connect them incorrectly and do any damage. Here's how we'll connect up the bits. Power goes to d0/rx, and the slide dimmer goes to a1. That's about it! Don't forget to connect your 9 volt battery and turn on the power.

Step 3: Connect via USB

Picture of Connect via USB

Connect your littleBits via the included USB cable to a USB port on your computer. Nothing is happening? That's OK... we've got all the physical stuff done, but not we need to write some code so our littleBits know what to tell the computer.

Step 4: Write some code

Picture of Write some code

If you've never used an Arduino before, you may want to visit the Arduino web site and familiarize yourself with things. If you've got some Arduino knowledge, you can jump forward and choose "Arduino Leonardo" as the board type, and whichever USB port your Arduino shows up as. (On my computer it's "/dev/tty.usbmodem411" but it'll probably be something else on yours.)

Once you're connected, try this code:

int myPin = 1;
int myRawValue;
int myValue;

void setup() {
  Serial.begin(57600);
  pinMode(myPin, INPUT);     
}

void loop() {
  myRawValue = analogRead(myPin);
  Serial.println(myRawValue);
}

Upload your code to the Arduino and then open the Serial Monitor.

jessyratfink2 months ago

Nice! Excited to see what you do with this :)