Go to advanced search

by dsyleixa123
Mon May 25, 2020 4:46 pm
Forum: C/C++
Topic: RFID reading with MFRC522 using QT
Replies: 2
Views: 105

Re: RFID reading with MFRC522 using QT

at first glance, I think this first one looks pretty cool https://github.com/paguz/RPi-RFID perhaps try it first without qt creator IDE, and if it works then for qt creator: a) add lines for linker and paths to your .pro file, e.g. INCLUDEPATH += /usr/local/include LIBS += -L"/usr/local/lib" LIBS +=...
by dsyleixa123
Sun May 24, 2020 9:59 am
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

it's a link to a github folder where you can download the pdf Please verify: your file in Github is actually not a pdf. hmm, if I click on the pdf file and then on the download button then I can download and view it as a pdf. (BTW, as to "The power of a language is before all the power of its user ...
by dsyleixa123
Sun May 24, 2020 9:45 am
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

(for Arduinos, it's just pinMode(pinnumber,...) digitalRead(pinnumber) digitalWrite (pinnumber,...) What a condescending view do you have on Arduino programmers! Many of us have gathered years of experience with programming microcontrollers and are familiar with almost every c++ trick you can imagi...
by dsyleixa123
Sun May 24, 2020 8:41 am
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

You can't just write some code and say "run". Why on Earth not? You can of course, but few people bother, its not very useful for a large project. Its the sort of thing beginners writing hello world programs like. $ cc hello.c && a.out Hello world! The little TCC compiler did it directly. You can w...
by dsyleixa123
Sun May 24, 2020 8:33 am
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

yes, I expected that nit picking, but for didactical reasons to newbies one has to explain things in kind of a blurred or fuzzy way to simplify things down. OTOH, your "monster code" gives newbies a good look inside to what C programming on Linux is actually about ;) (for Arduinos, #define BCM2708_P...
by dsyleixa123
Sun May 24, 2020 8:11 am
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

As I can acknowledge from the Arduino compiler verbose output, it even deals during the internal linking process with several identically named .h files stored from "installing" several libraries in different folders and choses to best match on it's own. It will also fully bypass a superfetatory in...
by dsyleixa123
Sat May 23, 2020 10:01 pm
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

It's hard to explain the Unix file system for libs to someone who is completely unexperienced, some folders and paths are used for/by gcc by default when a lib is installed and and it's always best to start with these defaults. If you're once more experienced, it's much easier to understand, but als...
by dsyleixa123
Sat May 23, 2020 9:25 pm
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

IMO the MagPi C tutorial might be a good start (for download) https://magpi.raspberrypi.org/articles/learn-code-c http://magpi.cc/learn-c-book Thank you, .. but not really. Experienced Arduino user know the primitives of C++ and 95% of what this book teaches.. What they lack is the procedure to fin...
by dsyleixa123
Sat May 23, 2020 6:48 pm
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

ok, I missed that former part probably. So one will have to go back to Adam+Eve and tell the OP step by step, how to program the Pi in C or C++ (as Arduino actually uses C++). Nonetheless, even then providing a ready-to-use lib for his device will be inevitible. IMO the MagPi C tutorial might be a g...
by dsyleixa123
Sat May 23, 2020 6:30 pm
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

&rin67630 if you want me to do the ina226 I am happy to do it. If you pull up the Ardrino driver https://github.com/jarzebski/Arduino-INA226/blob/master/INA226.cpp All you need to do is override the begin call bool INA226::begin(uint8_t address) { Wire.begin(); <===== This need to call the linux dr...
by dsyleixa123
Sat May 23, 2020 5:21 pm
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

Heater wrote:
Sat May 23, 2020 4:52 pm
dsyleixa123 wrote:
Sat May 23, 2020 4:29 pm
please stay on-topic!
Do you have better suggestions then?
yes, just answer to the TOP question as to tutorials.
by dsyleixa123
Sat May 23, 2020 3:26 pm
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

Java and Go just automize in the Arduino IDE the C++ code completion by generating extra prototypes and including libs and paths and board cores to write a suitable makefile, and then gcc (gpp) compiles it accordingly. If you are using e.g. Geany od code::blocks as an IDE you can do that manually to...
by dsyleixa123
Sat May 23, 2020 11:52 am
Forum: C/C++
Topic: Tutorial to start programming in c++ for Arduino transfugees.
Replies: 72
Views: 1449

Re: Tutorial to start programming in c++ for Arduino transfugees.

Hi folks, I have been programming Arduinos for years and really enjoyed it. I would like to continue on the Raspberries, but miss the well organized IDE with support for libraries and tons of examples to start with. Can someone point me to a learning resource the could take me to the next level on ...
by dsyleixa123
Thu May 21, 2020 8:35 am
Forum: C/C++
Topic: C API - terminating strings for MySQL
Replies: 33
Views: 756

Re: C API - terminating strings for MySQL

to me a cstring is an alias for the common null-terminated char array which is used in C and the string.h library. OTOH, "string" is ambiguous and may address various things (e.g, a C++ string or a generic term for either series of letters in different libs and classes or even also a ANSI C or assem...
by dsyleixa123
Wed May 20, 2020 7:51 pm
Forum: C/C++
Topic: C API - terminating strings for MySQL
Replies: 33
Views: 756

Re: C API - terminating strings for MySQL

everyone knows what I meant talking about "cstring": a ANSI C string = null-terminated char array, opposite to a C++ string. If one had liked more "null-terminated char array" (what a monster name) instead, he might have simply written: "I suggest using "null-terminated char array" rather than "cstr...
by dsyleixa123
Wed May 20, 2020 4:38 pm
Forum: C/C++
Topic: C API - terminating strings for MySQL
Replies: 33
Views: 756

Re: C API - terminating strings for MySQL

there is no such thing as a cstring type in C. http://www.cplusplus.com/reference/cstring/ a cstring is a null-terminated ANSI C string == char array, opposite to a C++ string. and as to "clear that it won't fit by size" of course I meant that then it does not fit to add an extra null at the end be...
by dsyleixa123
Wed May 20, 2020 2:18 pm
Forum: C/C++
Topic: C API - terminating strings for MySQL
Replies: 33
Views: 756

Re: C API - terminating strings for MySQL

of course unsigned char pass[8] = "cxxxxx07"; will NOT add the null as the compiler sees it won't fit I never doubted that, and that's exactly what I was telling. Why are U telling me that again? Also warnings or not are not the topic here, it's just about the result as written in the TO post. I jus...
by dsyleixa123
Wed May 20, 2020 1:51 pm
Forum: C/C++
Topic: C API - terminating strings for MySQL
Replies: 33
Views: 756

Re: C API - terminating strings for MySQL

for
unsigned char pass[] = "cxxxxx07"; or
unsigned char pass[9] = "cxxxxx07";
always a '\0' is added by gcc, don't always act like a an utterly nit-picker, fuddy-duddy or slowpoke :evil:
by dsyleixa123
Wed May 20, 2020 1:33 pm
Forum: C/C++
Topic: C API - terminating strings for MySQL
Replies: 33
Views: 756

Re: C API - terminating strings for MySQL

But why on Earth would you expect it to? There is nothing there that even hints at a string being involved. "unsigned char" is just a character, that is to say a byte. So "array[8]" gets you a space for an array of 8 bytes. I never said I expected it, I even wrote that it's just an array of 8 bytes...
by dsyleixa123
Wed May 20, 2020 1:27 pm
Forum: C/C++
Topic: C API - terminating strings for MySQL
Replies: 33
Views: 756

Re: C API - terminating strings for MySQL

unsigned char pass[8] = "cxxxxx07"; it's clear that it won't fit by size, because it's a cstring which automatically becomes terminated by a '\0' , so a 9th char element is required. It does fit but probably not in the way you're expecting. The compiler won't automatically add the null in your case...
by dsyleixa123
Wed May 20, 2020 9:25 am
Forum: C/C++
Topic: C API - terminating strings for MySQL
Replies: 33
Views: 756

Re: C API - terminating strings for MySQL

yes, except the length is variable by a certain range. For that purpose I usually use things like unsigned char pass[20] = "cxxxxx07"; whith enough space to enlarge that arbitrarily, if needed strcpy(pass,"cxxxxxjb007"); but my point actually was why unsigned char array[8] = { 'c' , 'x' , 'x' , 'x' ...
by dsyleixa123
Wed May 20, 2020 9:17 am
Forum: C/C++
Topic: my code those not give me output
Replies: 5
Views: 193

Re: my code those not give me output

can you cut the code down to a possibly smallest code, which is just able to show the basic issue (dropping all functions which are not compellingly needed for the error reproduction)? btw, did you check the pin numbering (wiringPi numbering vs. BCM nmbering etc)? e.g., when you control LEDs at eith...
by dsyleixa123
Wed May 20, 2020 9:09 am
Forum: C/C++
Topic: C API - terminating strings for MySQL
Replies: 33
Views: 756

Re: C API - terminating strings for MySQL

I admit that this issue at first glance was kind of puzzling me... as to unsigned char pass[8] = "cxxxxx07"; it's clear that it won't fit by size, because it's a cstring which automatically becomes terminated by a '\0' , so a 9th char element is required. But to unsigned char array[8] = { 'c' , 'x' ...
by dsyleixa123
Tue May 19, 2020 5:04 pm
Forum: C/C++
Topic: C API - terminating strings for MySQL
Replies: 33
Views: 756

Re: C API

unsigned char pass[8] = { 'c' , 'x' , 'x' , 'x' , 'x' , 'x' , '0' , '7' }; unsigned char pass[9] = { 'c' , 'x' , 'x' , 'x' , 'x' , 'x' , '0' , '7' }; The string length of the password is 8. I defined the array to 8 and I got an error. When I was changed array to 9 , the program successfully connect...

Go to advanced search