Skip to content


Example 6 – Blinking LED with button and light resistor

Blinking LED with button and with light resistorr (analog 0, earth, 5v) (PWM)

Below is breadboard view of Arduino example 6. Please look final code example to make needed in and out put adjustments to make it work.

arduino_example6

Posted in Examples.

Example 5 – Blinking LED with button and with potentiometer (analog 0, earth, 5v) (PWM)

Blinking LED with button and with potentiometer (analog 0, earth, 5v) (PWM)

Below is breadboard view of Arduino example 5. Please look final code example to make needed in and out put adjustments to make it work.

arduino_example5

Posted in Examples.

Example 3 – Blinking LED with button (4, earth) and (Serial.print)

Blinking LED with button (4)

Below is breadboard view of Arduino example 3. Please look final code example to make needed in and out put adjustments to make it work.

arduino_example3

Posted in Examples.

Example 2 – Blinking breadboard LED

Blinking breadboard LED

Below is breadboard view of Arduino example 2. Please look final code example to make needed in and out put adjustments to make it work.

arduino_example2

Posted in Examples.

Firmata Processing Example


/*
Simple Firmata example. Load Firmata to Arduino with LED connected to pin 5 and
potentiometer connected to pin 0.
*/

import processing.serial.*;

import cc.arduino.*;

Arduino arduino;

public static final int HALOO = 6;

void setup() {
size(470, 280);
arduino = new Arduino(this, Arduino.list()[0], 57600);
arduino.pinMode(5, Arduino.OUTPUT);
}

void draw() {
background(arduino.analogRead(0));
}

void mousePressed() {
println(”Hiiri painettu.”);
arduino.digitalWrite(5, Arduino.HIGH);
}

void mouseReleased() {
println(”Hiiri vapautettu.”);
arduino.digitalWrite(5, Arduino.HIGH);
}

Posted in Examples, Processing and Firmata.

Work Shop Code Example – Final

// Below is the final code example done during KoKoMys Arduino work shop

int lediPinni = 5;
int nappiPinni = 4;
int potikkaPinni = 0;

void setup() {
Serial.begin(9600);
Serial.println(”Mahtava ohjelma käynnistyi!!!”);

pinMode(lediPinni,OUTPUT);  // arduinolle ilmoitetaan pinnin moodi.

pinMode(nappiPinni,INPUT);
digitalWrite(nappiPinni,HIGH); // aktivoi pullup resistori, muista aina tehdä
}

void loop() {
Serial.println(analogRead(potikkaPinni));
if (digitalRead(nappiPinni)==LOW) { // jos nappi pohjassa, suoritetaan seuraavan lohkon käskyt.
//digitalWrite(lediPinni,HIGH);
analogWrite(lediPinni,analogRead(potikkaPinni)/4);
//Serial.println(”Nappi painettu!”);
// tässä välissä tehdään se varsinainen toiminta, esim. lähetetään MIDIä jonnekin.
//delay(10);
} else { // jos nappula ei ole painettuna
//Serial.println(”Nappi ei painettu!”);
digitalWrite(lediPinni,LOW);
}
}

Posted in Final Arduino Code.

Arduino tutorials

Here is couple simple tutorials for different Arduino projects. One of the best sources for more projects is the Blog of Make Magazine:

  • MIDI out (simple)
  • DMX out (simple) – Simple project for controlling DMX lights by using Arduino, easy to modify for computer controlled or stand alone version.
  • CV out (brutal code example) (simple) – Super simple CV out project for controlling analog synthesizer by using simple RC filter for smoothing the data. Synthesizer is controlled by sending serial data from computer (Processing, PureData, Max/MSP, Flash, …). Easy to modify to make a stand alone application without any computer.
  • LED driver TLC 5940 example (driving more LEDs than Arduino has outputs)
  • Arduino noisebox (advanced)
  • Controlling RGB led with RSS feed using Processing (Arduino code, Processing code)

More projects:

Please post links to interesting projects to the comments of this post!

Posted in Arduino Tutorials.

Workshop themes

In the Workshop we will explore the following topics

- Connecting Arduino to computer
- Connecting actuators and sensors to Arduino
- Arduino IDE (Integrated Development Environment)
- Midi Output
- Voltage output (Possibilities in circuit bending)
- Sending Serial Datan from Arduino to ex. Pure Data and Processing)

Posted in Workshop themes.