I am trying to figure out the best way to send data that I receive from my accelerometer to my pc. I am using the wire.h library and though I can read the data good in the serial monitor, I don't get the data as a type data. I would assume that I want it as a float which I can convert to char and then send it via serial.
This code below is what I start from to read the data. How can I either set the type for X_out, Y_out, Z_out? Since I cannot send the data as is (looking like a float) and I cannot convert it to either a float, int, string or char (using Convert.ToString() or float.Parse() like commands) is there another way to rewrite the code giving me one of these types? Any tips are welcome! =)
How can I either set the type for X_out, Y_out, Z_out?
X_out, Y_out and Z_out are declared as float data type.
I don't get the data as a type data.
What does that mean?
I really do not understand what the issue is. What are you trying to do with the data once it is on the PC? Do you have a PC program that uses the data? What language or app is the PC program, if so?
It is not a good idea to use the offset registers. Instead, apply the offsets after the data have been read in, in the main code. The offsets below are unique to each device, and unless you determined them yourself, they are wrong.
groundFungus:
X_out, Y_out and Z_out are declared as float data type.
What does that mean?
I really do not understand what the issue is. What are you trying to do with the data once it is on the PC? Do you have a PC program that uses the data? What language or app is the PC program, if so?
Well, when I am trying to run it in my other code (where I have additionally 2 sensors) I cannot use X_out etc because it is not declared in this scope or invalid operands of types "const char to binary operations". I am trying to get a string with commas as separation in so that I can separate it in the pc program which is is c# as well.
The offset values is what I have calibrated the accelerometer to. I think the issue is that I get negative numbers which doesn't wanna translate to the string. But I am most likely wrong! ^^