エレキジャックweb mbed入門 ジャイロとサーボを動かそう 課題1です。

Dependencies:   mbed

main.cpp

Committer:
takeuchi
Date:
2011-09-20
Revision:
0:a08aab843025

File content as of revision 0:a08aab843025:

//Gyro test01
// 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;
  lcd.cls();
  lcd.locate(0,0);
  lcd.printf("*** Gyro test01***\n");         

  while(1){   
      gy1_data=gyro1_adc.read();
      lcd.locate(0,1);
      lcd.printf("Gyro1:%2.5f",gy1_data);
  }//while    
}//main