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.
Fork of ece4180_lab4_ACS712 by
main.cpp
00001 #include <mbed.h> 00002 #include "ACS712.h" 00003 00004 int main() 00005 { 00006 // Connect the sensor analog output pin to mbed's AnalogIn pin 00007 ACS712 dev(p18); 00008 // Connect mbed to pc's USB port 00009 Serial pc(USBTX, USBRX); 00010 00011 pc.printf("Sensor Log: \n\n\r"); 00012 00013 while (1) { 00014 // Read current from sensor and output to pc terminal 00015 pc.printf("Sensor Value: %2.2f A\n\r", float(dev)); 00016 wait(1); 00017 } 00018 00019 }
Generated on Tue Jul 12 2022 18:21:01 by
1.7.2
