Recent Posts

Pages: [1] 2 3 ... 10
1
Deutsch / Re: 0,0125*40000=763
Last post by Grumm_HD - Today at 03:12 pm
Ich habe die .elf Datei jetzt auch mit diesem Disassembler zurückgedingst: Onlinedisassembler
vielen Dank
2
Programming Questions / Re: DS3234 Date calculations
Last post by slawa92 - Today at 03:11 pm
Ran into similar problem recently, just wanted to share my solution. The idea behind my solution is to take a date, far back in time, I've taken 1/1/2015 (D/M/Y format) ( actually "any" other reasonable date can be used with my function ) and simply calculate how many days passed since that date using a simple function:

Code: [Select]
//==========================================================
//CODE CALCULATES DAYS BETWEEN NOW AND 1ST JAN 2015
int daysSince2015 (int days, int months, int years)
{
  int daysPerMonth[] = {31,28,31,30,31,30,31,31,30,31,30,31};
 
  int daysPassed = 0;
 
  int startDays = 1;
  int startMonth = 1;
  int startYears = 2015;
 
  //KEEP SCROLLIN' TILL THE REQUIRED YEAR IS REACHED
  for (startYears = 2015; startYears != years; startYears ++)
  {
    for (int n = 0; n < 12; n++)
    {
      //ONE MONTH AT A TIME
      daysPassed += daysPerMonth [n];
      //ADD LEAP DAY IF REQUIRED
      if ((n == 1) && ((startYears % 4) == 0))
      {
        daysPassed += 1;
      }
    }
  }

  //SCROLL MONTHS IF THE MONTHS IS NOT JANUARRY
  if (startMonth != months)
    {
      //SCROLL MONTH, USE startMonth AS A CURSOR TO daysPerMonth ARRAY
      //KEEP IN MIND THAT 1ST ELEMENT OF daysPerMonth ARRAY IS AT daysPerMonth[0]
      for (startMonth = 1; startMonth != months; startMonth ++)
      {
          //ONE MONTH AT A TIME
          daysPassed += daysPerMonth [startMonth - 1];
          //ADD A DAY IF IT'S FEBRUARY OF A LEAP YEAR
          if ((startMonth == 2) && ((startYears % 4) == 0))
          {
            daysPassed += 1;
          }
      }
    }
   
    //SINCE WE ARE ON THE SAME MONTH AND YEAR, JUST CALCULATE DAY DIFFERENCE
    daysPassed += days - startDays;

    //PRINT THE RESULT
    Serial.print("DAYS PASSEDS: ");
    Serial.println(daysPassed);

    //RETURN THE RESULT
    return daysPassed;

 
}
//=============================================================


Calculate this function for both dates of interest, the result of subtraction will represent the days difference between dates. The function was tested, and the results are proven using : https://www.timeanddate.com/date/durationresult.html?d1=1&m1=1&y1=2015&d2=1&m2=1&y2=2018
3
Programming Questions / Re: Error message invalid type...
Last post by ZOR2 - Today at 03:11 pm
Thanks both. I simply copied this sketch from a YouTube tutorial, the guy showed it working on his arduino.

One would think seeing it you'd believe it?

https://www.youtube.com/watch?v=kEuvtH1zlCo

Now I will look for another tutorial that works, thanks
4
Deutsch / Re: Messwerte auf SD - Shield ...
Last post by Doc_Arduino - Today at 03:10 pm
Hallo,

dazu mal wieder ein kleiner Hinweis. In der SD Lib steckt ein kleiner Bug. Fällt aber nur selten auf. Probleme können auftreten wenn man die Karte zwischendurch entfernt und wieder zugreifen möchte.

Dazu sollte man die SD.cpp Datei abändern.
Betrifft die Funktion ab Zeile 337.

Wie folgt ändern
Code: [Select]
boolean SDClass::begin(uint8_t csPin) {
  /*
    Performs the initialisation required by the sdfatlib library.

    Return true if initialization succeeds, false otherwise.

    Erster Block ergänzt, root wird geschlossen falls offen, damit kann jederzeit erneut initialisiert werden, zum Bsp. nach Kartenwechsel    
  */
    if (root.isOpen()) root.close();      // allows repeated calls
    return card.init(SPI_HALF_SPEED, csPin) &&
         volume.init(card) &&
         root.openRoot(volume);
}


5
Generale / Re: Monitoraggio peso da 0 a 1...
Last post by Etemenanki - Today at 03:10 pm
Se l'estetica non e' un problema, credo basti il normale tubo corrugato che si usa per murare (non solo per i tratti che si possono interrare, anche per il resto) ... certo a lungo termine (parecchi anni) si rovinera' anche lui, ma in fondo il suo scopo e' evitare che si rovini il cavo ... e mi sa che qualsiasi tipo di cavo "per esterni" garantito anti-UV, finirebbe per costare molto di piu ... ;)
6
Deutsch / Re: Zwei DHT22 Sensoren ausles...
Last post by ElCaron - Today at 03:10 pm
Code: [Select]

#include "DHT.h"
#define DHTTYPE DHT22
DHT dht (4, DHTTYPE);
DHT dht2 (5, DHTTYPE);


Warum dann nicht gleich so, bei so einem einfachen Sketch?

Ich weiss, entgegen der programming correctness, aber der Anfänger verstehts
Oder gleich
Code: [Select]

#include "DHT.h"
const uint8_t dhtpin1 = 4;
const uint8_t dhtpin2 = 5;

DHT dht1 (dhtpin1, DHTTYPE);
DHT dht2 (dhtpin2, DHTTYPE);


Dann schmeißt der Compiler nämlich auch verständliche Warnungen, wenn man was vergeigt. Theoretische Nachteile beim Speicher müssten wegoptimiert werden.

Und ja, man könnte daraus im nächsten Schritt noch Arrays machen, falls man mal 50 DHT22 anschließen will.
7
Sensors / Selecting gain for LMT70 (IC ...
Last post by IV_lab - Today at 03:10 pm
Hi all,

I'm putting together a skin temperature sensor, but wanted to use sensors with a high accuracy and small package size. So I decided on Texas Instrument's LMT70 as it seems super convenient.

As this is an analog IC, I need to convert the signal. I've decided to use a 16bit ADS1115 ADC. This has the fancy option for input multiplexing and has a programmable gain amplifier.

{The sensors and ADC are connected to a 3.3V Adafruit M0 feather board, interfaced using the ADS1x15 library}

I have a question that may seem idiotic, but I'm just trying to avoid frying the ADC by checking I understand it properly. The example code (see below) says I can set the gain at 2/3, 1x, 2x, 4x, 8x and 16x.

Am I correct in thinking that because my temp sensor will produce voltages of 0-3.3V, that I can only set the gain to 1x, as the 0-3.3V range falls in the +/- 4.096V limit, or have I misunderstood what these voltage ranges are referring to?


Code: [Select]
  // The ADC input range (or gain) can be changed via the following
  // functions, but be careful never to exceed VDD +0.3V max, or to
  // exceed the upper and lower limits if you adjust the input range!
  // Setting these values incorrectly may destroy your ADC!
  //                                                                ADS1015  ADS1115
  //                                                                -------  -------
  // ads.setGain(GAIN_TWOTHIRDS);  // 2/3x gain +/- 6.144V  1 bit = 3mV      0.1875mV (default)
  // ads.setGain(GAIN_ONE);        // 1x gain   +/- 4.096V  1 bit = 2mV      0.125mV
  // ads.setGain(GAIN_TWO);        // 2x gain   +/- 2.048V  1 bit = 1mV      0.0625mV
  // ads.setGain(GAIN_FOUR);       // 4x gain   +/- 1.024V  1 bit = 0.5mV    0.03125mV
  // ads.setGain(GAIN_EIGHT);      // 8x gain   +/- 0.512V  1 bit = 0.25mV   0.015625mV
  // ads.setGain(GAIN_SIXTEEN);    // 16x gain  +/- 0.256V  1 bit = 0.125mV  0.0078125mV
8
The encoder document is all in German and this is the English language section. There is also a German language section of the Forum.

Considering how much Faulhaber charge for their products I suspect they have other documents on their website that give all the details you need.

...R
9
Project Guidance / Re: controling servo with dust...
Last post by PaulS - Today at 03:09 pm
Quote
and that you will give your teacher a link to this Thread.
And the duplicate one in Gigs and Collaboration?

10
PaulS..Are you saying that the Firmata code cannot send a message based on state change of pin 4?

Thanks for your response as well.
Pages: [1] 2 3 ... 10

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy