How to Make Mini CNC 2D Plotter Using Scrap DVD Drive, L293d Motor Shield & Arduino

97,129

542

47

About: Electrical engineer by profession

this a mini CNC 2D plotter made from old DVD drive and L293D motor shield very cheap but intresting

let see how to make in

Step 1: Video

Step 2: Material Need for This Project

1) 2 X SCRAP DVD DRIVE

2) 1 X ARDUINO

3) 1 X L293D MOTOR SHIELD

4) 1 X SERVO MOTOR (TOWER PRO 9G)

5) JUMPER WIRES

6) SOME HARDWARE NUT BOTS ETC

7) DOUBLE SIDE 3M TAPE

You can buy this material from below links of Amazon

Simple Lab's L293D Motor Shield for Arduino

Arduino Uno R3 ATmega328P ATMEGA16U2 Compatible with USB Cable

REES52 Tower Pro SG90 9g Servo Motor For Arduino ARM Raspberry AND Other MCU

Librairy For Adafruit Shield Driver Motors

extract the file and past them to

arduino/libraries

Step 3: Assembling the Machine

Open the scrap DVD Drive and rremove internal moving tray..

This tray having stepper mechanism on it this will act as our X-axis & Y-axis.

Go through the attached pictures for understanding how to assemble your machine.

make hole on empty DVD drive case mount our X-axis and Y-axis on respective DVD case with the help of

nut bolts.

Now place them perpendicular

Step 4: Wiring Details

watch the picture carefully and wire components accordingly

Step 5: CNC Code for Arduino

upload the code to arduino using arduino IDE

Step 6: G Code

To make gcode files that are compatible with this cnc machine you have to use the Inkscape.

Inkscape is professional quality vector graphics software which runs on Windows, Mac OS X and Linux. It is used by design professionals and hobbyists worldwide, for creating a wide variety of graphics such as illustrations, icons, logos, diagrams, maps and web graphics. Inkscape uses the W3C open standard SVG (Scalable Vector Graphics) as its native format, and is free and open-source software. Download and install Inkscape from

https://inkscape.org/en/download/windows/

(Important: download 0.48.5 version)
Now you need to install an Add-on that enables the export images to gcode files. This add on can be found here with installation notes.

https://github.com/martymcguire/inkscape-unicorn

please follow the video on you tube how to create G-code file

some ready made G-code files

Step 7: Processing IDE Program (GCTRL)

Upload the gctrl file to processing IDE

and click on PLAY button in processing window.

first press 'p' to select you com port

if you want you can set jog speed by pressing 1,2, or 3 button from keyboard

press 'g' to load G-code file

your machine is ready to plot as soon as you hit enter by selecting g code file

now you have done your plotter is ready

thanks for your attention

Step 8: How to Connect Stepper Motor With L293D Shield

5 People Made This Project!

Recommendations

  • Plastics Contest

    Plastics Contest
  • Make it Glow Contest 2018

    Make it Glow Contest 2018
  • Optics Contest

    Optics Contest

47 Discussions

0
None
Sumit Agrawal

11 months ago

Hi sir I completed this project with the help of your videos but the image can not drawing perfect please help me

2 replies
0
None
ManuelG136Sumit Agrawal

Reply 8 months ago

same Problem Here. It draw but very bad. U cant see what it draw.

0
None
HristoBManuelG136

Reply 7 months ago

Same here, I dopped the stepper speeds in the IDE. seems smoother

0
None
AnkitS226

1 year ago

i have downloaded the af library but still there is error in <afmotor.h>

please help me out in removing this

1 reply
0
None
ManuelG136

8 months ago

Hi sry for my bad eng. (German)

I rebuild it and its drawing but u cant imagine what it draw. He also want to be in one corner.

I followed your instructables.

I use a Arduino Motorshield.

Powersuply ist 9V battery & 3,6V.

is it possible to wire the motors wrong?

is the code oke for a shield?

Do u have any tips?

Thx

0
None
Hsyin_secer

9 months ago

I made it but I have a trouble.I used ardunio mega 2560 and 2xL293d integrated. I haven't adafruit shield.
(* Stepper myStepperX(stepsPerRevolution, 8,9,10,11) *) this step motor not working.
PWM channels 8,9,10,11 dont have voltage.I tried to increase feed voltaje and it didnt work again. Another step motor is working and 2,3,4,5 channels have voltage. What is the problem anybody knows that ?

