hi guys
i have Problem. How do I add variables in tram(bus)
Open the door to the bus and invite variables aboard with a smile.
If that is not helpful then perhaps you can make the question more clear.
#include <Adafruit_MPU6050.h>
Adafruit_MPU6050 mpu;
Adafruit_Sensor *mpu_temp, *mpu_accel, *mpu_gyro;
void setup(void) {
Serial.begin(115200);
while (!Serial)
delay(10); // will pause Zero, Leonardo, etc until serial console opens
Serial.println("Adafruit MPU6050 test!");
if (!mpu.begin()) {
Serial.println("Failed to find MPU6050 chip");
while (1) {
delay(10);
}
}
Serial.println("MPU6050 Found!");
mpu_temp = mpu.getTemperatureSensor();
mpu_temp->printSensorDetails();
mpu_accel = mpu.getAccelerometerSensor();
mpu_accel->printSensorDetails();
mpu_gyro = mpu.getGyroSensor();
mpu_gyro->printSensorDetails();
}
void loop() {
// /* Get a new normalized sensor event */
sensors_event_t accel;
sensors_event_t gyro;
sensors_event_t temp;
mpu_temp->getEvent(&temp);
mpu_accel->getEvent(&accel);
mpu_gyro->getEvent(&gyro);
Serial.print("\t\tTemperature ");
Serial.print(temp.temperature);
Serial.println(" deg C");
/* Display the results (acceleration is measured in m/s^2) */
Serial.print("\t\tAccel X: ");
Serial.print(accel.acceleration.x);
Serial.print(" \tY: ");
Serial.print(accel.acceleration.y);
Serial.print(" \tZ: ");
Serial.print(accel.acceleration.z);
Serial.println(" m/s^2 ");
/* Display the results (rotation is measured in rad/s) */
Serial.print("\t\tGyro X: ");
Serial.print(gyro.gyro.x);
Serial.print(" \tY: ");
Serial.print(gyro.gyro.y);
Serial.print(" \tZ: ");
Serial.print(gyro.gyro.z);
Serial.println(" radians/s ");
Serial.println();
delay(100);
I want to add Accel X Accel Y Acell Z and gyro X Y Z in a bus
can you help me
Do you mean an array?
Please read the forum guidelines (linked in previous post) to see how to properly post code.
Do not post images of code.
Please read the forum guidelines (linked in previous post) to see how to properly post code.
In microcontroller world a bus is a physical grouping of conductors as in the I2C bus or SPI bus. I so not know what you mean by bus in your context.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.