Tony Lin / Mbed 2 deprecated BX-car_s

Dependencies:   mbed-rtos mbed

Fork of BX-car_2 by Tony Lin

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pot.cpp Source File

pot.cpp

00001 
00002 #include "mbed.h"
00003 #include "pot.h"
00004 
00005 
00006 
00007 BX_pot::BX_pot(char t){
00008     
00009     
00010     switch (t){
00011        case '1':  
00012          pot_in = new AnalogIn (PTB3);
00013        break;
00014        case '2':
00015          pot_in = new AnalogIn (PTB2);
00016        break;
00017     }
00018     
00019     
00020     
00021     }
00022     
00023  float  BX_pot::read(void){
00024      
00025      
00026      
00027   return    pot_in->read();
00028      
00029      
00030 }