-A +A

 

Code Examples

blink

  • Basic blink an LED example:
    text

LED Sequencer

  • Advanced blink an LED example:
    text

Playing with LEDs 01

  • Light up 10 LEDs in a pattern using delay():
    text

Playing with LEDs 02

  • Light up 10 LEDs like in the previous, but use a variable for delay():
    text

Playing with LEDs 03

  • Like 01 and 02, but add some fancy sequencing: :
    text

Playing with LEDs 04

  • Like 01 thru 03, but add some repeat loops and a "for" statement:
    text

Eye Swipe Hi

  • Setup 6 LEDs in a row row and wave back and forth to see the word HI spelled out:
    text

LED PWM 01

  • Variable Brightness LEDs done with three of Arduino's Pulse Width Modulation (PWM) pins (9,10,11):
    text

LED PWM 02

  • Like LED PWM 01 but added a direction-changing variable to control whether the PWMs will go up or down in the loop:
    text

Serial Debugging

  • Using the Serial.println() command to debug your code:
    text

Delay-Free Timing 01

  • Using a timing loop instead of delay():
    text

Delay-Free Timing 02

  • Using multiple timing loops:
    text

Delay-Free Timing 03

  • Using a single function to replace six. How to create a custom function:
    text

Timer-Fader 01

  • A delay-free timer for a single LED that fades in and out:
    text

Timer-Fader 02

  • A delay-free timer for LEDs that fades in and out and cascades 6 faders:
    text

Interactive Timer-Fader 01

  • Based on Timer-Fader 02 and adds a switch and potentiometer to change the timing:
    text

If-Then Interactivity 01

  • Testing for a value as it changes to trigger interactivity:
    text

Servo 01

  • Controlling a servo position using a potentiometer:
    text

Servo 02

  • Controlling a servo to sweep back and forth:
    text

Servo 03

  • Controlling two servos:
    text

Servo Rhythm

  • Simple sweep back and forth:
    text

Servo Chaos 01

  • Using the random() command to create the appearance of chaotic movement:
    text

Servo Chaos 02

  • More chaos with random timing values:
    text

Sharp Infra Red Sensor

  • How to hook up the Sharp IR sensor:
    text

MaxSonar Sensor

  • How to hook up the Max Sonar Ultrasonic Sensor:
    text

Servo & IR Sensor

  • Connecting an IR sensor to control the sweep of a servo motor:
    text

The map() Command

  • How to use the map() command to re-map one range of values to another:
    text

Switch: Hold to Change

  • How to read a digital momentary switch that shows O while held down and 1 when released:
    text

Switch: Press to Toggle

  • How to read a digital momentary switch that toggles each time it is pressed:
    text

Switch: Toggle Between Two Functions

  • How to switch between two functions with a momentary switch acting as a toggle:
    text

Sensor: testpir01

  • How to hook up the Passive Infra Red sensor:
    text

Sensor: test_pir02

  • How to use the PIR to trigger a function, but keep that function from re-triggering until it's finished:
    text