Go Down

Topic: What does this mean; does not name a TYPE (Read 23093 times) previous topic - next topic

djhoins

I keep getting this error message: TestDCMotorDriver:18: error: 'MeDCMotor' does not name a type

PaulS

Every variable has to have a type. The type you have in front of a variable name is not a type that the compiler recognizes.

Without seeing your code, that is all the help you are going to get. It does look, though, like you have failed to download a library, or have not installed it correctly.

uobstudent

If the motor you are saying refers to a number it should have a type such as int or double, for example. This declares its type.

djhoins

OK ... Thanks in advance.
I'm trying to get the Makeblock starter Tank up and running.
Here is the code, what do I need to in order name a TYPE? and where does it go in the code block?

Quote

/*************************************************************************
* File Name          : TestMotorDriver.ino
* Author             : Steve
* Updated            : Jasen
* Version            : V1.0.1
* Date               : 11/14/2013
* Description        : Test for Makeblock Electronic modules of Me -Motor 
                       Driver. You can directly connect a motor to M1 or M2 Port, or connect to PORT_1 or PORT_2 through a DC                        motor driver
* License            : CC-BY-SA 3.0
* Copyright (C) 2013 Maker Works Technology Co., Ltd. All right reserved.
* http://www.makeblock.cc/
**************************************************************************/
#include <Makeblock.h>
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>

MeDCMotor motor1(PORT_1);
MeDCMotor motor2(PORT_2);
MeDCMotor motor3(M1);
MeDCMotor motor4(M2);

uint8_t motorSpeed = 100;

void setup()
{

}

void loop()
{
   motor1.run(motorSpeed); // value: between -255 and 255.
   motor2.run(motorSpeed); // value: between -255 and 255.
        motor3.run(motorSpeed);
        motor4.run(motorSpeed);
   delay(2000);
        motor1.stop();
   motor2.stop();
        motor3.stop();
   motor4.stop();
   delay(100);
   motor1.run(-motorSpeed);
   motor2.run(-motorSpeed);
        motor3.run(-motorSpeed);
        motor4.run(-motorSpeed);
   delay(2000);
   motor1.stop();
   motor2.stop();
        motor3.stop();
   motor4.stop();
   delay(2000);
}


PaulS

Code: [Select]
#include <Makeblock.h>
Did you download this library? From where? Where did you install it?

Trex_5

You don't need to modify the code. There are some problem in the library. You can download it here https://github.com/Makeblock-official/Makeblock-Library

smores

Hi Trex_5
I downloaded it from your link and installed per the instructions, but i still get the 'MeDCMotor' does not name a type.
Anyway of unloading the MakeBlock.h and reinstalling in Arduino IDE?

Any  suggestions appreciated

Thanx

GoForSmoke

The complete library should come in a folder that you copy to, inside your Arduino folder,

Software->arduino-version number->libraries.

You should be able, in the IDE to click the Sketch pulldown up top and choose Import Library and get it.
If it's not there then you did something wrong.

If the library has Examples then you should be able to load any of those through File->Examples->library name->choose one.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

PeterH



Software->arduino-version number->libraries.



In Windows it would be ...\Arduino\libraries\, where ...\Arduino is the directory where your sketches are stored.

GoForSmoke

I'm running XP and know how to browse my own folders, thank you. Must be my install. I have 0022 and 1.03 folders in the Software folder that is in the Arduino folder.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

Go Up