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 hmc5883l_test by
main.cpp
00001 #include "mbed.h" 00002 #include "HMC5883L.h" 00003 00004 //秋葉原の秋月電子で買ったHMC5883LのDIP化センサー(600円くらい)をLPC1768で試した。 00005 //センサー裏を半田で結線(SDL,SDAをプルアップ)しないと動作しない。 00006 //これに気が付かないで芭蕉と2人で1日中悩んだ(笑) 00007 00008 //琵琶湖で飛行している際、3kmを超えるとに目標物が見当たらないので、この方位センサーを用いて 00009 //パイロットに機首方向を教えることを想定している。 00010 00011 Serial pc(USBTX, USBRX); 00012 HMC5883L compass(p28, p27); 00013 00014 int main() { 00015 compass.init(); 00016 while(1) { 00017 pc.printf("raw=%f\r\n",compass.getHeadingXYDeg()); 00018 wait(0.2); 00019 } 00020 }
Generated on Sun Jul 24 2022 12:12:31 by
1.7.2
