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.
Dependents: quadOmni_yanagi R1370 gyro_test wheel_test3 wheel_test3 ... more
Fork of R1307 by
R1370.cpp
00001 #include "R1370.h" 00002 00003 R1370::R1370(PinName Tx,PinName Rx):serial(Tx,Rx) 00004 { 00005 R1370::serial.baud(115200); 00006 } 00007 int R1370::update() 00008 { 00009 int i; 00010 if((data[0]=serial.getc())==0xAA){ 00011 for(i = 1;i < 15;i++) { 00012 data[i] = serial.getc(); 00013 } 00014 angle = ((data[3]&0xFF)|((data[4]<<8)&0xFF00)); 00015 gyro = angle/100.0; 00016 return 0; 00017 }else{ 00018 return 1; 00019 } 00020 } 00021 float R1370::getAngle() 00022 { 00023 return gyro; 00024 }
Generated on Sun Jul 24 2022 09:55:27 by
1.7.2
