Go to advanced search

by dsyleixa123
Fri Dec 21, 2018 6:51 pm
Forum: C/C++
Topic: accessing global 2-dim arrays from an object
Replies: 10
Views: 1472

Re: accessing global 2-dim arrays from an object

yes, great, I see! Actually that is similar to how I once initialized my local array list in the menu object.
Thank you very much!
by dsyleixa123
Fri Dec 21, 2018 9:38 am
Forum: C/C++
Topic: accessing global 2-dim arrays from an object
Replies: 10
Views: 1472

Re: accessing global 2-dim arrays from an object

thank you! Unfortunately the code has to be designed to run also on Arduinos where std::string and other libs are not available, and even for the Arduino String class it will need too much memory. So I will have to look for a plain C solution to pass my external (global) pre-initialized char lists[n...
by dsyleixa123
Sat Dec 15, 2018 10:33 am
Forum: C/C++
Topic: accessing global 2-dim arrays from an object
Replies: 10
Views: 1472

Re: accessing global 2-dim arrays from an object

thanks! actually I wanted to have char list[6][11] // 6 entries of a 11-char long cstring each initialized to char list[6][11]= {"Line0","Line1","ESC","next menu>","yes","no"}; // again should be 6 entries of a 11-char long cstring each but I was not able to pass that flawlessly to my object constru...
by dsyleixa123
Sat Dec 15, 2018 9:11 am
Forum: C/C++
Topic: accessing global 2-dim arrays from an object
Replies: 10
Views: 1472

Re: accessing global 2-dim arrays from an object

thank you too! But tbh, that is weird - I actually thought when having declared char * mlist[11] or even char line[11] that each entry then reserves a length of 11 chars to each entry - why else am I supposed to reserve a 11 char array list or line instead? Initializing an array of a given size (e.g...
by dsyleixa123
Fri Dec 14, 2018 2:42 pm
Forum: C/C++
Topic: accessing global 2-dim arrays from an object
Replies: 10
Views: 1472

Re: accessing global 2-dim arrays from an object

I use C rather than C++ but I think the same applies - Your data is stored packed together, so if you want to extend an existing string you can't without overwriting the data that follows that string. Thank you for clarification, I already feared that - presumably there will be no way to order gpp ...
by dsyleixa123
Fri Dec 14, 2018 10:29 am
Forum: C/C++
Topic: accessing global 2-dim arrays from an object
Replies: 10
Views: 1472

accessing global 2-dim arrays from an object

hello, I am running into an issue accessing global 2-dim arrays from an object. tbh, the C+++ program is currently just in kind of "Arduino-state", but once having finished it, I also want to use it by my Raspi. The program is about designing a multilayer-menu system. The menu entries are defined li...
by dsyleixa123
Fri Dec 14, 2018 9:51 am
Forum: C/C++
Topic: How to detect if a program is running via c++ code
Replies: 11
Views: 1491

Re: How to detect if a program is running via c++ code

thanks to all for your clarifications!
by dsyleixa123
Thu Dec 13, 2018 1:29 pm
Forum: C/C++
Topic: How to detect if a program is running via c++ code
Replies: 11
Views: 1491

Re: How to detect if a program is running via c++ code

ps -ef | grep programname | wc -l This bash command lists all running processes, find all lines with "programname" and count the lines.. if this return 1 or more, your program is running. So one way of solving this is to run this command with system() or popen() and get the result. Another way is t...
by dsyleixa123
Tue Dec 04, 2018 6:26 pm
Forum: C/C++
Topic: create a class which creates an array[a][b] of arbitrary sizes by the constructor
Replies: 4
Views: 1329

Re: create a class which creates an array[a][b] of arbitrary sizes by the constructor

indeed, I had to rearrange some lines but it seems to work! thanks to all! class tMenu { protected: int16_t MENULEN, CAPTLEN; public: char **list; tMenu (int16_t menulen, int16_t captlen) // constructor { MENULEN = menulen; CAPTLEN = captlen; list = new char*[menulen]; for(int i = 0; i < menulen; i+...
by dsyleixa123
Tue Dec 04, 2018 10:45 am
Forum: C/C++
Topic: create a class which creates an array[a][b] of arbitrary sizes by the constructor
Replies: 4
Views: 1329

Re: create a class which creates an array[a][b] of arbitrary sizes by the constructor

yes, thank you, I see, but can I access it then as shown directly, without extra calculations, , e.g. by

tMenu mymenu(10,20);
mymenu.list[5][0]='>';
by dsyleixa123
Tue Dec 04, 2018 8:58 am
Forum: C/C++
Topic: create a class which creates an array[a][b] of arbitrary sizes by the constructor
Replies: 4
Views: 1329

create a class which creates an array[a][b] of arbitrary sizes by the constructor

hi, I want to create a class which creates an array[a] of arbitrary sizes by the constructor. I now found a way to create a 1-dim array by assert, but I always fail by trying to create a 2-dim array. Which would be the correct way to do that? #include <cassert> class tMenu { protected: char * list; ...
by dsyleixa123
Wed Nov 28, 2018 12:32 pm
Forum: Beginners
Topic: correct backup command?
Replies: 9
Views: 1072

Re: correct backup command?

thanks a lot, these were the crucial statements: Then this command: rsync -a a b produces b/a/foo, whereas this command: rsync -a a/ b produces b/foo. The presence or absence of a trailing slash on the destination argument (b, in this case) has no effect. I also meanwhile understood that -z in fact ...
by dsyleixa123
Tue Nov 27, 2018 9:17 am
Forum: Beginners
Topic: correct backup command?
Replies: 9
Views: 1072

Re: correct backup command?

where can I find an understandable (beginner-friendly) list and description about all rsync parameters? the man page and https://ss64.com/bash/rsync_options.html are just puzzling me... :roll:
by dsyleixa123
Mon Nov 26, 2018 5:42 pm
Forum: Beginners
Topic: correct backup command?
Replies: 9
Views: 1072

Re: correct backup command?

ok, thank you so far!
tbh, I thought the z parameter was more about keeping all file attributes... :?
hmmmh.
Can someone else perhaps bring some light into this riddle about slashes and parameters? :roll:
by dsyleixa123
Mon Nov 26, 2018 9:25 am
Forum: Beginners
Topic: correct backup command?
Replies: 9
Views: 1072

Re: correct backup command?

thank you about rsync! tbh, I am unsure about the final slashes and the cmd line parameters: if I want to mirror dir1 to dir2 including all files and subdirs, without any extra directory level, and keep all file rights, is it rsync -avz --delete /source/dir1/ /destination/dir2/ or rsync -avz --delet...
by dsyleixa123
Sun Nov 25, 2018 6:50 pm
Forum: Beginners
Topic: correct backup command?
Replies: 9
Views: 1072

correct backup command?

hello, I have an USB drive for backup/restore, and the following directories which have to be synced: /media/pi/USB120DRV/sav/raspi_sav/raspiProgs /home/pi/raspiProgs I want to copy all files from the first raspiProgs dir to the 2nd raspiProgs dir. 1st question: is the following command correct for ...
by dsyleixa123
Sat Oct 20, 2018 2:24 pm
Forum: C/C++
Topic: C++ library to use with Adafruit SSD1306 I2C LCD
Replies: 5
Views: 3396

Re: C++ library to use with Adafruit SSD1306 I2C LCD

hi,
I once found this one which worked fine to me so far:
https://github.com/hallard/ArduiPi_OLED
by dsyleixa123
Thu Sep 27, 2018 8:59 am
Forum: C/C++
Topic: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?
Replies: 22
Views: 2914

Re: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?

I tried the DMP6 example already for my Arduino, but it does not even compile for that! https://github.com/jrowberg/i2cdevlib/blob/master/Arduino/MPU6050/examples/MPU6050_DMP6/MPU6050_DMP6.ino Bibliothek I2Cdev im Ordner: D:\Arduino\portable\libraries\I2Cdev (legacy) wird verwendet Bibliothek Wire i...
by dsyleixa123
Thu Sep 27, 2018 7:45 am
Forum: C/C++
Topic: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?
Replies: 22
Views: 2914

Re: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?

come on, don't insult me of being lazy!
I looked to your link, and even to the MPU6050 examples for Arduinos, but no example can be found which writes yaw (or even pitch an roll) as an output to Serial().
https://github.com/jrowberg/i2cdevlib
by dsyleixa123
Thu Sep 27, 2018 7:17 am
Forum: C/C++
Topic: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?
Replies: 22
Views: 2914

Re: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?

@bensimmo:
I didn't ask for the advice "do it yourself" or "search github" - libs I found are incomplete or don't work or are not suitable for the Pi.

So just a link to a complete and working lib is requested.
by dsyleixa123
Wed Sep 26, 2018 8:34 pm
Forum: C/C++
Topic: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?
Replies: 22
Views: 2914

Re: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?

I have to disagree. I have a CMPS11 which provides (absolute compass heading, pitch, and roll, and it works like a charm in non-magnetic environments, without any additional calculatations. Unfortunately I have randomly heavy ferromagnetic and electromagnetic noise, so I can't use the magnetic compa...
by dsyleixa123
Wed Sep 26, 2018 6:49 pm
Forum: C/C++
Topic: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?
Replies: 22
Views: 2914

Re: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?

thank you for your efforts, but I'm as confused as before, if not even more.
I think I have to get a complete MPU6050 lib, providing filtered yaw+pitch+roll, ready to use, and working out of the box. I can't do that by my own, honestly.
by dsyleixa123
Wed Sep 26, 2018 4:27 pm
Forum: C/C++
Topic: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?
Replies: 22
Views: 2914

Re: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?

thank you, I thought you meant all the files from here: https://github.com/ZiCog/madgwick.js/tree/master but what is a Quaterniond structure? As to read the the basic values from the MPU6050 via i2c: will this code work, reading all values in the while(1) loop and then processing them by certain Mad...
by dsyleixa123
Wed Sep 26, 2018 11:30 am
Forum: C/C++
Topic: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?
Replies: 22
Views: 2914

Re: which C/C++ lib for MPU6050 can retrieve yaw additional to pitch and roll?

hmm, I have no idea about quaternions, Kalman filters, and raw values, I am no mathematician and no computer scientist. In the Madgwick link I am completely overburdened by those dozens of files: which are the ones I need to use? I actually only need a lib to be #included, and then calculating yaw, ...

Go to advanced search