Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
RobbsyB
Newbie
Posts: 5
Permalink
Post PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
on: July 6, 2016, 16:25
Quote

Hey
I am new to this forum, but played with the Polargraph based on a MEGA2560 for quite a while.

I wanted to have the same features as the new PolargraphSD and added a cheap 2.4" TFT screen that also includes a SD card. For controlling motors, I use the V2 motor shield.
Stacking these shields did not work for me, so I had to do some extra wiring. I changed some pins and also changed the latest PolargraphSD firmware to fit on my MEGA.
Until now, it seems like my setup works just like a regular PolargraphSD including SD card and TFT display.

Since some of you are probably still using the old MEGA version, I wondered if you might be interested in wiring diagrams or code. If so, please let me know.

I am on a trip currently, but will add pictures later.

Cheers,
Robert

EATYone
Advanced
Posts: 67
Permalink
Post Re: PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
on: July 20, 2016, 12:11
Quote

Yes please 😀

rolexbene
Newbie
Posts: 9
Permalink
Post Re: PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
on: October 6, 2016, 13:04
Quote

Yes I am interested in this, please share

RobbsyB
Newbie
Posts: 5
Permalink
Post Re: PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
on: October 22, 2016, 10:12
Quote

All details are downloadable from this Dropbox folder:
https://www.dropbox.com/sh/sh34chnca1psp6a/AABwoIc0_wHnFV8F007E5xeWa?dl=0

I created a wiring diagram for all components involved in this project (MEGA + motor shield V2 + TFT + SD) and made a couple of pictures from my Polargraph.
Since I had to change the source code to get it to work for this setup, it is also part of the download.
Feedback appreciated!

Cheers!

bolo16
Newbie
Posts: 10
Permalink
Post Re: PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
on: October 28, 2016, 19:20
Quote

Hi RobbsyB
I was trying to upload your sketch to MEGA, but I'v got some errors during that time. Errors as follow:

C:\Users\bolo_good\Downloads\Polargraph SD - MEGA + Motor shield V2 + TFT + SD\Source Code\polargraph_server_a1\configuration.ino:135:20: warning: extra tokens at end of #ifdef directive [enabled by default]

#ifdef MOTHERBOARD == MEGA

^

C:\Users\bolo_good\Downloads\Polargraph SD - MEGA + Motor shield V2 + TFT + SD\Source Code\polargraph_server_a1\lcd.ino: In function 'void lcd_touchInput()':

lcd:158: error: 'class TouchScreen' has no member named 'dataAvailable'

while (touch.dataAvailable())

^

lcd:160: error: 'class TouchScreen' has no member named 'read'

touch.read();

^

lcd:161: error: 'class TouchScreen' has no member named 'getX'

long x = touch.getX();

^

lcd:162: error: 'class TouchScreen' has no member named 'getY'

long y = touch.getY();

^

C:\Users\bolo_good\Downloads\Polargraph SD - MEGA + Motor shield V2 + TFT + SD\Source Code\polargraph_server_a1\lcd.ino: In function 'void lcd_initLCD()':

lcd:716: error: 'class TouchScreen' has no member named 'setPrecision'

touch.setPrecision(PREC_MEDIUM);

^

lcd:716: error: 'PREC_MEDIUM' was not declared in this scope

touch.setPrecision(PREC_MEDIUM);

I think that I have a problem with libraries, but I'm not sure. Wht di you think about it?

RobbsyB
Newbie
Posts: 5
Permalink
Post Re: PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
on: October 30, 2016, 08:34
Quote

