close-circle
Close
0%
0%

Arduino Darkest Timeline Bot

Cruel, Cruel, Cruel

Similar projects worth following
close
#SixSeasonAndAMovie

#SixSeasonsAndAMovie

Notation(s)

1. Adjusting to the new video-contraption i.e. smart phone, left one angle particularly poor and vocal audio equally as dismal. Inadequate tools remain inadequate. Regardless, the governing rule of this series remains stead fast; "Get this piece of shit off my desk top and let us move on..." Sigh.

2. Limitation to distance traveled observed in the video is not present in the sketch posted.

3. Our AI interface "Jacob" present in previous episodes was the go between for response to the auditory key words "no movie" triggering the cruel events that followed.

4. This was built for the sake of stupid; C minus.

5. Why the white boards?! The wheels (see Logs) are made from cardboard and hot glue...they uh, did not do well on uneven worn wood floors.

  • 2 × Arduino Uno
  • 1 × HC-06 Bluetooth Module
  • 1 × 360 Degree Servo
  • 1 × Boring Regular Servo
  • 1 × Ultrasonic Sensor

View all 12 components

  • Darkest Sketch

    Vije06/29/2017 at 03:24 0 comments

    // Darkest Timeline Bot
    // VijeMiller
    // SixSeasonsAndAMovie
    
    #include <Servo.h>
    #include <Adafruit_NeoPixel.h>
    
    // Neopixel
    #define PINPIXEL 6
    Adafruit_NeoPixel pixels = Adafruit_NeoPixel(3, PINPIXEL, NEO_GRB + NEO_KHZ800);
    
    // Sensor Values
    Servo headservo;
    Servo rollservo;
    #define trigPin 9
    #define echoPin 8
    // Set Distance (cm)
    int setdist = 40;
    
    // Head Positions
    int pos = 3;
    int good = 3;
    int evil = 158;
    // Roll Positions
    int forw = 75;
    int halt = 90;
    int back = 105;
    int slow = 80;
    
    // Bleu Cheese
    char incom = 0;
    
    void setup() {
    
      Serial.begin (9600);
    
      // Servo Pins
      headservo.attach(5);
      rollservo.attach(7);
    
      // Set Start Position
      headservo.write(good);
      rollservo.write(halt);
    
      // Sensor Pins
      pinMode(trigPin, OUTPUT);
      pinMode(echoPin, INPUT);
    
      // Load Neopixel
      pixels.begin();
    }
    
    void loop() {
    
      // Happy Blue
      pixels.setPixelColor(0, pixels.Color(0, 0, 255));
      pixels.setPixelColor(1, pixels.Color(0, 0, 255));
      pixels.setPixelColor(2, pixels.Color(0, 0, 255));
      pixels.show();
    
      // Roll Bluetooth (Jacob)
      if (Serial.available() > 0) {
        incom = Serial.read();
        if (incom == '1') {
          cruel();
        }
        else if (incom == '2') {
          cool();
        }
        else if (incom == '3') {
          gloat();
        }
      }
    
      // Sensor Sequence
      long duration, distance;
      digitalWrite(trigPin, LOW);
      delayMicroseconds(2);
      digitalWrite(trigPin, HIGH);
      delayMicroseconds(10);
      digitalWrite(trigPin, LOW);
      duration = pulseIn(echoPin, HIGH);
      // Centimeter Conversion
      distance = (duration / 2) / 29.1;
      // Print for Testing
      Serial.print(distance); Serial.println(" cm");
    
      if (distance > setdist) {
        forward();
      } else if (distance < setdist) {
        backward();
      } else {
      }
    
      delay(10);
    }
    
    void forward() {
      rollservo.write(forw);
      delay(1000);
      rollservo.write(halt);
    }
    
    void backward() {
      rollservo.write(back);
      delay(1000);
      rollservo.write(halt);
    }
    
    void cruel() {
      // Black
      pixels.setPixelColor(0, pixels.Color(0, 0, 0));
      pixels.setPixelColor(1, pixels.Color(0, 0, 0));
      pixels.setPixelColor(2, pixels.Color(0, 0, 0));
      pixels.show();
      // Become Evil
      for (pos = good; pos <= evil; pos += 1) {
        headservo.write(pos);
        delay(20);
      }
      delay(500);
      // Evil Red
      pixels.setPixelColor(0, pixels.Color(255, 0, 0));
      pixels.setPixelColor(1, pixels.Color(255, 0, 0));
      pixels.setPixelColor(2, pixels.Color(255, 0, 0));
      pixels.show();
      delay(1000);
      rollservo.write(slow);
      delay(5000);
      // Murder
      rollservo.write(halt);
      cool();
      incom = 0;
    }
    
    void cool() {
      // Black
      pixels.setPixelColor(0, pixels.Color(0, 0, 0));
      pixels.setPixelColor(1, pixels.Color(0, 0, 0));
      pixels.setPixelColor(2, pixels.Color(0, 0, 0));
      pixels.show();
      // Become Good
      for (pos = evil; pos >= good; pos -= 1) {
        headservo.write(pos);
        delay(20);
      }
      incom = 0;
    }
    
    void gloat() {
      rollservo.write(slow);
      delay(5000);
      rollservo.write(halt);
    }
    

  • Guts

    Vije06/29/2017 at 03:14 0 comments

  • Remedial Chaos Theory

    Vije06/15/2017 at 04:03 0 comments

  • Hackcycling Wheelies

    Vije06/12/2017 at 23:40 0 comments

View all 4 project logs

  • 1
    Eviling

  • 2
    Roxanne

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates