Show Posts
Pages: [1] 2 3 ... 68
1  Using Arduino / Programming Questions / Re: Arduino IDE serial communication on: August 27, 2014, 04:58:36 am
As of now I have the RX/TX of the atmega conneected to RX3/TX3 of the arduino.

I don't know if that's the case, but RX must be connected to TX3, and TX to RX3.

And also, for the Mega code, you must use Serial3.begin and Serial3.available.
2  International / Français / Re: Comment puis-je récupérer des string séparé par des espaces on: August 24, 2014, 05:05:32 pm
Si tu tiens absolument à utiliser une regex, ceci pourrait t'intéresser smiley-wink
3  Using Arduino / Project Guidance / Re: Arduino Mega 2560, what all pins can I use? on: August 23, 2014, 01:54:43 am
Very nice smiley-wink
4  Using Arduino / Programming Questions / Re: Using C++ header files on: August 20, 2014, 05:37:11 pm
Send the analog values by Serial, to a custom program on your computer, that will write those values into a file on your hard drive. If you have Windows on your computer, I recommend that you write the program in C#, much easier and faster to learn, than C++.
5  Using Arduino / Programming Questions / Re: Parse a serial string on: August 18, 2014, 01:06:34 pm
I understand it can be hard for beginners... This example will read everything available in the Serial buffer until a "\r" is found, and then will try to parse as you described:
void loop()
  // if there is something in the serial buffer
  if ( Serial.available() > 0 )
    static char input[64];
    static uint8_t i;

    // read one character
    char c =;

    // if the character is not a "\r" and the input buffer is not full
    if ( c != '\r' && i < 64-1)
      // store the character at the end of the input buffer
      input[i++] = c;

    // else, the input is ready to be processed
      // add a null terminator to make it a valid C string
      input[i] = '\0';
      //reset index for the next serial message
      i = 0;
      // try parsing the input as you described
      uint8_t xx;
      uint16_t yy;
      if ( sscanf( input, "$ABDATA,%hhu,%hu", &xx, &yy ) == 2 )
        Serial.println( xx );
        Serial.println( yy );
6  Using Arduino / Programming Questions / Re: Parse a serial string on: August 18, 2014, 12:43:51 pm
Hello and welcome smiley

The easiest way is to use sscanf
7  Using Arduino / Programming Questions / Re: Adapting code to what I really want... (thermistor+lcd) on: August 17, 2014, 10:28:08 pm
Hello and welcome smiley

To calculate an average temp you need to add some samples together, and then divide the result by the number of samples.

For example:
float counter = 0.0;
uint8_t samples = 0;
float averageTemperature = 0.0;
//every time you get the temperature from the thermistor
counter += currentTemperature;
samples ++;
averageTemperature = counter / samples;
// don't count too much...
if ( samples > 100 )
    samples = 1;
    counter = averageTemperature;
(this is untested)

For the max temp, you need to periodically compare the current value with a variable. If the current value is greater than the variable, then you store it in that variable.

For example:
float maxTemperature = 0.0;
if ( currentTemperature > maxTemperature )
    maxTemperature = currentTemperature;

You may want to save/load this max temp value to/from EEPROM so that you don't lose it when the arduino is reset.
8  Using Arduino / Project Guidance / Re: House plant watering bot on: August 17, 2014, 02:53:23 pm
Maybe you aren't interested, or maybe you don't know, but you can water plants without the need of any electricity. Google "Tropf Blumat".

I'm using this ingenious thing since a few years and it's working perfectly smiley-wink
9  International / Le bar / Re: Presentez vous on: August 17, 2014, 01:51:28 pm
Bienvenue à tous et toutes, au plaisir de vous aider si je le peux smiley-wink
10  International / Français / Re: Problème avec la bibliothèque SD on: August 17, 2014, 01:34:14 am

Le "const" devant un paramètre de fonction ne sert que d'indicateur, il indique aux utilisateurs de cette librairie (ainsi qu'au compilateur, qui optimisera un peu cette fonction) que ce paramètre ne sera pas modifié dans la fonction. Tu peux utiliser une variable sans soucis.
11  International / Français / Re: Problème de débutant on: August 14, 2014, 03:01:11 pm
Ca peut aussi servir à inverser la valeur d'un bool
bool = !bool;

C'est bien pratique desfois smiley-wink
12  Using Arduino / Programming Questions / Re: Hello computer, how loud are you? on: August 14, 2014, 02:37:32 pm
It should be easy enough if you use Windows and know C# programming. Here is what I found:

You then need to add a Serialport object to communicate with your Arduino.
13  International / Français / Re: Problème de débutant on: August 14, 2014, 01:55:02 pm
ensuite je voit dans ton loop que tu t'est tromper ^^
tu a écrit
  if (! RTC.isrunning()){
    Serial.println("RTC ne fonctionne pas !");
    Serial.println("RTC fonctionne !");

ce qui veut dire que
si RTC.isrunning alors j'écrit RTC ne fonctionne pas

Le "!" veut dire "not".
14  International / Français / Re: [Conseil] Optimisation de Fonction perso drawFramBitmap on: August 12, 2014, 02:21:18 am
J'ai un peu modifié mon exemple, peut-être que cela t'aidera à comprendre? Sinon, poste ton code j'y jetterais un oeil.
15  Using Arduino / Programming Questions / Re: converting RTC to string on: August 11, 2014, 05:55:48 pm
No idea, I don't have a matrix :/
Pages: [1] 2 3 ... 68