why does this not work?
Code_For_Car:24:9: error: expected initializer before 'moter1'
DCMoter moter1(11, 10);
^~~~~~
P.S. Sorry if this is really dumb question but I'm new sooooo...
Full Code:
class DCMoter {
private:
byte inputPin;
byte outputPin;
public:
DCMoter(byte inputPin, byte outputPin) {
this->inputPin = inputPin;
this->outputPin = outputPin;
pinMode(inputPin, INPUT);
pinMode(outputPin, OUTPUT);
}
void Spin(byte Volts) {
analogWrite(inputPin, Volts);
}
}
DCMoter moter1(11, 10);
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
Moter1.Spin(255)
}
Full Output:
Code_For_Car:24:9: error: expected initializer before 'moter1'
DCMoter moter1(11, 10);
^~~~~~
/home/errorbot1122-the-seccond/Arduino/Code_For_Car/Code_For_Car.ino: In function 'void loop()':
Code_For_Car:33:3: error: 'Moter1' was not declared in this scope
Moter1.Spin(255)
^~~~~~
/home/errorbot1122-the-seccond/Arduino/Code_For_Car/Code_For_Car.ino:33:3: note: suggested alternative: 'DCMoter'
Moter1.Spin(255)
^~~~~~
DCMoter
exit status 1
expected initializer before 'moter1'