0
None
AmitN39

10 months ago

What is power supply voltage to motor shield??

0
None
matelot2

11 months ago

I looked at this because I was curious to know how you connected the two units at 90 degrees from one another.

It was brilliant, one moment they were side by side on the table the next they were fastened to one another. I can't seem to get mine to do that?

0
None
m.mohanlalJ

1 year ago

mr.innovative,pls ans my comments posted 2days before,.Again my project of mini is stuck .no further going.pls let me know how to align pen in centre and rectify error message M18 (drives off)

At first it plott on may be 2or3 line correctly then printing every thing in one corner.and at last when it stopped and give message M 18 (drives off)pls give solution.l am tottaly newbie in software

0
None
m.mohanlalJ

1 year ago

sir,when I run g code in processing p 3 at the end of run the plotting is all jumble up,and message shows : M18 ( drives off )

Command not recognise : M18

Pls give the solution to correct the error.

0
None
Wisem3

1 year ago

Hello, sir i am getting m18 drives off error in processing ide. Then it all stops and the drawing so formed its any good,

0
None
8_bitGuy

1 year ago

I am using 2 DVD stepper motors, but still, the output is not what I expected it to be.. but the motors which I am using have different pin-out for wires..? does that means they do have different steps/rev..?

The output for STAR is in the picture.

The Gcode for star and elliptical are

config i am using in the code are-

steps/rev = 20; steps/mm(x&y)=360; x=(0:40) y=(0:40)

Help me out !!

Heliptical Path Output.jpgMotor1.jpgMotor2.jpgStar Output.jpg
0
None
cdubs61

1 year ago

Hi! So I have successfully uploaded the CNC Code and have processed the GTRL interface using Processor; however, when I attempt the jog the axes using the arrows keys of my PC, nothing moves. I hear a high-pitched hum (hums when I move up and right keys, but stops when I press the down and left keys) and I can feel the stepper motors trying to work, but the leadscrews won't budge! Also, when I try to move the x and y sleds by hand while this is happening, the leadscrews resist my hand. It's like the motors are preventing movement rather than creating it.... What do I do??? (stepper motors did work when I tested them)

1 reply
0
None
NnaemekaN2cdubs61

Reply 1 year ago

yea i have exactly same problem with mine. and when i test with the one revolution code it works perfectly but when i tried streaming a g code nothing moves, and i made my own motor shield on a bread board using l293d and am not sure whereto connect the input pins on the ardiuno board please i need help on this.

0
None
MiguelM214

1 year ago

thanks for your proyect

i do the machine. prove the axis with your programs and the axis are good

i donwload the file "gctrl.pde" but download a file "FLTW2G9IRXTABCW.pde"

i open arduino program and transfer this file. i dont have error.

now.... where i select the file to print?

i dont understan the step 7 of your proyect. thanks

0
None
Siliffe

1 year ago

Hi there,

I have tried to upload the arduino code but i got this error message when verifying the code:

Screen Shot 2016-12-19 at 21.11.22.png
1 reply
0
None
cdubs61Siliffe

Reply 1 year ago

In his code it includes the library for the L293D Motor Shield, but you have not downloaded that library onto your own computer. That's why it says "AFMotor.h: No such file or directory #include <AFMotor.h>". If you go to step 2, he has the file for the motor shield library that you download. Once you download it, it should be able to compile. :)

0
None
fredo55

1 year ago

Hi, trying to find what is wrong with my setup, a simple horizontal line of 40 mm is printed as only 4 mm (same thing with a vertical line). Also, checking at the gcode there are M01, M17, and M18 command not recognized and marked as errors. Using CAMbotics everything is fine.

Any suggestion, please?

0
None
ParaschivL

1 year ago

Hello

when I want to upload gctrl.pde, I receive this error:

********************

Arduino: 1.6.11 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Arduino\hardware -hardware C:\Users\cparaschiv\AppData\Local\Arduino15\packages -tools C:\Arduino\tools-builder -tools C:\Arduino\hardware\tools\avr -tools C:\Users\cparaschiv\AppData\Local\Arduino15\packages -built-in-libraries C:\Arduino\libraries -libraries C:\Users\cparaschiv\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10611 -build-path C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino6 -prefs=runtime.tools.avr-gcc.path=C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2 -verbose C:\Arduino\gctrl\gctrl.ino

