Expected unqualified-id before '.' token

I am in the process of building a 2 wheeled Bluetooth car to put it simply. I am new to arduino coding so I downloaded and slightly modified the code from a website.

For this project I am using a Cytron Shield-MDD 10 and HC-05 bluetooth module with my arduino. I have installed and included the Cytron motor shield library in my code.

My end goal is to have the car be controlled through bluetooth using an app called Arduino Bluetooth Car.

There is an error code saying “expected unqualified-id before ‘.’ token” and I don’t know how to fix this.

This is my code…

void setup(){
Serial.begin(9600);CytronMD.init();               
}

void loop(){ 
    det = check();
   
    while (det == 'F')   // F, move forward
     {CytronMD.setSpeeds(vel,vel);det = check();}
   
    while (det == 'B')   // B, move back
     {CytronMD.setSpeeds(-vel,-vel);det = check();}

    while (det == 'L')   // L, move wheels left
     {CytronMD.setSpeeds(-vel,vel);det = check();}
    
    while (det == 'R')   // R, move wheels right
     {CytronMD.setSpeeds(vel,-vel);det = check();}
  
    while (det == 'I')   // I, turn right forward
     {CytronMD.setSpeeds(vel,vel/2);det = check();}
  
    while (det == 'J')   // J, turn right back
     {CytronMD.setSpeeds(-vel,-vel/2);det = check();}  
   
    while (det == 'G')   // G, turn left forward
     {CytronMD.setSpeeds(vel/2,vel);det = check();}
  
    while (det == 'H')   // H, turn left back
     {CytronMD.setSpeeds(-vel/2,-vel);det = check();}  
   
    while (det == 'S')   // S, stop
     {CytronMD.setSpeeds(0,0);det = check();}
    
}

The code ends here.

Help will be most appreciated, Thank you.

cytron-10a-7-30v-dual-channel-dc-motor-driver-shield-datasheet.pdf (1.42 MB)

Did you forget to #include the CytronMD library?

I believe I did, I downloaded the Cytron Motor Drivers Library and added "#include "CytronMotorDriver.h". I believe that is how you include a library.

Well, you said, "This is my code". I guess it isn't all of it. Please follow the usual forum guidelines and post your entire sketch, nested in code tags.

Okay, this is all of the code.

 #include "CytronMotorDriver.h"

/*
#include <Servo.h>
Servo myservo; 
*/

char dataIn='S';
char determinant;
char det;
int vel = 200; //Bluetooth Stuff

int overdrive = 13; //Press Toggle Switch #1, the pin13 LED will light up

void setup(){
Serial.begin(9600);CytronMD.init();

/*
myservo.attach(6);delay(100);
myservo.write(90);delay(100);
*/

}

void loop(){ det = check();  // You'll need to reconstruct this if your not using the Pololu Dual VNH5019
     
      while (det == 'F')   // F, move forward
       {CytronMD.setSpeeds(vel,vel);det = check();}
     
      while (det == 'B')   // B, move back
       {CytronMD.setSpeeds(-vel,-vel);det = check();}

      while (det == 'L')   // L, move wheels left
       {CytronMD.setSpeeds(-vel,vel);det = check();}
      
      while (det == 'R')   // R, move wheels right
       {CytronMD.setSpeeds(vel,-vel);det = check();}
    
      while (det == 'I')   // I, turn right forward
       {CytronMD.setSpeeds(vel,vel/2);det = check();}
    
      while (det == 'J')   // J, turn right back
       {CytronMD.setSpeeds(-vel,-vel/2);det = check();}  
     
      while (det == 'G')   // G, turn left forward
       {CytronMD.setSpeeds(vel/2,vel);det = check();}
    
      while (det == 'H')   // H, turn left back
       {CytronMD.setSpeeds(-vel/2,-vel);det = check();}  
     
      while (det == 'S')   // S, stop
       {CytronMD.setSpeeds(0,0);det = check();}
      
      //---------------------Toggle switch code------------------//
      /*while (det == 'W'){myservo.write(180);delay(100);det = check();} 
      while (det == 'w'){myservo.write(90);delay(100);det = check();} 
       
      while (det == 'U'){myservo.write(0);delay(100);det = check();} 
      while (det == 'u'){myservo.write(90);delay(100);det = check();} 
      */

}

int check()
{if (Serial.available() > 0) {dataIn = Serial.read(); 
        if (dataIn == 'F'){determinant = 'F';} 
        else if (dataIn == 'B'){determinant = 'B';}else if (dataIn == 'L'){determinant = 'L';}
        else if (dataIn == 'R'){determinant = 'R';}else if (dataIn == 'I'){determinant = 'I';} 
        else if (dataIn == 'J'){determinant = 'J';}else if (dataIn == 'G'){determinant = 'G';}   
        else if (dataIn == 'H'){determinant = 'H';}else if (dataIn == 'S'){determinant = 'S';}
        else if (dataIn == '0'){vel = 400;}else if (dataIn == '1'){vel = 380;}
        else if (dataIn == '2'){vel = 340;}else if (dataIn == '3'){vel = 320;}
        else if (dataIn == '4'){vel = 280;}else if (dataIn == '5'){vel = 240;}
        else if (dataIn == '6'){vel = 200;}else if (dataIn == '7'){vel = 160;}
        else if (dataIn == '8'){vel = 120;}else if (dataIn == '9'){vel = 80;}
        else if (dataIn == 'q'){vel = 40;}
        else if (dataIn == 'U'){determinant = 'U';}else if (dataIn == 'u'){determinant = 'u';}
        else if (dataIn == 'W'){determinant = 'W';}else if (dataIn == 'w'){determinant = 'w';}
        
        }return determinant;}

Take a look at the examples that come with the library. You're missing something like this:

// Configure the motor driver.
CytronMD motor(PWM_DIR, 3, 4);  // PWM = Pin 3, DIR = Pin 4.

I saw that in the Cytron Motor Example. Is it correct that the DIR is controlling the direction of the motor and the PWM is the speed?

If so would I need to rewrite the code and how would I do that?

Again I am trying to make a two wheeled bluetooth car that can go Forward, Backward, Left and, Right.

Use Google:

@aarg,
That didn’t help with the missing CytronMotorDriver.h file that I can see.
I don’t see it at that website. It doesn’t appear with a search for it at the site either.
Were you able to find at cytron.io?

Here is the header file:

Thank you, that link helped. Now my coding works!