Show Posts
Pages: [1]
1  International / Proyectos / DHT22 Sensor de humedad on: April 17, 2013, 11:39:53 pm
Aquí les dejo un condigo sencillo porque no he encontrado casi nada de este dispositivo
Recuerden que hay que agregar una resistencia de 4.7 k entre pin 1 y pin 2

dirección de la librería
http://www.pasolutionz.com/goods.php?id=62

Código modificado


// Version John Electric 17/4/13
// Sensor DHT22 AM2302


#include <DHT22.h>
// Only used for sprintf
#include <stdio.h>

// Data wire is plugged into port 2 on the Arduino
// Connect a 4.7K resistor between VCC and the data pin (strong pullup)
#define DHT22_PIN 2

// Setup a DHT22 instance
DHT22 myDHT22(DHT22_PIN);

void setup(void)
{
  // start serial port
  Serial.begin(9600);
}

void loop(void)
{
  DHT22_ERROR_t errorCode;
 
  // The sensor can only be read from every 1-2s, and requires a minimum
  // 2s warm-up after power-on.
  delay(4000);
 
  errorCode = myDHT22.readData();
  switch(errorCode)
  {
    case DHT_ERROR_NONE:
      Serial.print("Temperatura = ");
      Serial.print(myDHT22.getTemperatureC());
      Serial.println(" C ");
      Serial.print("Humedad = ");
      Serial.print(myDHT22.getHumidity());
      Serial.println("%");
      Serial.println("");
      // Alternately, with integer formatting which is clumsier but more compact to store and
     // can be compared reliably for equality:
     //    

  }
}
2  Using Arduino / Programming Questions / Re: Arbitrary precision (big number) library port for Arduino on: January 20, 2013, 06:46:17 pm
Thank you very much for your quick responses, if the problem is not knowing what to
Serial.println (v, 4 or 3 or 2).

Thank you very much! > PaulS and Nick Gammon
 
my problem is solved (y)
3  International / Proyectos / Re: Estacion meteorologica. on: January 20, 2013, 12:31:51 am
El problema es que estas usando float en tus variables al comienzo, y por ejemplo

float sensor = ( 4.833984375 * analogRead(A0)-400.0) / 19.5;
    dataString += String(sensor);
    dataFile.println(dataString);

Debe ser :
int sensor = ( 4.833984375 * analogRead(A0)-400.0) / 19.5;
    dataString += String(sensor);
    dataFile.println(dataString);

yo también tengo ese problema porque quiero mas precisión.
4  Using Arduino / Programming Questions / Re: Arbitrary precision (big number) library port for Arduino on: January 19, 2013, 11:05:24 pm
Hi Nick, your library BigNumber this great, could you help me or tell me how to give more precision to my projects, when I divide 10/3 = 3.00 to 2 decimal Arduino anything else, as I can get more decimal places, 4 or 5 after point.
Pages: [1]