Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: NEWBEE: About reading uninitialized number in EEPROM section. on: September 19, 2014, 03:01:07 pm
Many thanks for your help !

isnan is definitively a nice macro !

Best regards

Thierry
2  Using Arduino / Programming Questions / Re: NEWBEE: About reading uninitialized number in EEPROM section. on: September 19, 2014, 12:37:38 pm
Many thanks !

if (config.c == 0xFFFFFFFFFFFFFFFF) is for a float

what is it for an integer ?

Best regard and many thanks for your help


Thierry
3  Using Arduino / Programming Questions / Re: NEWBEE: About reading uninitialized number in EEPROM section. on: September 19, 2014, 12:27:13 pm
Hello,
Thanks again,

I understand your reply but...

I read the all the structure with the macro:

Code:
template <class T> int EEPROM_readAnything(int ee, T& value)
{
    byte* p = (byte*)(void*)&value;
    unsigned int i;
    for (i = 0; i < sizeof(value); i++)
          *p++ = EEPROM.read(ee++);
    return i;
}
#endif


After that, I will have a structure like:
int config.a;
int config.b;
float config.c
etc.

How can I test for example if config.a is a normal number or a NAN ?

Many thanks for your explanation.

Best regards

4  Using Arduino / Programming Questions / Re: NEWBEE: About reading uninitialized number in EEPROM section. on: September 19, 2014, 11:59:42 am
Hello,
Thanks for your reply,

But I reed integer and float.

If I print some value with Serial.print, sometime I can read :  NAN
In this case,  I can't check if the value is in the range with
If (value < xx or value > yy).
So I have to add a check if the value is  a number or not (NAN -> not a number).

I reed the structure with the small header in attachment: EEPROMAnything.h
Many thanks for your help.

Thierry

5  Using Arduino / Programming Questions / NEWBEE: About reading uninitialized number in EEPROM section. on: September 19, 2014, 08:56:22 am
Hello,
I write a software that read and write number in the EEPROM section.

The first operation read all number.

The second operation check for every number (int or float) that the value is in the correct range.

But, when before the software write in the EEProm, the value are not initialised.
So, if the software read uninitialised number, it can be all but not a number.
I would like to check this case, because in this case I can check if the value is lower than xx or greather than yy.
How can I test if there is a number in the assigned value ?

Best regards,

Thierry

6  Using Arduino / Programming Questions / Re: has not been declared on: September 18, 2014, 09:04:34 am
Hello,
You are right, I removed all not relevant code for Arduino.

See in attachment the small code.

And a small header used to write in the EEprom section.

I will modify the call with the Print...

Many thanks,
Thierry
7  Using Arduino / Programming Questions / Re: has not been declared on: September 18, 2014, 08:42:43 am
Hello,
See in attachement the complete Arduino code.

Many thanks for your help !

Best regards

Thierry
8  Using Arduino / Programming Questions / Re: has not been declared on: September 18, 2014, 08:23:22 am
Hello,
In the Arduino code, the #include for MyToolbox is in line 22.

Many thanks for your help.

Thierry
9  Using Arduino / Programming Questions / Re: has not been declared on: September 18, 2014, 07:43:13 am
Hello,
Thanks for reading my post.
In the first part are MyToolBox.h.
I put it in attachement too, and Arduino code.

Thanks and bast regards.
Thierry
10  Using Arduino / Programming Questions / has not been declared on: September 18, 2014, 07:21:32 am
Hello,
I have the following error:
BatteryBox.h:72:13: error: 'MyToolBox' has not been declared
  void begin(MyToolBox _toolBox);

Here is the MyToolBox header class:
#ifndef MyToolBox_h
#define MyToolBox_h

#include <Arduino.h>
#include <BatteryBox.h>

#define DELAY 4000

 class MyToolBox {

 public:
   
    MyToolBox(char _version);
   
   MyToolBox(){};
   
   void begin(Print &print);
    ....
}

Here is the BatteryBox header file:
class BatteryBox
{
 public:
 
   BatteryBox(){};
   
   BatteryBox(char _version);
      
   void begin(MyToolBox _toolBox);
      
    void initHardware();
   
   boolean eepromInit(config_t *configuration, Print &print);
   
   void printCalibrationValues(config_t configuration);
   
 //private:
    MyToolBox toolBox;
   char version;
};

And the arduino code:

MyToolBox toolBox(1);
BatteryBox batteryBox(1);  // ne supporte pas un constucteur sans param├Ętres !

void setup() {
 Serial.begin(115200);
 while (!Serial); // Arduuino micro !
 toolBox.begin(Serial);
 batteryBox.begin(toolBox);
 batteryBox.initHardware(); 
...
}

The source files are in attachments.

Any help will be welcome and I will be very happy to understand my error.
Best regards to every readers !

Thierry
11  Using Arduino / Sensors / Re: ACS712 sparkfun breakout questions - too unstable to be useful? on: September 13, 2014, 01:46:33 pm
Hello,
I tried the ASS712 sparkfun breakout.
I see withe arduino the output is not stable.
I take my oscilloscope and observed the output: it's very noisy !
I put the scope a the output of the first stage, and strangely it's appear to be not noisy.
I see the noise is fast in regard with the integrator capacity C1 (0,1 uF).

I decide to put a small capacity in parallel with C1.
I try with 0,1 uF and the result is miraculous! no noisy on the scope and the value is stable with the arduino.

I think the original capacity is wrong.
I am not able to measure the effect with the bandwidth because I have to measure DC current.

Best regards

Thierry 
12  Community / Gigs and Collaborations / Re: Arduino programmer required! on: January 20, 2013, 04:41:26 am
Hello,
I can help you, but I don't live near Milan.
I am a Swiss man, and for now I live in France near Geneva.
With the use of all software facilities like skype, dropbox and other, maybe I can help you even far away from Milan.
Best regrards.
Thierry Vorms vormsty@gmail.com
13  Using Arduino / Programming Questions / Re: GSM code and SD code not working together on: November 15, 2012, 05:07:58 pm
Hello,

Can anybody tel my where to put the power supply for the icomsat module ?

Is that in the Arduino CPU connector ?

Is that on a connector in the Icomsat 1.1 module ?

Many thanks for your help.

Thierry
Pages: [1]