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.
main.cpp
00001 #include "mbed.h" 00002 00003 RawSerial pc(USBTX, USBRX); 00004 AnalogIn Ain1(p19);// --- AttoPilot "V" 00005 AnalogIn Ain2(p20);// --- AttoPilot "I" 00006 00007 int VRaw; //This will store our raw ADC data 00008 int IRaw; 00009 float VFinal; //This will store the converted data 00010 float IFinal; 00011 00012 int main() 00013 { 00014 while(1) { 00015 VRaw = Ain1.read_u16(); 00016 IRaw = Ain2.read_u16(); 00017 00018 //Conversion 00019 VFinal = VRaw/49.44; //45 Amp board 00020 //VFinal = VRaw/12.99; //90 Amp board 00021 //VFinal = VRaw/12.99; //180 Amp board 00022 00023 IFinal = IRaw/14.9; //45 Amp board 00024 //IFinal = IRaw/7.4; //90 Amp board 00025 //IFinal = IRaw/3.7; //180 Amp board 00026 pc.printf("%.1 Volts\r\n",VFinal); 00027 pc.printf("%.1f Amps\r\n\r\n\r\n",IFinal); 00028 wait(0.2); 00029 } 00030 }
Generated on Sat Jul 16 2022 23:35:51 by
1.7.2