我想在我的MPU 6050上激活94 Hz带宽的低通滤波器。通过读取documentation(第13页),它表示通过将所选数字写入地址1A来激活适当的带宽(第6页)。
这在虚空设置中是否可以这样做?
Wire.beginTransmission(0x68);
Wire.write(0x1A); //
Wire.write(2); //
Wire.endTransmission(true);
亲切的问候,
→
答案 0 :(得分:2)
假设您只想设置带宽设置而不是FSYNC位,那么您应该写:
Building file: ./exec/main.cpp
Invoking: Linux G++ Compiler
g++ -std=c++0x -O0 -g3 -Wall -fmessage-length=0 -c "./exec/main.cpp" -o "build/exec/main.o" -MMD -MP -MT "build/exec/main.o" -MF "build/exec/main.d"
Finished building: ./exec/main.cpp
Building file: ./world/hello.cpp
Invoking: Linux G++ Compiler
g++ -std=c++0x -O0 -g3 -Wall -fmessage-length=0 -c "./world/hello.cpp" -o "build/world/hello.o" -MMD -MP -MT "build/world/hello.o" -MF "build/world/hello.d"
Finished building: ./world/hello.cpp
Building file: ./world/hello.cpp
Invoking: Linux G++ Compiler
g++ -std=c++0x -O0 -g3 -Wall -fmessage-length=0 -c "./world/hello.cpp" -o "build/hello/hello.o" -MMD -MP -MT "build/hello/hello.o" -MF "build/hello/hello.d"
Finished building: ./world/hello.cpp
Building Target: build/HelloWorld
Invoking: G++ Linker
CPP_SRCS: ./exec/main.cpp ./world/hello.cpp ./hello/hello.cpp
g++ -L/usr/local/lib build/exec/main.o build/world/hello.o build/hello/hello.o -o build/HelloWorld
build/hello/hello.o: In function `print_world()':
/home/otter/work/temp/maketest/./world/hello.cpp:4: multiple definition of `print_world()'
build/world/hello.o:/home/otter/work/temp/maketest/./world/hello.cpp:4: first defined here
build/exec/main.o: In function `main':
/home/otter/work/temp/maketest/./exec/main.cpp:7: undefined reference to `print_hello()'
collect2: error: ld returned 1 exit status
makefile:46: recipe for target 'build/HelloWorld' failed
make: *** [build/HelloWorld] Error 1
其他配置寄存器可以类似地设置,但您必须知道位打包字段并正确连接它们。