Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
AnalogIO_1ch/AdcInternal.hpp
- Committer:
- MikamiUitOpen
- Date:
- 2015-08-09
- Revision:
- 5:0af77f24af2a
- Parent:
- 0:b027da9cfc23
File content as of revision 5:0af77f24af2a:
//------------------------------------------------------
// Class for internal ADC for signal processing
//
// Copyright (c) 2014 MIKAMI, Naoki,  2014/06/17
//------------------------------------------------------
#ifndef ADC_INTERNAL_HPP
#define ADC_INTERNAL_HPP
#include "mbed.h"
namespace Mikami
{
    class Adc
    {
    public:
        explicit Adc(PinName pin = A0)
                    : adc_(pin) {}
        float Read()
            { return 2*(adc_.read() - 0.5f); }
    private:
        Adc(const Adc&);
        Adc& operator=(const Adc&);
        AnalogIn adc_;
    };
}
#endif  // ADC_INTERNAL_HPP