C:\Arduino\arduino-builder -compile -logger=machine -hardware C:\Arduino\hardware -hardware C:\Users\cparaschiv\AppData\Local\Arduino15\packages -tools C:\Arduino\tools-builder -tools C:\Arduino\hardware\tools\avr -tools C:\Users\cparaschiv\AppData\Local\Arduino15\packages -built-in-libraries C:\Arduino\libraries -libraries C:\Users\cparaschiv\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10611 -build-path C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino6 -prefs=runtime.tools.avr-gcc.path=C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2 -verbose C:\Arduino\gctrl\gctrl.ino

Using board 'uno' from platform in folder: C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14

Using core 'arduino' from platform in folder: C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14

Detecting libraries used...

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Arduino\libraries\Servo\src\avr\Servo.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Arduino\libraries\Servo\src\sam\Servo.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Arduino\libraries\Servo\src\samd\Servo.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Arduino\libraries\Adafruit-Motor-Shield-library-master\AFMotor.cpp" -o "nul"

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Servo\src" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "nul"

Generating function prototypes...

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "-IC:\Arduino\libraries\Servo\src" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"

"C:\Arduino\tools-builder\ctags\5.8-arduino10/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10611 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\cores\arduino" "-IC:\Users\cparaschiv\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\variants\standard" "-IC:\Arduino\libraries\Adafruit-Motor-Shield-library-master" "-IC:\Arduino\libraries\Servo\src" "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp" -o "C:\Users\CPARAS~1\AppData\Local\Temp\build3a8a9971c0e1ebf5b423349760755e06.tmp\sketch\gctrl.ino.cpp.o"

gctrl:107: error: variable or field 'fileSelected' declared void

