Takeuchi Kouichi / Mbed 2 deprecated 2bk0819_Gyro_test02

Dependencies:   mbed

Revision:
0:f26e33453b7e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 20 03:38:47 2011 +0000
@@ -0,0 +1,31 @@
+//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      
+