test AnalogIn_Diff.lib for board K64F
Dependencies: AnalogIn_Diff_ok mbed
main.cpp
- Committer:
- fblanc
- Date:
- 2014-12-05
- Revision:
- 8:1aae5c9ae98f
- Parent:
- 7:e1a6763c6da2
- Child:
- 9:a9a333f3e760
File content as of revision 8:1aae5c9ae98f:
/* * Copyright (c) 2014 LAAS-CNRS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "mbed.h" #include "AnalogIn_Diff.h" #define VERSION "AnalogIn_Diff_helloworld_2014_12_02" #define CIBLE "K64F" Serial pc(USBTX, USBRX); Ticker flipperADC; bool flag_TX=false; void flipADC() { flag_TX=true; } int main() { pc.printf("%s %s\r\n",VERSION,CIBLE); flipperADC.attach(&flipADC, 1.0); AnalogIn_Diff adc_diff(ADC_DIFF(0,1)); while (true) { if(flag_TX) { pc.printf("V= %f \r\n",adc_diff.read()*6.6); flag_TX=false; } } }