Monday, July 23, 2012

First robot.

I've combined my Android and Arduino skills to make my first robot. Pics coming soon...

Thursday, February 11, 2010

IPOD+ARDUINO SIMPLE REMOTE

/*******************************************************************************
* Copyright (c) 2009 David Findlay
* All rights reserved.
* Modified by Dustin Evans 2010-02-11 evansdustin08@gmail.com www.MyArduinoProjects.BlogSpot.com
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
#include <8X8Pattern.h> // 8X8 LED MATRIX LIBRARY (NOT USED IN THIS EXAMPLE)
#include // USED FOR SIMPLE REMOTE COMMANDS
#include // USED TO COMMUNICATE TO THE IPOD
const int PLAY_BUTTON = 5; // PLAY/PAUSE ON PIN 5
const int NEXT_BUTTON = 6; // NEXT TRACK ON PIN 6
const int PREVIOUS_BUTTON = 7; // PREVIOUS TRACK ON PIN 7
const int VOLUMEUP_BUTTON = 8; // VOLUME INCREASE ON PIN 8
const int VOLUMEDOWN_BUTTON = 9; // VOLUME DECREASE ON PIN 9
const int RANDOMON_BUTTON = 10; // TURN RANDOM ON/0FF ON PIN 10
const int IPODON_BUTTON = 11; // WAKE UP IPOD ON PIN 11
const int IPODOFF_BUTTON = 12; // MAKE IPOD SLEEP PIN 12
const long DEBOUNCE_MILLIS = 150; // DEBOUNCE USED TO CANCEL OUT ANY ACCIDENTAL BUTTON PRESSES
int lastButtonState = LOW; // STATE OF THE BUTTONS
long lastToggleTime = 0; // TOGGLE TIME USED TO CALCULATE BETWEEN NOW AND DEBOUNCE
SimpleRemote simpleRemote;
void setup()
{
pinMode(PLAY_BUTTON, INPUT); // SET ALL THE BUTTONS AS INPUTS
pinMode(NEXT_BUTTON, INPUT);
pinMode(PREVIOUS_BUTTON, INPUT);
pinMode(VOLUMEUP_BUTTON, INPUT);
pinMode(VOLUMEDOWN_BUTTON, INPUT);
pinMode(RANDOMON_BUTTON, INPUT);
pinMode(IPODON_BUTTON, INPUT);
pinMode(IPODOFF_BUTTON, INPUT);
// turn on the pull-up resistor for example using Arduino resistor. in actual program won't need this
digitalWrite(PLAY_BUTTON, HIGH);
digitalWrite(NEXT_BUTTON, HIGH);
digitalWrite(PREVIOUS_BUTTON, HIGH);
digitalWrite(VOLUMEUP_BUTTON, HIGH);
digitalWrite(VOLUMEDOWN_BUTTON, HIGH);
digitalWrite(RANDOMON_BUTTON, HIGH);
digitalWrite(IPODON_BUTTON, HIGH);
digitalWrite(IPODOFF_BUTTON, HIGH);
simpleRemote.setup();
}
void loop()
{
simpleRemote.loop();
const int PLAY_BUTTON_STATE = digitalRead(PLAY_BUTTON);
const int NEXT_BUTTON_STATE = digitalRead(NEXT_BUTTON);
const int PREVIOUS_BUTTON_STATE = digitalRead(PREVIOUS_BUTTON);
const int VOLUMEUP_BUTTON_STATE = digitalRead(VOLUMEUP_BUTTON);
const int VOLUMEDOWN_BUTTON_STATE = digitalRead(VOLUMEDOWN_BUTTON);
const int RANDOMON_BUTTON_STATE = digitalRead(RANDOMON_BUTTON);
const int IPODON_BUTTON_STATE = digitalRead(IPODON_BUTTON);
const int IPODOFF_BUTTON_STATE = digitalRead(IPODOFF_BUTTON);
const long now = millis();
if ((PLAY_BUTTON_STATE != lastButtonState) && ((now - lastToggleTime) > DEBOUNCE_MILLIS))
{
if (PLAY_BUTTON_STATE == LOW)
{
simpleRemote.sendPlay();
}
else
{
simpleRemote.sendButtonReleased();
}
lastButtonState = PLAY_BUTTON_STATE;
lastToggleTime = now;
}
else if ((NEXT_BUTTON_STATE != lastButtonState) && ((now - lastToggleTime) > DEBOUNCE_MILLIS))
{
if (NEXT_BUTTON_STATE == LOW)
{
simpleRemote.sendSkipForward();
}
else
{
simpleRemote.sendButtonReleased();
}
lastButtonState = NEXT_BUTTON_STATE;
lastToggleTime = now;
}
else if ((PREVIOUS_BUTTON_STATE != lastButtonState) && ((now - lastToggleTime) > DEBOUNCE_MILLIS))
{
if (PREVIOUS_BUTTON_STATE == LOW)
{
simpleRemote.sendSkipBackward();
}
else
{
simpleRemote.sendButtonReleased();
}
lastButtonState = PREVIOUS_BUTTON_STATE;
lastToggleTime = now;
}
else if ((VOLUMEUP_BUTTON_STATE != lastButtonState) && ((now - lastToggleTime) > DEBOUNCE_MILLIS))
{
if (VOLUMEUP_BUTTON_STATE == LOW)
{
simpleRemote.sendVolPlus();
}
else
{
simpleRemote.sendButtonReleased();
}
lastButtonState = VOLUMEUP_BUTTON_STATE;
lastToggleTime = now;
}
else if ((VOLUMEDOWN_BUTTON_STATE != lastButtonState) && ((now - lastToggleTime) > DEBOUNCE_MILLIS))
{
if (VOLUMEDOWN_BUTTON_STATE == LOW)
{
simpleRemote.sendVolMinus();
}
else
{
simpleRemote.sendButtonReleased();
}
lastButtonState = VOLUMEDOWN_BUTTON_STATE;
lastToggleTime = now;
}
else if ((RANDOMON_BUTTON_STATE != lastButtonState) && ((now - lastToggleTime) > DEBOUNCE_MILLIS))
{
if (RANDOMON_BUTTON_STATE == LOW)
{
simpleRemote.sendToggleShuffle();
}
lastButtonState = RANDOMON_BUTTON_STATE;
lastToggleTime = now;
}
else if ((IPODON_BUTTON_STATE != lastButtonState) && ((now - lastToggleTime) > DEBOUNCE_MILLIS))
{
if (IPODON_BUTTON_STATE == LOW)
{
simpleRemote.sendiPodOn();
}
lastButtonState = IPODON_BUTTON_STATE;
lastToggleTime = now;
}
else if ((IPODOFF_BUTTON_STATE != lastButtonState) && ((now - lastToggleTime) > DEBOUNCE_MILLIS))
{
if (IPODOFF_BUTTON_STATE == LOW)
{
simpleRemote.sendiPodOff();
}
lastButtonState = IPODOFF_BUTTON_STATE;
lastToggleTime = now;
}
}

Tuesday, February 9, 2010

Problems....

the PCB for the buttons was soldered on backwards and in the process of fixing it, it got damaged beyond repair. also when making the plexiglass cover it got cracked. :(

Monday, February 8, 2010

Video!!!

http://www.youtube.com/watch?v=Z8g9wtGML3s

Video of the table hooked up to my Macbook.

http://www.youtube.com/evansdustin

My youtube channel that has the XBOX 360 Laptop my friend built.

Sunday, February 7, 2010

Pictures!!

here is a link to the project on my Flikr account. enjoy!

http://www.flickr.com/photos/26028708@N04/sets/72157622372526921/

Sunday, January 24, 2010

Parts list from RadioShack

Item: 2711129
Description: 33K ohm 1/2W Resistor PK/5
Quantity: 1 @ $.99
Shipping Method: Standard Ground
Arrival dependent upon the shipping method selected.


Item: 2711342
Description: 47K ohm 1/4W 5% Resistor pk/5
Quantity: 1 @ $.99
Shipping Method: Standard Ground
Arrival dependent upon the shipping method selected.


Item: 2711339
Description: 22K ohm 1/4W 5% Resistor pk/5
Quantity: 1 @ $.99
Shipping Method: Standard Ground
Arrival dependent upon the shipping method selected.


Item: 2711347
Description: 100K ohm 1/4W 5% Resistor pk/5
Quantity: 1 @ $.99
Shipping Method: Standard Ground
Arrival dependent upon the shipping method selected.


Item: 2720135
Description: 0.1æF Disc Capacitors 2 Pack
Quantity: 1 @ $1.49
Shipping Method: Standard Ground
Arrival dependent upon the shipping method selected.


Item: 2721436
Description: 10æF 16V Tantalum Capacitor
Quantity: 1 @ $1.59
Shipping Method: Standard Ground
Arrival dependent upon the shipping method selected.


Item: 2750644
Description: SPST PUSHBTN SWCH
Quantity: 1 @ $2.69
Shipping Method: Standard Ground
Arrival dependent upon the shipping method selected.


Item: 2750648
Description: SPDT 6A PADDLE SW
Quantity: 1 @ $2.99
Shipping Method: Standard Ground
Arrival dependent upon the shipping method selected.


Sub-Total: $ 12.72
Tax: $ 1.28
---------------------------
Shipping/Handling: $ 6.05
---------------------------
Total for this address: $ 20.05
---------------------------
Order Total: $ 20.05
---------------------------

Saturday, January 23, 2010

Parts List I just ordered

So Damion is making this whole thing easier by building a custom shield for the Arduino and in order to do that we needed parts.... I just ordered a total of $52.35 including:

Status Product
Qty Total
Item in Box PRT-08094 Polarized Connectors - Header (6-Pin)
6 $2.70
Item in Box PRT-08232 Polarized Connectors - Header (3-Pin)
1 $0.45
Item in Box PRT-08095 Polarized Connectors - Housing (2-Pin)
4 $1.80
Item in Box PRT-08096 Polarized Connectors - Housing (3-Pin)
1 $0.45
Item in Box PRT-00115 Break Away Female Headers
1 $1.50
Item in Box PRT-00119 DC Barrel Power Jack/Connector
1 $1.25
Item in Box PRT-08233 Polarized Connectors - Header (2-Pin) 4 $1.80
Item in Box PRT-08099 Polarized Connectors - Housing (6-Pin) 6 $2.70
Item in Box PRT-08100 Polarized Connectors - Crimp Pins
3 $5.85
Item in Box PRT-08032 Audio Jack 3.5mm
1 $1.50
Item in Box PRT-00116 Break Away Headers - Straight
2 $5.00
Item in Box COM-08963 Mini Button Pad PCB
1 $1.95
Item in Box COM-08998 Mini Button Pad Set - White
1 $4.95
Item in Box PRT-08992 Screw 2-56 Flat Head - 3/8"
4 $0.60
Item in Box PRT-08995 Machine Screw Nut 2-56
4 $0.60
Item in Box COM-00533 Basic LED - Red
1 $0.35
Item in Box PRT-08867 Hook-up Stranded Wire - Black
1 $2.50
Item in Box PRT-08865 Hook-up Stranded Wire - Red
1 $2.50
Item in Box TOL-08269 Wall Adapter Power Supply - 5VDC 1A 1 $5.95
Subtotal $44.40
Shipping and Handling
+ $7.95
-----------------------------------------------------
Grand Total: $52.35