Download esp32/level2/gyroscope/src/main_esp.cpp from eunzee/PCEval: direct link, hf CLI and curl.
- Browser
- Download file 695 Bytes
-
https://huggingface.co/datasets/eunzee/PCEval/resolve/main/esp32/level2/gyroscope/src/main_esp.cpp
- Command line
-
hf download hf://datasets/eunzee/PCEval/esp32/level2/gyroscope/src/main_esp.cpp
-
curl -L -o main_esp.cpp https://huggingface.co/datasets/eunzee/PCEval/resolve/main/esp32/level2/gyroscope/src/main_esp.cpp
695 Bytes
| /** | |
| Measure 3-axis rotation with gyroscope | |
| 10 APR 2025 by Blind Author | |
| */ | |
| Adafruit_MPU6050 mpu; | |
| void setup(void) { | |
| Serial.begin(115200); | |
| while (!mpu.begin()) { | |
| Serial.println("MPU6050 not connected!"); | |
| delay(1000); | |
| } | |
| Serial.println("MPU6050 ready!"); | |
| } | |
| sensors_event_t event; | |
| void loop() { | |
| mpu.getGyroSensor()->getEvent(&event); | |
| Serial.print("X: "); | |
| Serial.print(event.gyro.x); | |
| Serial.print(", Y: "); | |
| Serial.print(event.gyro.y); | |
| Serial.print(", Z: "); | |
| Serial.print(event.gyro.z); | |
| Serial.println(" rad/s"); | |
| delay(500); | |
| } |