Get The Arduino Dice

by Ingo Lohs

  • 383 views
  • 0 comments
  • 4 respects

Laser Measurements Controlled by Arduino Nano

Project in progress by Ingo Lohs

  • 795 views
  • 0 comments
  • 1 respect


Replicated projects 0

 Ingo Lohs hasn't replicated any projects yet.

Respected projects 1

I Keep my Cucumber Growing Conditions Moist

Project showcase by Ingo Lohs

  • 1,716 views
  • 0 comments
  • 17 respects

  • Distance Measurement with an Ultrasonic Sensor HY-SRF05 4 months ago

    Hi Nicholas,
    there is a difference between HY-SRF05 and HC-SR04 from your BOM.
    Found the datasheet here: http://www.f15ijp.com/2012/09/arduino-ultrasonic-sensor-hc-sr04-or-hy-srf05/

  • Neopixel Motion Activated Night Light 4 months ago

    I am using a neopixel ring with 12 pixel, Becky.
    So check the number of pixels in your LED strip and change the variable.
    I commented a bit - hope the code is fine for you,
    Ingo


    #include <Adafruit_NeoPixel.h>
    #define LEDPIN 12 // connect the Data from the strip to this pin on the Arduino
    #define NUMBER_PIXELS 12 // the number of pixels in your LED strip
    Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMBER_PIXELS, LEDPIN, NEO_GRB + NEO_KHZ800);

    const int TrigPin = 2;
    const int EchoPin = 3;
    long duration, distance;
    int i = 0; // first Pixel
    lightON = 10000; // 10 sec is the delay time

    void setup()
    {
    // activate serial Monitor
    Serial.begin(9600);
    // init Echo
    pinMode(TrigPin, OUTPUT);
    pinMode(EchoPin, INPUT);
    // init Pixels
    strip.begin();
    strip.show(); // Initialize all pixels to 'off'
    }

    void loop()
    {
    // call the function below
    readDistance();

    // check what is to do with the distance value
    if (distance < 100)
    {
    // do anything -> call a function
    rainbow();
    }
    else
    {
    // put off the pixels
    strip.clear();
    strip.show();
    }
    }

    void readDistance()
    {
    digitalWrite(TrigPin, LOW);

    delayMicroseconds(2);
    digitalWrite(TrigPin, HIGH);
    delayMicroseconds(10);
    digitalWrite(TrigPin, LOW);
    duration = pulseIn(EchoPin, HIGH);
    distance = (duration/2) / 29.1;
    Serial.print("Distance\t=\t");
    Serial.print(distance);
    Serial.print(" cm");
    Serial.println();
    }

    void rainbow() // but we do not cycle the rainbow colors
    {
    // which Pixel and which RGB-Color (last 3 values set 1 color)
    strip.setPixelColor(i , 0, 0, 0); // off

    strip.setPixelColor((i+1) , 25, 0, 25); // violet
    strip.setPixelColor((i+2) , 255, 0, 255); // indigo
    strip.setPixelColor((i+3) , 0, 0, 150); // blue
    strip.setPixelColor((i+4) , 0, 150, 0); // green
    strip.setPixelColor((i+5) , 255, 255, 0); // yellow
    strip.setPixelColor((i+6) , 110, 70, 0); // orange
    strip.setPixelColor((i+7) , 150, 0, 0); // red
    strip.show();
    // time how long the Pixels are on before the next distance value will read again
    delay(lightON); // remark this out: the light is immediately OFF
    }

  • Neopixel Motion Activated Night Light 4 months ago

    You dare you to Becky, great!

    4 points in the overflight:
    A.) delay(wait) is not defined: missing "int wait = 10000;"
    B.) strip.clear(); // switched pixel turned off
    C.) check the position from the "}"
    D.) Idea: use an IF/ELSE clause:
    If (cm <100) {
         Neos on
         } else {
         Neos off
         }

Add projectSign up / Login