POti einlesen und an der Seriellen Schnittstelle formatiert den Wert ausgeben Analog/Digital

Dependencies:   mbed

main.cpp

Committer:
happy_alien
Date:
2020-01-13
Revision:
0:b0e658209625

File content as of revision 0:b0e658209625:

#include "mbed.h"

Serial pc(USBTX, USBRX);
AnalogIn poti(p15);
void Test1();
void Test2();


int main()
{  
    
    pc.baud(115200 );

    Test2(); 
    
    
}
void Test2()
{ int val=0;
  while(1)
    {   val=poti.read_u16()>>6;
        pc.printf("Poti %i \n",val);
        wait_ms(300);
    }   
}

void Test1()
{ int val =0;
  while(1)
    {   
        pc.printf("Hallo %i \n",val++);
        wait_ms(1000);
    }   
}