This program displays heart rate and time between heart beats on LCD, prints it to a USB serial port, print it to a bluetooth serial port and store it on a USB mass storage device. The program has two interrupt routines: 1.Every 1ms a counter is increased with one, 2. On every heart beat the counter is value copied. In the main loop the beats per minute are calculated. Ext.Modules:- Polar RMCM-01 heart rate module connected to pin8. - 2x16 LCD - a RF-BT0417CB bluetooth serial device connected to p27 and p28 - an USB mass storage device

Dependencies:   TextLCD mbed

MSCFileSystem.h

Committer:
jrsikken
Date:
2011-01-04
Revision:
2:e660e68a91fa
Parent:
1:8b001f936bb0

File content as of revision 2:e660e68a91fa:

/* USB Mass Storage device file system
 * Copyrigh (c) 2010, Igor Skochinsky
 * based on SDFileStorage
 * Copyright (c) 2008-2009, sford
 */
 
#ifndef MSCFILESYSTEM_H
#define MSCFILESYSTEM_H

#include "mbed.h"
#include "FATFileSystem.h"

/* Class: MSCFileSystem
 *  Access the filesystem on an attached USB mass storage device (e.g. a memory stick)
 *
 * Example:
 * > MSCFileSystem msc("msc");
 * > 
 * > int main() {
 * >     FILE *fp = fopen("/msc/myfile.txt", "w");
 * >     fprintf(fp, "Hello World!\n");
 * >     fclose(fp);
 * > }
 */
class MSCFileSystem : public FATFileSystem {
public:

    /* Constructor: MSCFileSystem
     *  Create the File System for accessing a USB mass storage device
     *
     * Parameters:
     *  name - The name used to access the filesystem
     */
    MSCFileSystem(const char* name);
    virtual int disk_initialize();
    virtual int disk_write(const char *buffer, int block_number);
    virtual int disk_read(char *buffer, int block_number);    
    virtual int disk_status();
    virtual int disk_sync();
    virtual int disk_sectors();

protected:

    int initialise_msc();
    uint32_t _numBlks;
    uint32_t _blkSize;
};

#endif