Loading...
  Show Posts
Pages: 1 ... 63 64 [65] 66 67 ... 84
961  International / Español / Re: ayuda arduino+rele on: August 09, 2011, 06:50:28 pm
buenos consejos de zacarino...yo añadiria....por favor AISLA los pines y cables con 230Vac que no queremos tener un susto!

si no tienes una protoboard y no puedes conseguirla antes de seguir con esto, coge una tabla de madera o lo que sea y dispon los componentes pegados en el, los cables con celo o cinta para que no vayan sueltos por la mesa. pero sobre todo aisla la "alta" tensión.

algo asi como poco...
962  International / Español / Re: arduino UNO no arranca despues de darle alimentación on: August 09, 2011, 07:35:13 am
puede ser el auto reset pero deberia de resetearse al quitarle y volver a darle la alimentación.

como lo estas alimentando? por usb o por fuente externa?
963  International / Español / Re: Aumentar la frecuencia de muestreo on: August 09, 2011, 06:32:31 am
lo que dice Igor y SrDonGato pero utilizando micros en lugar de millis

http://www.arduino.cc/en/Reference/Micros
964  International / Español / Re: Duda con conexion Inalambrica entre ardruinos on: August 09, 2011, 04:14:21 am
como me interesa mucho este post voy a aportar un par de videos que he visto.
En cuanto a la recomendación lo dejo para otros, si que te digo que he oido hablar a muchos del nRF24L01


434
Info
http://openenergymonitor.org/emon/node/118
http://openenergymonitor.org/emon/node/119

Video 434



XBEE (aunque yo tambien desestime esta opción por lo cara que es)
965  International / Español / Re: Construir regulador de AC a DC para alimentar Arduino on: August 08, 2011, 08:21:50 am
Tienes que coger la tensión de salida del transformador multiplicarlo por raiz de 2 y consigues la vmax. a Vmax le restas 1,4 (caida de tensión en los 2 diodos) y el resultado tiene que ser menor que 16v (en tu caso) Salu2

Asi da gusto !!! Muchas gracias !!

Vmax = 9Vac * sqrt(2) = 12.728V
Vcondensador = Vmax - 1.4 = 11.328 V

El condensador puede ser de 1000uF y 16 V

Gracias ionhs !!
Lastima que la tienda estuviese cerrada y no diodos en casa para poder hacer el montaje smiley-sad tendre que esperarme a que vuelvan de vacaciones o a necesitar hacer un pedido online (que tardara xq acababa de hacer uno)
966  International / Español / Re: Sticky - Post fijo en el foro para cosas importantes on: August 08, 2011, 06:44:24 am
ok creo que esto ya va en un buen camino.

ya he añadido unas cositas que tenia en mi firma a la seccion de Consejos del foro.
editarlo según os parezca.
967  International / Español / Re: Sticky - Post fijo en el foro para cosas importantes on: August 08, 2011, 06:30:59 am
jeje estabamos escribiendo a la vez.

voy a ver como ha quedado, pero yo para empezar bajaria todo esto al final porque es menos importante para los usuarios nuevos.
Quote
Arduino Barcamps y Virtualcamps

    Documentación de todas las Arduino Barcamps celebradas y de las que se van a celebrar.

Arduinomaníacos / Censo Comunidad Arduino Habla Hispana

    Ayúdanos a dar una definición de 'arduinomaníaco' y cénsate si te identificas como tal.

lo ordenaria por FORO, luego PROYECTOS, luego LIBROS Y MANUALES y luego lo anterior.

968  International / Español / Re: Sticky - Post fijo en el foro para cosas importantes on: August 08, 2011, 06:28:02 am
Me parece bien!!

Podriamos poner un link o un listado de "normas de conducta" tipo las de mi firma para los usuarios nuevos.

Pues creo que la mejor opción ahora mismo seria crear un post con chincheta con un pequeño texto explicando que cosas podemos encontrar en el playground y que pueden ser utiles antes de postear preguntas repetidas.
un par de enlaces al playground y listo !! asi lo podemos actualizar todos !

que os parece?
969  International / Español / Re: Problema con el ángulo del servo (knob) on: August 08, 2011, 05:56:57 am
Me referia a probar algo asi...

