Recent Changes - Search:

ENTER NEW DAILY DATA HERE:

PmWiki

pmwiki.org

edit SideBar

November11-Gyroscope

Testing Gyroscope

Last time, I couldn't get right values from the sensor. So this time, I added 10k ohm registers for each pin and now I can get very stable values. But there's still no response from the orange pin which isn't really need. There's no case of the orange pin can be on. That means we only need 3 input pins for gyroscope. Then, we don't need to use shift register or multiplexer.Nice! ;)

No..... Pin 13 is connected to 220ohm register for a LED. I think we may only need 2pins for a gyroscope. Red and Green. When the elmo is standing both pins are HIGH, when it's on its stomach Red is LOW and Green is HIGH, and when it's on its back Red is HIGH and Green is LOW. So.. maybe we can only use 2pins.....?

  • Please don't delete arduino-0011. We can open multiple windows of arduino. It helps a lot when we want to check other codes.

// 1111 soyoung

 int positionRed = 7;
 int positionOrange = 6;
 int positionYellow = 5;
 int positionGreen = 4;

 int red = 0; // bend 90 & stomach
 int orange = 0; // totally bended 
 int yellow = 0; // stand
 int green = 0; //back


 void setup(){
   pinMode(positionRed, INPUT);
   pinMode(positionOrange, INPUT);
   pinMode(positionYellow, INPUT);
   pinMode(positionGreen, INPUT);

   Serial.begin(9600);   
 }

 void loop(){
 red = digitalRead(positionRed);
 orange = digitalRead(positionOrange);
 yellow = digitalRead(positionYellow);
 green = digitalRead(positionGreen);

 Serial.print("red: ");
 Serial.print(red);
 Serial.print(" orange: ");
 Serial.print(orange);
 Serial.print(" yellow: ");
 Serial.print(yellow);
 Serial.print(" green: ");
 Serial.println(green);

 }
Edit - History - Print - Recent Changes - Search
Page last modified on November 11, 2008, at 03:34 PM