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: mbed
main.cpp@0:9b9b318a5f0d, 2021-02-22 (annotated)
- Committer:
- rafaelff3
- Date:
- Mon Feb 22 16:17:57 2021 +0000
- Revision:
- 0:9b9b318a5f0d
- Child:
- 1:adcde9f41a67
V0;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rafaelff3 | 0:9b9b318a5f0d | 1 | #include "mbed.h" |
rafaelff3 | 0:9b9b318a5f0d | 2 | |
rafaelff3 | 0:9b9b318a5f0d | 3 | AnalogIn freio (A0); |
rafaelff3 | 0:9b9b318a5f0d | 4 | |
rafaelff3 | 0:9b9b318a5f0d | 5 | float sinal = 0; |
rafaelff3 | 0:9b9b318a5f0d | 6 | float pressao = 0; |
rafaelff3 | 0:9b9b318a5f0d | 7 | |
rafaelff3 | 0:9b9b318a5f0d | 8 | int main() |
rafaelff3 | 0:9b9b318a5f0d | 9 | { |
rafaelff3 | 0:9b9b318a5f0d | 10 | sinal = freio.read(); // Leitura vai de 0.2 (0 bar) a 1 (10 bar) |
rafaelff3 | 0:9b9b318a5f0d | 11 | pressao = (sinal - 0.2)/0.8*10 |
rafaelff3 | 0:9b9b318a5f0d | 12 | } |