Anthony Stram JrBrian AKevin Fauth
Created March 28, 2015 © BSD-3-Clause

Party Bot

A Quadruped robot finds a quiet area and then begins a party by flashing colored lights, play dub step music, and spraying confetti.

Work in progress152
Party Bot

Things used in this project

Hardware components

chipKIT Fubarino Mini
×1
Adafruit Ultimate GPS Breakout
×1
Trossen Robotics Quadruped MKII Robot
×1

Story

Read more

Code

relayLEDdriver.pde

C/C++
/*
  main.ino
  description: Drive relay to control blinking LED ball/disk,
  relay control of confetti sprayer, RC servo control, and
  control of extra RGB LEDs.
  
  */

// includes
#include <SoftPWMServo.h>

// defines


// global const variables
const int glowBallRelay = 30;
const int confettiRelay = 3;
const int red1 = 4;
const int green1 = 5;
const int blue1 = 6;
const int red2 = 7;
const int green2 = 8;
const int blue2 = 9;
const int red3 = 10;
const int green3 = 11;
const int blue3 = 12;
const int red4 = 19;
const int green4 = 20;
const int blue4 = 21;
const int servoPin = 29;
const int buttonPin = 28;

// global variables
int buttonState = 0;
int glowState = 0;

// function prototypes


// begin setup
void setup()
{
  pinMode(glowBallRelay, OUTPUT);
  digitalWrite(glowBallRelay, LOW);
  pinMode(confettiRelay, OUTPUT);
  pinMode(buttonPin, INPUT);
}


// begin loop
void loop()
{
  // check button state
  buttonState = digitalRead(buttonPin);
  
  // check for state change
  if(buttonState == HIGH)
  {
    // turn on confetti and glow ball
    if(glowState == 0)
    {
      digitalWrite(glowBallRelay, HIGH);
      delay(50);
      digitalWrite(glowBallRelay, LOW);
      glowState = 1;
    }
    
    digitalWrite(confettiRelay, HIGH);
  
    // turn servo clockwise 
    SoftPWMServoServoWrite(servoPin, 2000);
  
    delay(1000);
    
    // turn servo counter-clockwise
    SoftPWMServoServoWrite(servoPin, 1000);
    
    delay(1000); // add this if needed
  }
  else
  {
    // make sure confetti, glow ball, and servo are off
    digitalWrite(confettiRelay, LOW);
    digitalWrite(glowBallRelay, LOW);
    SoftPWMServoServoWrite(servoPin, 1500);
  }
}

Credits

Anthony Stram Jr

Anthony Stram Jr

1 project • 0 followers
Brian A

Brian A

1 project • 0 followers
Kevin Fauth

Kevin Fauth

1 project • 0 followers
Front-end web developer, software engineer, hardware hacker

Comments