I know the vw_send takes two parameters which are vw_send(message, length) but the above code makes no sense? What is the * for? And why is msg defined as a pointer? Why is it cons char and not just char?
It makes perfect sense.
A constant string is defined (const char*), but "vw_send" expects a "uint_8" array, so cast the pointer to the string to be a pointer to "uint8_t".
Also what is the difference between a normal array and a uint8_t array?
I can't think of what a "normal" array might be.
char normal_array[] = "ABCDEF"
Tells the compiler to reserve seven bytes of RAM, and before the program runs, populate that memory with the six characters 'A', 'B', 'C', 'D', 'E', 'F' and zero.
uint8_t normal_array[] = "ABCDEF"
Tells the compiler to reserve seven bytes of RAM, and before the program runs, populate that memory with the six characters 'A', 'B', 'C', 'D', 'E', 'F' and zero.
So, no diference?
Well, yes, because "char" and "uint8_t" are not exactly the same thing - they occupy the same amount of memory (one byte) but the compiler treats arithmetic on the two types differently.
BUT vw_send isn't going to do any arithmetic, so it is perfectly OK to tell the compiler to treat the pointer you give to vw_send as a pointer to a "different" type.
I mean a signed char holds values from -128 to +127, whereas an unsigned char holds values from 0 into 255.
Same number of different values, but different properties.
It's a habit from texting I am sorry. I do not think you understand how stupid I am. Your explanations are far to complex for me to grasp. It feels as if I will never pass this barrier in programming. I will never learn anything more because the way people explain stuff does not make sense to me. And believe me I have googled my face off for many months
Look at that line. What is the * for after uint8_t
Another reason why I will probably never pass this barrier is because people do not answer questions I have. It happens all the time. Like the above question. It is just ignored and I stay confused
If I send you a letter (the things people had to write to other people before email was invented), I put your address on the letter.
I don't put your house on the letter - that would make the postman's job way too difficult.
I write a pointer to your house on the letter.
If I increment the address on the letter, the letter goes to the house across the road.
ROFL!!! Sorry! Glad I wasn't drinking something when I read this.
I know how this person feels. I remember when I was introduced to pointers. They were in my mind, useless confusing nonsense.
Hang in there calvingloster, you'll get it. Suddenly you'll get the "Oh! That's all it was?!" And you'll be on your way. Keep asking if you don't get it, we'll try other "illustrations" 'till we hit on the one that works.