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.
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));
}
}