-A +A

 

Crit Assignment 2

Bent Circuits

  • What was the point?
  • What did we learn?

Microcontrollers

What is a Micro­con­trol­ler?

A microcontroller is a fully functional computer system on a chip. Also known as an "Embedded System"

    Used in automatically controlled devices like:
  • Cars (a typical car may have more than 30 microcontrollers)
  • Remote Controls
  • Copiers
  • Microwave Ovens
  • Toys – like the ones from Leapfrog
  • Over 4 billion 8-bit controllers were sold in 2006

One of the most popular is the PIC (Programmable Intelligent Computer)

Very inexpensive, relatively easy to program (if you write Assembler Code - you really don't want to go there…)

Some microcontrollers are targeted great for homebrewers. They don't require machine-level instructions, but have everything onboard to make programming them more straight-forward (like a language interpreter and serial communications).

Meet Arduino

What is the Arduino?

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. It's built on the Atmel AVR microcontroller

Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language (based on Wiring) and the Arduino development environment (based on Processing). Arduino projects can be stand-alone or they can communicate with software on running on a computer (e.g. Flash, Processing, MaxMSP).

Wiring is an open source programming environment and electronics i/o board for exploring the electronic arts, tangible media, teaching and learning computer programming and prototyping with electronics.

Processing is an open source programming language and environment for people who want to program images, animation, and interactions. It is used by students, artists, designers, researchers, and hobbyists for learning, prototyping, and production. It is created to teach fundamentals of computer programming within a visual context and to serve as a software sketchbook and professional production tool.

What's it made of?

AVR ATmega8 chip

    Why not use a bare chip? The Arduino is set up for experimentation right out of the box with:
  • Pre-loaded "bootloader" software
  • 9 kBytes (total) of memory
  • 13 digital input/output connectors
  • 5 analog input connectors
  • Reset button
  • Regulated 5V out connector and a passthrough Voltage connector
  • Test, communication indication, and power-on LED's

Time To Do Some Arduino!

To do this at home, go here for instructions, under "Getting Started"

Blink
Blink
Blink
Blink
Blink
Blink
Blink
Blink
Blink
Blink

  • Buddy up, two to a computer
  • Get an Arduino board and a power adapter
  • Make sure the power jumper is set to power from external power supply
  • Connect the Arduino to the Mac with the attached USB cable
  • Plug in the power supply and connect to the power port on the Arduino
  • Launch the Arduino Application
    • It should be version "Arduino 12"
  • Under Tools menu:
    • Set Board to the appropriate type
    • Check Serial Port information
  • Install and get running the Blink program
    • Under: File > Sketchbook > Examples > Digital > Blink
  • Advanced Task: Create this LED sequencer
  • int ledAPin = 7;
    int ledBPin = 6;
    int ledCPin = 5;
    
    void setup()
    {
      pinMode(ledAPin, OUTPUT);
      pinMode(ledBPin, OUTPUT);
      pinMode(ledCPin, OUTPUT);
    }
    
    void loop()
    {
        digitalWrite(ledAPin, HIGH);
        digitalWrite(ledBPin, LOW);
        delay(1000);
        digitalWrite(ledAPin, LOW);
        digitalWrite(ledBPin, HIGH);
        delay(1000);
        
        digitalWrite(ledCPin, HIGH);
        delay(100);
        digitalWrite(ledCPin, LOW);
        delay(100);
        digitalWrite(ledCPin, HIGH);
        delay(100);
        digitalWrite(ledCPin, LOW);
        delay(100);
    }