Browse Source

radio dziala

a.binder 5 năm trước cách đây
mục cha
commit
a8bb655608

+ 1 - 12
SE/stuff/P5_Automation_can-dev-res-working-1930/___SUBMODULES___/gyro_and_compass_test/LiquidCrystal_I2C_setup.h

@@ -35,18 +35,7 @@
 
     lcd.setCursor(0,3);
 
-    lcd.write(byte(0));
-  delay(2000);
-  lcd.write(byte(1));
-  delay(2000);
-  lcd.write(byte(2));
-  delay(2000);
-  lcd.write(byte(3));
-  delay(2000);
-  lcd.write(byte(4));
-  delay(2000);
-  lcd.write(byte(5));
-  delay(2000);
+  
 
 
 

+ 3 - 3
SE/stuff/P5_Automation_can-dev-res-working-1930/___SUBMODULES___/gyro_and_compass_test/compass__loop.h

@@ -7,11 +7,11 @@
      y = compass.getY();
      z = compass.getZ();
      
-      if (Math.atan2(y, x) >= 0) {
-        angle = Math.atan2(y, x) * (180 / Math.PI);
+      if (atan2(y, x) >= 0) {
+        angle = atan2(y, x) * (180 / PI);
       }
       else {
-        angle = (Math.atan2(y, x) + 2 * Math.PI) * (180 / Math.PI);
+        angle = (atan2(y, x) + 2 * PI) * (180 / PI);
       }
        
        

+ 2 - 14
SE/stuff/P5_Automation_can-dev-res-working-1930/___SUBMODULES___/gyro_and_compass_test/gyro_and_compass_test.ino

@@ -137,20 +137,8 @@ if ( t < millis() ) {
 //u8x8.drawTile(0, U8LOG_HEIGHT+1, 1, tiles);
 
 #if defined(HAS_QMC5883LCompass)
-      int x, y, z;
-   Serial.println();
-     // Read compass values
-     compass.read();
-   
-     x = compass.getX();
-     y = compass.getY();
-     z = compass.getZ();
-  //  SPFT(compass);
-  //  SPFT2(X,x);
-  //   SPFT(Y);
-  //   SP(y);
-  //   SPFT(Z);
-  //   SP(z);
+        #include "compass__loop.h"
+
 #endif
 #if defined(HAS_MPU6050)
             accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

+ 1 - 1
SE/stuff/P5_Automation_can-dev-res-working-1930/___SUBMODULES___/gyro_and_compass_test/radio__loop.h

@@ -1,2 +1,2 @@
-const char text[] = "Hello World";
+const char text[] = "testP5";
 radio.write(&text, sizeof(text));