en lugar de usar los datos del potenciometro hacer que un bucle pase por todos los numeros para ver si el servo responde o si es problema del potenciometro.

Code:
// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>

#include <Servo.h>
 
Servo myservo;  // create servo object to control a servo
 
int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin
 
void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
 
void loop()
{
//  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023)

for (int i = 0; i < 1023; i++)
{
   val = map(i, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180)
  myservo.write(val);                  // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
}

}

otra cosa, nunca he usado servos, pero con un delay de 15 le da tiempo a ir a todas las posiciones? como digo no se muy bien como va esto ya que el delay lo hace despues del write pero segun el comentario el delay es para que el servo le de tiempo a llegar a su posicion por lo que prueba a aumentar considerablemente este valor a ver que pasa. pero primero prueba con el 15
970  International / Español / Re: Sticky - Post fijo en el foro para cosas importantes on: August 08, 2011, 03:47:19 am
hola yo como novato lo veo muy bien
salu2

cual de las dos opciones? el playground o el post fijo con enlaces?
971  International / Español / Re: Construir regulador de AC a DC para alimentar Arduino on: August 08, 2011, 03:46:44 am
Alucinante el documento de Txapuzas !!!
Ademas mucho mas sencillo ya que el 7805 es cierto que no me hara falta porque el arduino tiene el suyo propio. Es decir que con el puente de diodos y el condensador es suficiente.

Una consulta rapida, los condensadores que recomendais son de 470 uF o 1000uF, ok perfecto tengo bastantes por casa. PEROOO los mios son de 16V en lugar de 24V como comentais.

Habra algún problema? puede usar estos o ya que voy a la tienda compro un par de 24V

graciasss
972  International / Español / Re: Alguien monto el RTC con el DS1703 (Circuito) on: August 07, 2011, 06:27:19 am
me alegro que ya te funcione, yo tambien pensaba que esa parte del codigo no esta bien escrita y tu forma me gusta mas pero como me funcionaba no me puse a cambiarlo.

yo prefiero programar el RCT y quitar cualquier cosa que pueda modificarmelo, al fin y al cabo si metes el proyecto en el arduino y se supone que va a estar funcionando sin un ordenador no va a tener la fecha y hora actualizadas del compilador nunca mas. pero bueno lo q dices no es mala opcion
973  International / Español / Re: Sticky - Post fijo en el foro para cosas importantes on: August 07, 2011, 06:23:00 am
pues creo que un gran fallo es q si pinchas en "playground" te vas al ingles, con esto ya la gente puede desanimarse y cerrar la ventana.

La lista de proyectos esta bien, pero creo que podriamos intentar organizarlos un poco porque al menos yo, con tal tocho de texto sin subtitulos ni nada se me hace pesado. podriamos organizarlo en plan Almacenamiento, LCD, interfase, etc

he añadido el enlace a al post de tiendas online en el playground.