Hey bolo16,
Looks like you are using another touchscreen library! Please make sure that you are using the correct libraries (folder: "Polargraph SD - MEGA + Motor shield V2 + TFT + SD\Source Code\libraries\").

The UTouch library provides the following functions (these functions are not available in your case):

bool dataAvailable();
int16_t getX();
int16_t getY();
void setPrecision(byte precision);

Go through the output window when compiling and check the libraries that are used to build this sketch! Usually this is the default path: "C:\Program Files (x86)\Arduino\libraries\".

EATYone
Advanced
Posts: 67
Permalink
Post Re: PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
on: October 31, 2016, 21:21
Quote

can u give us a link or the name of the TFT you're using please 🙂

RobbsyB
Newbie
Posts: 5
Permalink
Post Re: PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
on: November 1, 2016, 15:58
Quote

This is the TFT I am using:
https://www.aliexpress.com/item/Free-Shipping-1pcs-2-4-inch-TFT-touch-LCD-Screen-Module-For-Arduino-UNO-R3/2034511569.html?spm=2114.01010208.3.64.AMyR20&ws_ab_test=searchweb0_0,searchweb201602_2_422,searchweb201603_1&btsid=b1d16101-f484-4267-aa83-7a8fc6f120b7

I played around with a lot of libs to get it to work 100%. One of my problem was finding the correct identifier to init the TFT.

EATYone
Advanced
Posts: 67
Permalink
Post Re: PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
on: November 2, 2016, 09:59
Quote

Thanks!

"One of my problem was finding the correct identifier to init the TFT."

That's the point

Ambroise6
Newbie
Posts: 1
Permalink
Post Re: PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
on: March 23, 2017, 20:57
Quote

Hello everyone,

I'm new here and I got a brand new polargraph built by my own with recycle parts. My electronic is an Arduino Mega with Ramps 1.4.
I got a touch screen that is seemed to be a ILI9341 model bought on Banggood.

I saw in this post that some of you have install an "unofficial" touchscreen but I was asking myself if you know if this touchscreen is compatible with the polargraph firmware ?
If its the case, what I'm supposed to do to adapt it to my hardware ?

Thanks a lot !

abhijeet
Newbie
Posts: 1
Permalink
Post Re: PolargraphSD with MEGA + Motor shield V2 + TFT + SD card
on: April 10, 2017, 07:23
Quote

hello everyone,
I am trying to build a polarbot using arduino mega 2560 with ramps 1.4, I downloaded the firmware on this page "https://github.com/euphy/polargraphcontroller/releases/tag/2016-03-29-10-23", added all the libraries and when I compile the code in arduino IDE I am getting this error
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "-IC:\Users\microbyte\Documents\Arduino\libraries\UTouch" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IC:\Program Files (x86)\Arduino\libraries\SD\src" "-IC:\Users\microbyte\Documents\Arduino\libraries\AccelStepper" "-IC:\Program Files (x86)\Arduino\libraries\Servo\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM\src" "-IC:\Users\microbyte\Documents\Arduino\libraries\UTFT" "-IC:\Users\microbyte\Documents\Arduino\libraries\URTouch" "C:\Users\MICROB~1\AppData\Local\Temp\arduino_build_193522\sketch\polargraph_server_polarshield.ino.cpp" -o "C:\Users\MICROB~1\AppData\Local\Temp\arduino_build_193522\sketch\polargraph_server_polarshield.ino.cpp.o"
G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\polargraph_server_polarshield.ino: In function 'void setup()':

polargraph_server_polarshield:316: error: 'penlift_penUp' was not declared in this scope

penlift_penUp();

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\calibrate.ino: In function 'void calibrate_doCalibration()':

calibrate:25: error: 'penlift_penUp' was not declared in this scope

penlift_penUp();

^

calibrate:27: error: 'releaseMotors' was not declared in this scope

releaseMotors();

^

calibrate:118: error: 'reportPosition' was not declared in this scope

reportPosition();

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\configuration.ino: In function 'void configuration_setup()':

configuration:98: error: 'multiplier' was not declared in this scope

mmPerStep = mmPerRev / multiplier(motorStepsPerRev);

^

configuration:102: error: 'sd_initSD' was not declared in this scope

sd_initSD();

^

configuration:103: error: 'lcd_initLCD' was not declared in this scope

lcd_initLCD();

^

configuration:104: error: 'lcd_showSummary' was not declared in this scope

lcd_showSummary();

^

configuration:107: error: 'touch' was not declared in this scope

touch.InitTouch();

^

configuration:116: error: 'lcd_displayFirstMenu' was not declared in this scope

lcd_displayFirstMenu();

^

configuration:117: error: 'releaseMotors' was not declared in this scope

releaseMotors();

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\curves.ino: In function 'void curves_pixel_drawCircularPixel()':

curves:21: error: 'multiplier' was not declared in this scope

long originA = multiplier(atol(inParam1));

^

curves:31: error: 'pixel_maxDensity' was not declared in this scope

int maxDensity = pixel_maxDensity(penWidth, radius);

^

curves:39: error: 'pixel_scaleDensity' was not declared in this scope

density = pixel_scaleDensity(density, 255, maxDensity);

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\curves.ino: In function 'void curves_drawCurve(long int, long int, long int, long int, long int, long int, int)':

curves:82: error: 'changeLength' was not declared in this scope

changeLength(xt, yt);

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\curves.ino: In function 'void curves_drawSpiral(long int, long int, int, int, int)':

curves:169: error: 'changeLength' was not declared in this scope

changeLength(startx, starty);

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\eeprom.ino: In function 'void eeprom_loadMachineSpecFromEeprom()':

eeprom:163: error: 'multiplier' was not declared in this scope

mmPerStep = mmPerRev / multiplier(motorStepsPerRev);

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\exec.ino: In function 'boolean exec_executeBasicCommand(String&)':

exec:35: error: 'pixel_drawSquarePixel' was not declared in this scope

pixel_drawSquarePixel();

^

exec:37: error: 'pixel_drawScribblePixel' was not declared in this scope

pixel_drawScribblePixel();

^

exec:43: error: 'pixel_testPenWidth' was not declared in this scope

pixel_testPenWidth();

^

exec:45: error: 'penlift_penDown' was not declared in this scope

penlift_penDown();

^

exec:48: error: expected primary-expression before 'else'

else if (com.startsWith(CMD_SETMACHINESIZE))

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\exec.ino: In function 'void exec_setPenLiftRange()':

exec:200: error: 'penlift_movePen' was not declared in this scope

penlift_movePen(up, down, penLiftSpeed);

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\exec.ino: In function 'void exec_changePenWidth()':

exec:254: error: 'msg_reportMinimumGridSizeForPen' was not declared in this scope

msg_reportMinimumGridSizeForPen();

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\exec.ino: In function 'void exec_setPosition()':

exec:259: error: 'multiplier' was not declared in this scope

long targetA = multiplier(atol(inParam1));

^

exec:265: error: 'engageMotors' was not declared in this scope

engageMotors();

^

exec:267: error: 'reportPosition' was not declared in this scope

reportPosition();

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\exec.ino: In function 'void exec_changeLengthRelative()':

exec:272: error: 'multiplier' was not declared in this scope

long lenA = multiplier(atol(inParam1));

^

exec:275: error: 'changeLengthRelative' was not declared in this scope

changeLengthRelative(lenA, lenB);

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\exec.ino: In function 'void exec_changeLength()':

exec:280: error: 'multiplier' was not declared in this scope

float lenA = multiplier(atof(inParam1));

^

exec:283: error: 'changeLength' was not declared in this scope

changeLength(lenA, lenB);

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\exec.ino: In function 'void exec_changeLengthDirect()':

exec:288: error: 'multiplier' was not declared in this scope

float endA = multiplier(atof(inParam1));

^

exec:295: error: 'getMaxLength' was not declared in this scope

if (endA < 20 || endB < 20 || endA > getMaxLength() || endB > getMaxLength())

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\exec.ino: In function 'void exec_drawBetweenPoints(float, float, float, float, int)':

exec:327: error: 'getCartesianXFP' was not declared in this scope

float c1x = getCartesianXFP(p1a, p1b);

^

exec:328: error: 'getCartesianYFP' was not declared in this scope

float c1y = getCartesianYFP(c1x, p1a);

^

exec:396: error: 'getMachineA' was not declared in this scope

float pA = getMachineA(c1x, c1y);

^

exec:397: error: 'getMachineB' was not declared in this scope

float pB = getMachineB(c1x, c1y);

^

exec:407: error: 'changeLength' was not declared in this scope

changeLength(pA, pB);

^

exec:415: error: 'reportPosition' was not declared in this scope

reportPosition();

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\impl_ps.ino: In function 'void impl_processCommand(String)':

impl_ps:20: error: 'lcd_echoLastCommandToDisplay' was not declared in this scope

lcd_echoLastCommandToDisplay(com, "usb:");

^

impl_ps:34: error: 'sd_storeCommand' was not declared in this scope

sd_storeCommand(com);

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\impl_ps.ino: In function 'void impl_executeCommand(String&)':

impl_ps:75: error: 'rove_setRoveArea' was not declared in this scope

rove_setRoveArea();

^

impl_ps:77: error: 'rove_startText' was not declared in this scope

rove_startText();

^

impl_ps:79: error: 'sprite_drawSprite' was not declared in this scope

sprite_drawSprite();

^

impl_ps:81: error: 'sprite_drawRandomPositionedSprite' was not declared in this scope

sprite_drawRandomPositionedSprite();

^

impl_ps:85: error: 'rove_controlSwirling' was not declared in this scope

rove_controlSwirling();

^

impl_ps:87: error: 'rove_drawNorwegianFromFile' was not declared in this scope

rove_drawNorwegianFromFile();

^

impl_ps:89: error: 'rove_drawRoveAreaFittedToImage' was not declared in this scope

rove_drawRoveAreaFittedToImage();

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\impl_ps.ino: In function 'void impl_runBackgroundProcesses()':

impl_ps:106: error: 'lcd_checkForInput' was not declared in this scope

lcd_checkForInput();

^

impl_ps:107: error: 'lcd_updateDisplay' was not declared in this scope

lcd_updateDisplay();

^

impl_ps:114: error: 'lcd_runEndScript' was not declared in this scope

lcd_runEndScript();

^

impl_ps:119: error: 'rove_swirl' was not declared in this scope

rove_swirl();

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\impl_ps.ino: In function 'void impl_exec_execFromStore(String)':

impl_ps:197: error: 'lcd_echoLastCommandToDisplay' was not declared in this scope

if (echoingStoredCommands) lcd_echoLastCommandToDisplay(command, inFilename+": ");

^

impl_ps:204: error: 'lcd_checkForInput' was not declared in this scope

lcd_checkForInput();

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\impl_ps.ino: In function 'void impl_pixel_testPenWidthScribble()':

impl_ps:273: error: 'multiplier' was not declared in this scope

int rowWidth = multiplier(atoi(inParam1));

^

impl_ps:295: error: 'pixel_maxDensity' was not declared in this scope

int maxDens = pixel_maxDensity(penWidth, rowWidth);

^

impl_ps:305: error: 'pixel_drawScribblePixel' was not declared in this scope

pixel_drawScribblePixel(posA, posB, rowWidth, density);

^

impl_ps:313: error: 'changeLength' was not declared in this scope

changeLength(long(posA-(rowWidth/2)), long(startRow-(rowWidth/2)));

^

impl_ps:317: error: 'moveB' was not declared in this scope

moveB(0-rowWidth);

^

impl_ps:321: error: 'moveA' was not declared in this scope

moveA(0-rowWidth);

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\impl_ps.ino: In function 'void drawRandom()':

impl_ps:378: error: 'reportPosition' was not declared in this scope

reportPosition();

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\impl_ps.ino: In function 'void impl_exec_drawTestDirectionSquare()':

impl_ps:384: error: 'multiplier' was not declared in this scope

int rowWidth = multiplier(atoi(inParam1));

^

impl_ps:386: error: 'pixel_drawSquarePixel' was not declared in this scope

pixel_drawSquarePixel(rowWidth, rowWidth, segments, DIR_SE);

^

impl_ps:387: error: 'moveA' was not declared in this scope

moveA(rowWidth*2);

^

impl_ps:390: error: 'moveB' was not declared in this scope

moveB(rowWidth*2);

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\impl_ps.ino: In function 'void impl_pixel_drawSawtoothPixel()':

impl_ps:402: error: 'multiplier' was not declared in this scope

long originA = multiplier(atol(inParam1));

^

impl_ps:418: error: 'pixel_getAutoDrawDirection' was not declared in this scope

globalDrawDirection = pixel_getAutoDrawDirection(originA, originB, motorA.currentPosition(), motorB.currentPosition());

^

impl_ps:458: error: 'pixel_maxDensity' was not declared in this scope

density = pixel_scaleDensity(density, 255, pixel_maxDensity(penWidth, size));

^

impl_ps:458: error: 'pixel_scaleDensity' was not declared in this scope

density = pixel_scaleDensity(density, 255, pixel_maxDensity(penWidth, size));

^

impl_ps:460: error: 'changeLength' was not declared in this scope

changeLength(startPointA, startPointB);

^

impl_ps:463: error: 'pixel_drawWavePixel' was not declared in this scope

pixel_drawWavePixel(size, size, density, globalDrawDirection, SAW_SHAPE);

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\lcd.ino: In function 'void lcd_touchInput()':

lcd:30: error: 'touch' was not declared in this scope

touch.read();

^

lcd:42: error: break statement not within loop or switch

break;

^

G:\CNC\Polargraph 2016-03-29\arduino-source\polargraph_server_polarshield\lcd.ino: At global scope:

lcd:46: error: expected unqualified-id before 'else'

else {

^

lcd:49: error: expected declaration before '}' token

}

^

Using library UTouch in folder: C:\Users\microbyte\Documents\Arduino\libraries\UTouch (legacy)
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
Using library SD at version 1.1.1 in folder: C:\Program Files (x86)\Arduino\libraries\SD
Using library AccelStepper in folder: C:\Users\microbyte\Documents\Arduino\libraries\AccelStepper (legacy)
Using library Servo at version 1.1.2 in folder: C:\Program Files (x86)\Arduino\libraries\Servo
Using library EEPROM at version 2.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM
Using library UTFT in folder: C:\Users\microbyte\Documents\Arduino\libraries\UTFT (legacy)
Using library URTouch in folder: C:\Users\microbyte\Documents\Arduino\libraries\URTouch (legacy)
exit status 1
'penlift_penUp' was not declared in this scope
It seems 'penlift_penUp' and 'release motor was not declared,
need help.
Thank you

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.047 seconds.