Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: Using external power source on: September 26, 2012, 02:31:09 pm
you have to buy a lm7805 attach the input of the lm7805 to your batery, the ground to comond groun and the output to vin, and the comond groun to ground on arduino, an there u are, but no idea how is the consumition of the regulator xD

here u have a data sheet

http://www.fairchildsemi.com/ds/LM/LM7805.pdf

and u can power it from the power jack without anything xD 9volt batt -------- arduino jack
2  Using Arduino / Programming Questions / Re: Changing modes with one touch button; on-mode1-mode2-mode3-off-on-mode1, etc. on: September 19, 2012, 10:58:51 am
u have to use npn transistor to power your leds i don t thinks lily pad can handle 5 leds per pin, read this post http://lanavajadelgeek.blogspot.com.ar/2011/07/aprende-como-funciona-un-interruptor.html use google traslator smiley-razz to traslate all the page

realy is very easy in general a transistor (npn) have 3 leg base, emiter, colector

base: is the pin that recive the signal from the arduino (micro, ect) and let pass voltage from colector to emiter
emiter: conected to comond ground
colector: conected to the ground of the led

and the code u can use raw code, a variable "state"
Code:

if (state == 3) {
           state = 0;
                    }

 if (button1 == HIGH){
           state++;
                             }

if (state == 0) {do something1;}
if (state == 1) {do something2;}
if (state == 2) {do something3;}
if (state == 3) {do something4;}

this is an idea no the actual code you have to add the timer to the button to lock him from been trigger alot of times in 1 push
3  Using Arduino / Programming Questions / Re: Battery discharge curve mapping on: September 19, 2012, 10:42:08 am
i don t understad that graph Voltage of the batery vs capacity in mA? xD i think u whant voltage vs time or mA usague or something like that xD

i do a batery monitor,  u have to make a sketch measure you batery max charge voltage and the min safe voltage, the use analog read to measure it and use the map function to display it ass % or if u can take alot of reads of your analog read and paste it in exel they make for you a nice graph showing the discharge rate over time
4  Using Arduino / Project Guidance / Re: Need help with code for ULTRASONIC SENSOR connected to LCD on: September 18, 2012, 02:37:28 pm
Hi, i take the 2 examples of the arduino library and mix together this exaple should print in the lcd the distance in "cm" every 100 ms

copy and paste the code and this should work

Code:
/*
  LiquidCrystal Library - Blink
 
 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.
 
 This sketch prints "Hello World!" to the LCD and makes the
 cursor block blink.
 
 The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
   * ends to +5V and ground
   * wiper to LCD VO pin (pin 3)
 
 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe
 
 This example code is in the public domain.

 http://arduino.cc/en/Tutorial/LiquidCrystalBlink
 
 */

// include the library code:
#include <LiquidCrystal.h>

const int pingPin = 7;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  
  long duration, inches, cm;
  
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
  
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);

  // convert the time into a distance
  inches = microsecondsToInches(duration);
  cm = microsecondsToCentimeters(duration);
  
  lcd.print("cm: ");
  lcd.print(cm);
  
  delay(100);
}

long microsecondsToInches(long microseconds)
{
  // According to Parallax's datasheet for the PING))), there are
  // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
  // second).  This gives the distance travelled by the ping, outbound
  // and return, so we divide by 2 to get the distance of the obstacle.
  // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf
  return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds)
{
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
}

PD: i don't test the code in a real arduino because i m at work but the compiler says all it s ok xD
PD2: there is a library some where to do the ping alot easy look at google is like you only have to write distance(); and the library do all the job smiley-razz
5  Using Arduino / Programming Questions / Re: ps2 interfacing with arduino on: September 18, 2012, 02:23:44 pm
i think he is talking about PS2 (sony playstation 2 Joystick)
6  Using Arduino / Programming Questions / Re: ps2 interfacing with arduino on: September 18, 2012, 01:24:54 pm
mmm yo can give uss more detail about your project? xD

what do you whant your ps2 joystick interfase directly to arduino or the joystick conected to the PC and then the arduino cenected to the same pc?

