I am fairly new to programming an arduino using the IDE and C/C++. Im familiar with javascript, and what im trying to do is have a data object and have it contain sensor values for example the code would be something like this in javascript, an object and then assigning values to it's properties.
It looks like you've declared a class but not any instances of that class.
Also, analog reads are integers with a range of 0-1023, not floating points.
class Data //class names are capitalized
{
public:
int sensor1; //per bDeters (analog read returns an int)
int sensor2;
int sensor3;
}; // note semicolon ends declaration
Data data; // construct an instance of the Data class
void setup(){
Serial.begin(9600);
}
void loop(){
data.sensor1 = analogRead(A1); // it makes it more clear if you use the Ax notation for analog inputs
data.sensor2 = analogRead(A2);
data.sensor3 = analogRead(A3);
Serial.print(" sensor 1 data "); //you will need to print the member variables individually
Serial.println(data.sensor1); // trying to print just data will cause an error
delay(1000);
And some indentation really makes it a lot more readable.
And just to hold data a simple array will do. You can make it into a class but then it would make sense to include methods to do all the stuff with it. Like readSensor() or something.