Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
/* g++ -g -Wall stDev.cpp -o stDev `pkg-config --cflags --libs opencv4` */ #include
#include
#include
#include
#include
#include
// Library to include for // drawing shapes #include
#include
using namespace cv; using namespace std; int num=0; int val=0; double sumxyz=0.0; double avg=0.0; double stDev=0.0; double err=0.0; ifstream myFile_Handler; int ReadSensor(string FileName); int main(){ string FileX="/sys/bus/iio/devices/iio:device2/in_accel_x_raw"; string FileY="/sys/bus/iio/devices/iio:device2/in_accel_y_raw"; string FileZ="/sys/bus/iio/devices/iio:device2/in_accel_z_raw"; Mat image(300, 700, CV_8UC3,Scalar(0, 0, 0)); //creates a new blank image // Check if the image is created successfully if (!image.data) { cout << "Could not open or find" << " the image"; return 0; } //assume variant coords +/- 50 /* for (;;){ sumxyz=ReadSensor(FileX) + ReadSensor(FileY) + ReadSensor(FileZ) ; //cout << " X: " << ReadSensor(FileX) << " Y: " << ReadSensor(FileY) << " Z: "<< ReadSensor(FileZ) << endl; cout << " XYZ : " <
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)