sigo pensando que un usuario nuevo se registra, entra al foro a preguntar...y hay mas opciones de que abra un post que este al principio y le eche un vistazo a que se vaya al playground que para empezar no sabra que es. (entiendo el problema de que no todo el mundo puede editar un post, pero si el creador esta un poco atento puede ir añadiendo cosas segun la gente escriba en ese mismo post.
974  International / Español / Re: Alguien monto el RTC con el DS1703 (Circuito) on: August 06, 2011, 08:57:09 pm
me alegro que lo hayas solucionado.
si quieres puedo pasarte la libreria y los ejemplos que tengo yo. bueno mas facil lo pongo aqui y ya esta.
para no tener que copiar el archivo comprimido  a un servidor que luego puede que falle, te copio los dos archivos de la libreria y el archivo del ejemplo.

Libreria

RTClib.h
Code:
// Code by JeeLabs http://news.jeelabs.org/code/
// Released to the public domain! Enjoy!

// Simple general-purpose date/time class (no TZ / DST / leap second handling!)
class DateTime {
public:
    DateTime (uint32_t t =0);
    DateTime (uint16_t year, uint8_t month, uint8_t day,
                uint8_t hour =0, uint8_t min =0, uint8_t sec =0);
    DateTime (const char* date, const char* time);
    uint16_t year() const       { return 2000 + yOff; }
    uint8_t month() const       { return m; }
    uint8_t day() const         { return d; }
    uint8_t hour() const        { return hh; }
    uint8_t minute() const      { return mm; }
    uint8_t second() const      { return ss; }
    uint8_t dayOfWeek() const;

    // 32-bit times as seconds since 1/1/2000
    long secondstime() const;   
    // 32-bit times as seconds since 1/1/1970
    uint32_t unixtime(void) const;

protected:
    uint8_t yOff, m, d, hh, mm, ss;
};

// RTC based on the DS1307 chip connected via I2C and the Wire library
class RTC_DS1307 {
public:
  static uint8_t begin(void);
    static void adjust(const DateTime& dt);
    uint8_t isrunning(void);
    static DateTime now();
};

// RTC using the internal millis() clock, has to be initialized before use
// NOTE: this clock won't be correct once the millis() timer rolls over (>49d?)
class RTC_Millis {
public:
    static void begin(const DateTime& dt) { adjust(dt); }
    static void adjust(const DateTime& dt);
    static DateTime now();

protected:
    static long offset;
};


RCTlib.cpp
Code:
// Code by JeeLabs http://news.jeelabs.org/code/
// Released to the public domain! Enjoy!

#include <Wire.h>
#include <avr/pgmspace.h>
#include "RTClib.h"
#include <WProgram.h>

#define DS1307_ADDRESS 0x68
#define SECONDS_PER_DAY 86400L

#define SECONDS_FROM_1970_TO_2000 946684800

////////////////////////////////////////////////////////////////////////////////
// utility code, some of this could be exposed in the DateTime API if needed

static uint8_t daysInMonth [] PROGMEM = { 31,28,31,30,31,30,31,31,30,31,30,31 };

// number of days since 2000/01/01, valid for 2001..2099
static uint16_t date2days(uint16_t y, uint8_t m, uint8_t d) {
    if (y >= 2000)
        y -= 2000;
    uint16_t days = d;
    for (uint8_t i = 1; i < m; ++i)
        days += pgm_read_byte(daysInMonth + i - 1);
    if (m > 2 && y % 4 == 0)
        ++days;
    return days + 365 * y + (y + 3) / 4 - 1;
}

static long time2long(uint16_t days, uint8_t h, uint8_t m, uint8_t s) {
    return ((days * 24L + h) * 60 + m) * 60 + s;
}

////////////////////////////////////////////////////////////////////////////////
// DateTime implementation - ignores time zones and DST changes
// NOTE: also ignores leap seconds, see http://en.wikipedia.org/wiki/Leap_second

DateTime::DateTime (uint32_t t) {
  t -= SECONDS_FROM_1970_TO_2000;    // bring to 2000 timestamp from 1970

    ss = t % 60;
    t /= 60;
    mm = t % 60;
    t /= 60;
    hh = t % 24;
    uint16_t days = t / 24;
    uint8_t leap;
    for (yOff = 0; ; ++yOff) {
        leap = yOff % 4 == 0;
        if (days < 365 + leap)
            break;
        days -= 365 + leap;
    }
    for (m = 1; ; ++m) {
        uint8_t daysPerMonth = pgm_read_byte(daysInMonth + m - 1);
        if (leap && m == 2)
            ++daysPerMonth;
        if (days < daysPerMonth)
            break;
        days -= daysPerMonth;
    }
    d = days + 1;
}

DateTime::DateTime (uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec) {
    if (year >= 2000)
        year -= 2000;
    yOff = year;
    m = month;
    d = day;
    hh = hour;
    mm = min;
    ss = sec;
}

static uint8_t conv2d(const char* p) {
    uint8_t v = 0;
    if ('0' <= *p && *p <= '9')
        v = *p - '0';
    return 10 * v + *++p - '0';
}

// A convenient constructor for using "the compiler's time":
//   DateTime now (__DATE__, __TIME__);
// NOTE: using PSTR would further reduce the RAM footprint
DateTime::DateTime (const char* date, const char* time) {
    // sample input: date = "Dec 26 2009", time = "12:34:56"
    yOff = conv2d(date + 9);
    // Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
    switch (date[0]) {
        case 'J': m = date[1] == 'a' ? 1 : m = date[2] == 'n' ? 6 : 7; break;
        case 'F': m = 2; break;
        case 'A': m = date[2] == 'r' ? 4 : 8; break;
        case 'M': m = date[2] == 'r' ? 3 : 5; break;
        case 'S': m = 9; break;
        case 'O': m = 10; break;
        case 'N': m = 11; break;
        case 'D': m = 12; break;
    }
    d = conv2d(date + 4);
    hh = conv2d(time);
    mm = conv2d(time + 3);
    ss = conv2d(time + 6);
}

uint8_t DateTime::dayOfWeek() const {   
    uint16_t day = date2days(yOff, m, d);
    return (day + 6) % 7; // Jan 1, 2000 is a Saturday, i.e. returns 6
}

uint32_t DateTime::unixtime(void) const {
  uint32_t t;
  uint16_t days = date2days(yOff, m, d);
  t = time2long(days, hh, mm, ss);
  t += SECONDS_FROM_1970_TO_2000;  // seconds from 1970 to 2000

  return t;
}

////////////////////////////////////////////////////////////////////////////////
// RTC_DS1307 implementation

static uint8_t bcd2bin (uint8_t val) { return val - 6 * (val >> 4); }
static uint8_t bin2bcd (uint8_t val) { return val + 6 * (val / 10); }

uint8_t RTC_DS1307::begin(void) {
  return 1;
}

uint8_t RTC_DS1307::isrunning(void) {
  Wire.beginTransmission(DS1307_ADDRESS);
  Wire.send(0);
  Wire.endTransmission();

  Wire.requestFrom(DS1307_ADDRESS, 1);
  uint8_t ss = Wire.receive();
  return !(ss>>7);
}

void RTC_DS1307::adjust(const DateTime& dt) {
    Wire.beginTransmission(DS1307_ADDRESS);
    Wire.send(0);
    Wire.send(bin2bcd(dt.second()));
    Wire.send(bin2bcd(dt.minute()));
    Wire.send(bin2bcd(dt.hour()));
    Wire.send(bin2bcd(0));
    Wire.send(bin2bcd(dt.day()));
    Wire.send(bin2bcd(dt.month()));
    Wire.send(bin2bcd(dt.year() - 2000));
    Wire.send(0);
    Wire.endTransmission();
}

DateTime RTC_DS1307::now() {
  Wire.beginTransmission(DS1307_ADDRESS);
  Wire.send(0);
  Wire.endTransmission();
 
  Wire.requestFrom(DS1307_ADDRESS, 7);
  uint8_t ss = bcd2bin(Wire.receive() & 0x7F);
  uint8_t mm = bcd2bin(Wire.receive());
  uint8_t hh = bcd2bin(Wire.receive());
  Wire.receive();
  uint8_t d = bcd2bin(Wire.receive());
  uint8_t m = bcd2bin(Wire.receive());
  uint16_t y = bcd2bin(Wire.receive()) + 2000;
 
  return DateTime (y, m, d, hh, mm, ss);
}

////////////////////////////////////////////////////////////////////////////////
// RTC_Millis implementation

long RTC_Millis::offset = 0;

void RTC_Millis::adjust(const DateTime& dt) {
    offset = dt.unixtime() - millis() / 1000;
}

DateTime RTC_Millis::now() {
  return (uint32_t)(offset + millis() / 1000);
}

////////////////////////////////////////////////////////////////////////////////

Ejemplo que me funciona con IDE 22

ds1307.pde
Code:
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib

#include <Wire.h>
#include "RTClib.h"

RTC_DS1307 RTC;

void setup () {
    Serial.begin(57600);
    Wire.begin();
    RTC.begin();

  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
  }
}

void loop () {
    DateTime now = RTC.now();
   
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
   
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
   
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now.unixtime() + 7 * 86400L + 30);
   
    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();
   
    Serial.println();
    delay(3000);
}
975  International / Español / Re: Tutorial para Interrupciones on: August 06, 2011, 08:53:11 pm
exacto ionhs ese era el video del que hablaba. la verdad es que todos los videos de ese chico son muuuuy buenos, explica de forma super clara y sencilla, yo he aprendido muchisimo simplemente viendo sus videos.

genial que hayas incluido el enlace en el primer post.
Pages: 1 ... 63 64 [65] 66 67 ... 84