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
- Committer:
- Danyal
- Date:
- 2019-02-12
- Revision:
- 1:fc8fd0a0c09d
- Parent:
- 0:3a42b53185b8
File content as of revision 1:fc8fd0a0c09d:
/**
Ausgabe der Spannung in Sternen
*/
#include "mbed.h"
AnalogIn input(A0);
Serial pc(SERIAL_TX, SERIAL_RX);
int main() {
uint16_t inputWert = 0x0000;
while (1) {
inputWert = input.read_u16();
pc.printf("sample value: 0x%04X\n",inputWert);
wait_ms(10);
pc.printf("Spannung\n");
if(inputWert != 0x0000) {
if (inputWert <= 0x5555){
pc.printf("<***** >\n");}
if(inputWert >= 0x5555 && inputWert <= 0xAAAA){
pc.printf("<***** ***** >\n");}
if(inputWert >= 0xAAAA){
pc.printf("<***** ***** *****>\n");}
} else {
pc.printf("< >\n");}
pc.printf("\n");
}
}