flexSensor + ledPWM + bluetooth

Dependencies:   Map

main.cpp

Committer:
airaen0129
Date:
2019-07-19
Revision:
0:5f93dfb618bf
Child:
1:0e180bcfcdae

File content as of revision 0:5f93dfb618bf:

/* mbed Microcontroller Library
 * Copyright (c) 2018 ARM Limited
 * SPDX-License-Identifier: Apache-2.0
 */

#include "mbed.h"
#include "Map.hpp"

AnalogIn flexSensor(PA_7);
Map map(0.9, 0.99999999, 0, 10000);
int main() {
    while (true) {
        float analogValue = flexSensor;
        
        wait(0.5);
        printf("%d\n", (int)map.Calculate(analogValue));
    }
}