Log measurements on SD card added on DISCO-L476VG board acceleration, omega, compass & 5 Analog values

Dependencies:   BSP_DISCO_L476VG COMPASS_DISCO_L476VG ConfigFile GYRO_DISCO_L476VG SDFileSystem mbed

Committer:
flowh
Date:
Sat Feb 13 14:48:40 2016 +0000
Revision:
2:f53340e49cc0
Parent:
1:e1f3b4b8b99b
Save on SD Card at up to at least 100Hz Acceleration, rotation velocity, compass and 5 AI

Who changed what in which revision?

UserRevisionLine numberNew contents of line
flowh 1:e1f3b4b8b99b 1
flowh 1:e1f3b4b8b99b 2 /* --------------------------------------------------------
flowh 1:e1f3b4b8b99b 3
flowh 2:f53340e49cc0 4 DISCOLogger
flowh 1:e1f3b4b8b99b 5
flowh 2:f53340e49cc0 6 for DISCO-L476VG
flowh 1:e1f3b4b8b99b 7 Version 2.0 February 12th 2016 Florent HADDAD
flowh 1:e1f3b4b8b99b 8
flowh 1:e1f3b4b8b99b 9
flowh 2:f53340e49cc0 10 Save on SD card at up to at least 100Hz
flowh 1:e1f3b4b8b99b 11 Acceleration,
flowh 1:e1f3b4b8b99b 12 Gyroscope,
flowh 1:e1f3b4b8b99b 13 Compass
flowh 1:e1f3b4b8b99b 14 5 Analog input (PA_0..PA_5 except PA_4)
flowh 1:e1f3b4b8b99b 15
flowh 1:e1f3b4b8b99b 16 SdCard connected on :
flowh 1:e1f3b4b8b99b 17 PE_12 to PE_15 for SPI
flowh 1:e1f3b4b8b99b 18 3.3V
flowh 1:e1f3b4b8b99b 19
flowh 1:e1f3b4b8b99b 20 Start/Stop switch between 3V and PD_0
flowh 1:e1f3b4b8b99b 21
flowh 1:e1f3b4b8b99b 22 Green led blinks during log
flowh 1:e1f3b4b8b99b 23
flowh 2:f53340e49cc0 24 Requires on sdcard file "index.txt" with folowing line : Index=0
flowh 2:f53340e49cc0 25 Index.txt defines the next file index name to be written.
flowh 2:f53340e49cc0 26 Value written in Index.txt will change after each log.
flowh 2:f53340e49cc0 27
flowh 1:e1f3b4b8b99b 28 tested up to 100Hz acquisition frequency
flowh 1:e1f3b4b8b99b 29 For any unknown reason, may need to be downloaded twice to run properly !
flowh 1:e1f3b4b8b99b 30
flowh 1:e1f3b4b8b99b 31
flowh 1:e1f3b4b8b99b 32 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
flowh 1:e1f3b4b8b99b 33 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
flowh 1:e1f3b4b8b99b 34 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
flowh 1:e1f3b4b8b99b 35 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
flowh 1:e1f3b4b8b99b 36 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
flowh 1:e1f3b4b8b99b 37
flowh 1:e1f3b4b8b99b 38
flowh 1:e1f3b4b8b99b 39 -------------------------------------------------------*/
flowh 1:e1f3b4b8b99b 40
flowh 1:e1f3b4b8b99b 41
flowh 0:0861bf46efe4 42 #include "mbed.h"
flowh 0:0861bf46efe4 43 #include "DefinitionIO.h"
flowh 0:0861bf46efe4 44
flowh 0:0861bf46efe4 45
flowh 0:0861bf46efe4 46
flowh 0:0861bf46efe4 47 int main()
flowh 0:0861bf46efe4 48 {
flowh 0:0861bf46efe4 49
flowh 1:e1f3b4b8b99b 50 Init(); //initialization of I/O
flowh 1:e1f3b4b8b99b 51 Mesures.Update(); //required to start safely IOs
flowh 0:0861bf46efe4 52
flowh 1:e1f3b4b8b99b 53
flowh 1:e1f3b4b8b99b 54 while(1)
flowh 1:e1f3b4b8b99b 55 {
flowh 1:e1f3b4b8b99b 56 //main loop is actually performed in a ticker defined in "DefinitionIO/Init()"
flowh 0:0861bf46efe4 57 }
flowh 1:e1f3b4b8b99b 58 }