Introduction to Arduino Programming 3: You light up my life

Introduction to Arduino Programming

A series of based on New York University’s Introduction to Computer Programming class from the Courant Institute of Mathematical Sciences.

This is intended as a “gentle” introduction to computer programming and Arduino. The only prerequisite is that you’ve completed our Arduino Basics guide!

 

You light up my life.

Ok as we level up our skills we’ll talk less and code more!

This program will let us light up our bargraph Bit and check out some new Arduino Bit functions.

 

Our Circuit!

The code!

 

Output!

So our best friend INPUT has an a twin named OUTPUT. It let’s us send output to our bitSnap d5.

 

Here’s how we do it

1) We set our pinMode() to


2) Then let’s “write” our output to our bit!


One key thing to note is that our bargraph variable is an integer that is assigned to just 5 NOT d5.

 

Let’s flash our Arduino! (no, not that kind of flashing)

Once you’ve typed up the sample code, hit the upload button found in the tool bar. It looks like this: ❤

❤

This will flash the memory in our Arduino Bit so it can run our program!

 

All of the lights

You should be seeing your bargraph light up!

 

You made it!!!

Congrats we’re one step closer to being Arduino pros!

Here’s an emoji for all your hard work: 🎆

 

TL;DR

More Tips & Tricks

Tips & Tricks
Documentation Tips + Tricks

Tips/Techniques for Good Photos 1.) Setting  You’ll want to take strong clear photos that really show off your prototype. Yo...

Tips & Tricks
Synth Tips & Tricks: Dress up your Knobs

We present a series of material explorations for enhancing the knobs on the Synth Kit modules to make for a fun and tactile intera...

Tips & Tricks
Tips & Tricks: Bluetooth Low Energy Bit

MEET THE BIT The littleBits Bluetooth Low Energy Bit (marked “BLE” on your Bit) is the easiest way to control your inv...