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
- Committer:
- takeuchi
- Date:
- 2011-09-20
- Revision:
- 0:f26e33453b7e
File content as of revision 0:f26e33453b7e:
//Gyro test02
// Akidukidensi AE-GYRO-SMD
#include "mbed.h"
#include "TextLCD0420.h"
#define ON 1
#define OFF 0
DigitalOut mled0(LED1);
DigitalOut mled1(LED2);
AnalogIn gyro1_adc(p16);
AnalogIn gyro2_adc(p17);
TextLCD lcd(p24, p25, p26, p27, p28, p29, p30,20,4); // rs, rw, e, d0, d1, d2, d3
int main() {
float gy1_data,gy2_data;
lcd.cls();
lcd.locate(0,0);
lcd.printf("*** Gyro test02 ***\n");
while(1){
gy1_data=gyro1_adc.read();
gy2_data=gyro2_adc.read();
lcd.locate(0,1);
lcd.printf("Gyro1:%2.5f %2.2fV",gy1_data,gy1_data*3.3);
lcd.locate(0,2);
lcd.printf("Gyro2:%2.5f %2.2fV",gy2_data,gy2_data*3.3);
}//while
}//main