or the ps2 joystick conected to the pc, and the pc via wireless (bluetooth, wifi, something wireless) to the arduino?

i do the last xD and work fine i try to put here the video but no ide how to paste a video from my facebook account smiley-razz
7  Using Arduino / Motors, Mechanics, and Power / Re: ESC setting on: September 17, 2012, 03:00:01 pm
Hi, use the servo library and use the esc like it is a servo (they work in the same way)

Code:
// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain.


#include <Servo.h>
 
Servo myservo;  // create servo object to control a servo
                // a maximum of eight servo objects can be created
 
int pos = 0;    // variable to store the servo position
 
void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
 
 
void loop()
{
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
  {                               
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}

conect the pin 9 on the arduino to the signal of your esc and the motor should start moving slowly and then go to the maximun throttle take cara of the motor it can go creazy and roll over the place xD
8  Using Arduino / Programming Questions / Re: JavaScript -> ? -> arduino on: September 17, 2012, 02:52:18 pm
Is your keyboard missing the punctuation keys?

yes sorry my keyboard work very bad and some keys work really bad and doesn't write fine, i'm at work xD
9  Using Arduino / Programming Questions / Re: No enough space in memory(SRAM) in Uno..Don't know why.. Need help! on: September 17, 2012, 02:32:35 pm
try this

Code:

unsigned long seconds = 0;

void setup() {
        Serial.begin(9600);     // opens serial port, sets data rate to 9600 bps
}

void loop() {
                seconds = (millis()/1000);
                Serial.print("Seconds ");
                Serial.println(seconds);
                delay(1000);
        }
}

This code should display in seconds how long arduino is on
10  Using Arduino / Programming Questions / Re: Help with error message on: September 17, 2012, 01:54:49 pm
Try to check you select the correct board, and u are using "avrisp mkII" if nothing help try to re download the software smiley-razz
11  Using Arduino / Programming Questions / Re: Need a simple remote control for TV on: September 17, 2012, 01:50:35 pm
@fenix8k
This is NOT a telephone chat line. u != you. Spell out words properly.

ok sorry i'm at work and i have to write fast xD
the pin 13 on arduino is prepare to drive a led without a resistor that is was trying to say xD sorry



12  Using Arduino / Programming Questions / Re: Need a simple remote control for TV on: September 17, 2012, 11:06:06 am
u only need the ir led and buttons, to make a remote but u have to know the code of each button of your tv and how many times it send to your tv, try to look for a library, there is sony and other brands library, or try to look for a project more complex leaving only the necessary parts.

for working remote u only need 1 ir led that can be attack to pin 13 thats already have a resistor and a way to tell arduino u are presing a buton
13  Using Arduino / Programming Questions / Re: JavaScript -> ? -> arduino on: September 17, 2012, 10:56:17 am
i do what u whant exept for the part of the router xD i don t remember what is the name but i have a arduino mega and there is and sketch and code for it that display data and let u control it from a SWF xD using javascrip is very nice but i get boring and go to another thing if i remember the name of the project or something i post it here smiley-razz

Look in google arduino and javascrip or something like that
14  Using Arduino / Programming Questions / Re: Blinking LEd controlled by servo state on: September 17, 2012, 09:37:01 am
i think u can do something easy, but need a little hardware modification, you have to open your servo carefully and solder a wire to the middle pin of the potentiometer, then u have to "calibrate" your sketch using analogRead() function read the 0 degree state of the pot and the 90 degree state, use the map function to map your result to a variable call "time" and this variable control the blink speed of your led.

and use if == 0 and if == 90 to set de led on all the time.

i hope this help u smiley-grin
15  Using Arduino / Programming Questions / Re: No enough space in memory(SRAM) in Uno..Don't know why.. Need help! on: September 17, 2012, 09:25:29 am
@Craiglin19 - Perhaps, if you posted the original sketch that was causing you problems, we could help you figure out why.

Thats is all the Sketch xD

Nothing wrong with your hardware/software , just upload a diferent sketch from your example library.
Pages: [1] 2