void fileSelected(File selection) {

^

gctrl:107: error: 'File' was not declared in this scope

gctrl:138: error: variable or field 'serialEvent' declared void

void serialEvent(Serial p)

^

gctrl:138: error: expected ')' before 'p'

void serialEvent(Serial p)

^

gctrl:1: error: 'import' does not name a type

import java.awt.event.KeyEvent;

^

gctrl:2: error: 'import' does not name a type

import javax.swing.JOptionPane;

^

gctrl:3: error: 'import' does not name a type

import processing.serial.*;

^

gctrl:5: error: 'Serial' does not name a type

Serial port = null;

^

gctrl:9: error: 'null' was not declared in this scope

String portname = null;

^

gctrl:16: error: expected unqualified-id before '[' token

String[] gcode;

^

C:\Arduino\gctrl\gctrl.pde: In function 'void openSerialPort()':

gctrl:21: error: 'null' was not declared in this scope

if (portname == null) return;

^

gctrl:22: error: 'port' was not declared in this scope

if (port != null) port.stop();

^

gctrl:22: error: 'null' was not declared in this scope

if (port != null) port.stop();

^

gctrl:24: error: 'port' was not declared in this scope

port = new Serial(this, portname, 9600);

^

gctrl:24: error: expected type-specifier before 'Serial'

port = new Serial(this, portname, 9600);

^

C:\Arduino\gctrl\gctrl.pde: In function 'void selectSerialPort()':

gctrl:31: error: 'JOptionPane' was not declared in this scope

String result = (String) JOptionPane.showInputDialog(this,

^

gctrl:31: error: invalid use of 'this' in non-member function

String result = (String) JOptionPane.showInputDialog(this,

^

gctrl:35: error: 'null' was not declared in this scope

null,

^

gctrl:36: error: 'class HardwareSerial' has no member named 'list'

Serial.list(),

^

C:\Arduino\gctrl\gctrl.pde: In function 'void setup()':

gctrl:45: error: redefinition of 'void setup()'

void setup()

^

C:\Arduino\gctrl\gctrl.ino:83:6: note: 'void setup()' previously defined here

void setup() {

^

gctrl:47: error: 'size' was not declared in this scope

size(500, 250);

^

C:\Arduino\gctrl\gctrl.pde: In function 'void draw()':

gctrl:53: error: 'background' was not declared in this scope

background(0);

^

gctrl:54: error: 'fill' was not declared in this scope

fill(255);

^

gctrl:56: error: 'text' was not declared in this scope

text("INSTRUCTIONS", 12, y); y += dy;

^

gctrl:68: error: 'height' was not declared in this scope

y = height - dy;

^

gctrl:69: error: invalid operands of types 'const char [20]' and 'float' to binary 'operator+'

text("current jog speed: " + speed + " inches per step", 12, y); y -= dy;

^

C:\Arduino\gctrl\gctrl.pde: In function 'void keyPressed()':

gctrl:75: error: 'key' was not declared in this scope

if (key == '1') speed = 0.001;

^

gctrl:76: error: 'key' was not declared in this scope

if (key == '2') speed = 0.01;

^

gctrl:77: error: 'key' was not declared in this scope

if (key == '3') speed = 0.1;

^

gctrl:80: error: 'keyCode' was not declared in this scope

if (keyCode == LEFT) port.write("G91\nG20\nG00 X-" + speed + " Y0.000 Z0.000\n");

^

gctrl:80: error: 'LEFT' was not declared in this scope

if (keyCode == LEFT) port.write("G91\nG20\nG00 X-" + speed + " Y0.000 Z0.000\n");

^

gctrl:80: error: 'port' was not declared in this scope

if (keyCode == LEFT) port.write("G91\nG20\nG00 X-" + speed + " Y0.000 Z0.000\n");

^

gctrl:80: error: invalid operands of types 'const char [15]' and 'float' to binary 'operator+'

if (keyCode == LEFT) port.write("G91\nG20\nG00 X-" + speed + " Y0.000 Z0.000\n");

^

gctrl:81: error: 'keyCode' was not declared in this scope

if (keyCode == RIGHT) port.write("G91\nG20\nG00 X" + speed + " Y0.000 Z0.000\n");

^

gctrl:81: error: 'RIGHT' was not declared in this scope

if (keyCode == RIGHT) port.write("G91\nG20\nG00 X" + speed + " Y0.000 Z0.000\n");

^

gctrl:81: error: 'port' was not declared in this scope

if (keyCode == RIGHT) port.write("G91\nG20\nG00 X" + speed + " Y0.000 Z0.000\n");

^

gctrl:81: error: invalid operands of types 'const char [14]' and 'float' to binary 'operator+'

if (keyCode == RIGHT) port.write("G91\nG20\nG00 X" + speed + " Y0.000 Z0.000\n");

^

gctrl:82: error: 'keyCode' was not declared in this scope

if (keyCode == UP) port.write("G91\nG20\nG00 X0.000 Y" + speed + " Z0.000\n");

^

gctrl:82: error: 'UP' was not declared in this scope

if (keyCode == UP) port.write("G91\nG20\nG00 X0.000 Y" + speed + " Z0.000\n");

^

gctrl:82: error: 'port' was not declared in this scope

if (keyCode == UP) port.write("G91\nG20\nG00 X0.000 Y" + speed + " Z0.000\n");

^

gctrl:82: error: invalid operands of types 'const char [21]' and 'float' to binary 'operator+'

if (keyCode == UP) port.write("G91\nG20\nG00 X0.000 Y" + speed + " Z0.000\n");

^

gctrl:83: error: 'keyCode' was not declared in this scope

if (keyCode == DOWN) port.write("G91\nG20\nG00 X0.000 Y-" + speed + " Z0.000\n");

^

gctrl:83: error: 'DOWN' was not declared in this scope

if (keyCode == DOWN) port.write("G91\nG20\nG00 X0.000 Y-" + speed + " Z0.000\n");

^

gctrl:83: error: 'port' was not declared in this scope

if (keyCode == DOWN) port.write("G91\nG20\nG00 X0.000 Y-" + speed + " Z0.000\n");

^

gctrl:83: error: invalid operands of types 'const char [22]' and 'float' to binary 'operator+'

if (keyCode == DOWN) port.write("G91\nG20\nG00 X0.000 Y-" + speed + " Z0.000\n");

^

gctrl:84: error: 'keyCode' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_UP) port.write("G91\nG20\nG00 X0.000 Y0.000 Z" + speed + "\n");

^

gctrl:84: error: 'KeyEvent' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_UP) port.write("G91\nG20\nG00 X0.000 Y0.000 Z" + speed + "\n");

^

gctrl:84: error: 'port' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_UP) port.write("G91\nG20\nG00 X0.000 Y0.000 Z" + speed + "\n");

^

gctrl:84: error: invalid operands of types 'const char [28]' and 'float' to binary 'operator+'

if (keyCode == KeyEvent.VK_PAGE_UP) port.write("G91\nG20\nG00 X0.000 Y0.000 Z" + speed + "\n");

^

gctrl:85: error: 'keyCode' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_DOWN) port.write("G91\nG20\nG00 X0.000 Y0.000 Z-" + speed + "\n");

