Hi all. I hope I'm doing this the right way .. it's my very first Post here.
I have a similar problem, only with a proven correct module, with a 5V regulator included. So that can't be the problem, although my problem is very different. Allow me to explain.
I get the data from a 'struct' string sent via an nRF24L01+ bluetooth module. I'm sure you all know about these wonderful little modules, and I ge the data very well. I've made the sketch to its simplest not to get confusing. I get a 'short' (the year) although there are much more data involved in the original sketch.
I try to save it the following way ... (My struct is called 'Station' and contains, for this purpose, one (1) variable of type 'short'. But the original 'struct' contains a mix of 'short' and 'float' variables). So here goes ...
void Save_Data () // Write variables on SD Card
Log_File = SD.open ("TEST_LOG.TXT", FILE_WRITE);
... and I can read it back just fine with a text editor. The problem is when I try to read it back and store the read values back into variables (of same types; shorts and floats). In this instance, I get the ASCII values of '2', then '0' then '1' and finally '9' ('50484957'). I tried writing the data so many ways before I came here, taking tips from many Boards and Forums, but nothing seems to solve my problem. I tried converting to Strings, but I have 'floats' that won't convert and all sorts of problem .. it's very frustrating.
Oh! I was forgetting to include the code I wrote to read the data. Here it is ..
void Read_Data () // Read Data from File
Log_File = SD.open ("TEST_LOG.TXT", FILE_READ);
Year = Serial.write (Log_File.read ()); // Year is of type 'short'
I'm sure there is a simple way of doing this but, being very green on Arduino, I fail to grasp some concept and this leads me nowhere. Is it the way I write the data or the way I read it .. or both, for that matter! Hahaha!
Is there someone here that could lead me into doing it the right way so I can go on in my Wireless Weather Station project (Yes, another one! Hahaha!). Thank you in advance for any help.
Best regards and have a great evening.