^

gctrl:85: error: 'KeyEvent' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_DOWN) port.write("G91\nG20\nG00 X0.000 Y0.000 Z-" + speed + "\n");

^

gctrl:85: error: 'port' was not declared in this scope

if (keyCode == KeyEvent.VK_PAGE_DOWN) port.write("G91\nG20\nG00 X0.000 Y0.000 Z-" + speed + "\n");

^

gctrl:85: error: invalid operands of types 'const char [29]' and 'float' to binary 'operator+'

if (keyCode == KeyEvent.VK_PAGE_DOWN) port.write("G91\nG20\nG00 X0.000 Y0.000 Z-" + speed + "\n");

^

gctrl:86: error: 'key' was not declared in this scope

if (key == 'h') port.write("G90\nG20\nG00 X0.000 Y0.000 Z0.000\n");

^

gctrl:86: error: 'port' was not declared in this scope

if (key == 'h') port.write("G90\nG20\nG00 X0.000 Y0.000 Z0.000\n");

^

gctrl:87: error: 'key' was not declared in this scope

if (key == 'v') port.write("$0=75\n$1=74\n$2=75\n");

^

gctrl:87: error: 'port' was not declared in this scope

if (key == 'v') port.write("$0=75\n$1=74\n$2=75\n");

^

gctrl:89: error: 'key' was not declared in this scope

if (key == 's') port.write("$3=10\n");

^

gctrl:89: error: 'port' was not declared in this scope

if (key == 's') port.write("$3=10\n");

^

gctrl:90: error: 'key' was not declared in this scope

if (key == 'e') port.write("$16=1\n");

^

gctrl:90: error: 'port' was not declared in this scope

if (key == 'e') port.write("$16=1\n");

^

gctrl:91: error: 'key' was not declared in this scope

if (key == 'd') port.write("$16=0\n");

^

gctrl:91: error: 'port' was not declared in this scope

if (key == 'd') port.write("$16=0\n");

^

gctrl:92: error: 'key' was not declared in this scope

if (key == '0') openSerialPort();

^

gctrl:93: error: 'key' was not declared in this scope

if (key == 'p') selectSerialPort();

^

gctrl:94: error: 'key' was not declared in this scope

if (key == '$') port.write("$$\n");

^

gctrl:94: error: 'port' was not declared in this scope

if (key == '$') port.write("$$\n");

^

gctrl:97: error: 'key' was not declared in this scope

if (!streaming && key == 'g') {

^

gctrl:98: error: 'gcode' was not declared in this scope

gcode = null; i = 0;

^

gctrl:98: error: 'null' was not declared in this scope

gcode = null; i = 0;

^

gctrl:99: error: 'File' was not declared in this scope

File file = null;

^

gctrl:100: error: 'println' was not declared in this scope

println("Loading file...");

^

gctrl:101: error: 'file' was not declared in this scope

selectInput("Select a file to process:", "fileSelected", file);

^

gctrl:101: error: 'selectInput' was not declared in this scope

selectInput("Select a file to process:", "fileSelected", file);

^

gctrl:104: error: 'key' was not declared in this scope

if (key == 'x') streaming = false;

^

C:\Arduino\gctrl\gctrl.pde: At global scope:

gctrl:107: error: variable or field 'fileSelected' declared void

void fileSelected(File selection) {

^

gctrl:107: error: 'File' was not declared in this scope

Multiple libraries were found for "Servo.h"

Used: C:\Arduino\libraries\Servo

Not used: C:\Users\cparaschiv\Documents\Arduino\libraries\Servo2

Using library Servo at version 1.1.2 in folder: C:\Arduino\libraries\Servo

Using library Adafruit-Motor-Shield-library-master at version 1.0.0 in folder: C:\Arduino\libraries\Adafruit-Motor-Shield-library-master

exit status 1

variable or field 'fileSelected' declared void

**********************

Do you know why?