Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Adafruit Shield V2 + Arduino Mega 2560
Visualbyte
Beginner
Posts: 33
Permalink
Post Adafruit Shield V2 + Arduino Mega 2560
on: December 5, 2014, 12:30
Quote

Thanks Sandy received the Gondola and Wheels and cord, but I have found the V2 hex file for the Uno in the repository but I have a Mega 2560 and am a little unsure as how to compile for the V2 and Mega from the source code I'm a tad new to this.
I have confirmed motor and servo movement from the Accel examples after discovering the specs that came with the steppers had the wrong colour labelling.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Adafruit Shield V2 + Arduino Mega 2560
on: December 5, 2014, 22:21
Quote

Hello, if you're using the Adafruit v2 motorshield, then you are best off using the polargraph_server_a1 firmware, but you'll need to compile it from source because as you've found, there is no precompiled hex for the MEGA.

In polargraph_server_ino, uncomment line 52:
#define ADAFRUIT_MOTORSHIELD_V2

and in configuration.ino, uncomment 37, 38, 39:
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"

and comment line 31:
//#include <AFMotor.h>

You will need to have Accelstepper and Adafruit_Motorshield libraries installed.

sn

Visualbyte
Beginner
Posts: 33
Permalink
Post Re: Adafruit Shield V2 + Arduino Mega 2560
on: December 5, 2014, 23:07
Quote

Thanks for the help Sandy...

The issue I have is I'm completely clueless on how to compile it, I have the libraries installed

Do I open "polargraph_server_a1.ino" in the Arduino Source folder make the changes in the corresponding ino tabs in the arduino ide and then press upload to the Mega.

As I say I'm new to this but try to take things on quickly

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Adafruit Shield V2 + Arduino Mega 2560
on: December 5, 2014, 23:19
Quote

Right, pretty much like you say. You've got the full set of files in a folder called polargraph_server_a1 (there should be 9 .ino files, and a .h file). In the Arduino IDE, just open up the folder, or the main file (polargraph_server_a1.ino) - give it a go and see.

good luck 🙂

sn

Visualbyte
Beginner
Posts: 33
Permalink
Post Re: Adafruit Shield V2 + Arduino Mega 2560
on: December 6, 2014, 08:42
Quote

It works but Processing now thinks I have a Uno not a Mega?

Is there a way to compile the Mega source for V2 that is not too complicated?

Visualbyte
Beginner
Posts: 33
Permalink
Post Re: Adafruit Shield V2 + Arduino Mega 2560
on: December 6, 2014, 12:02
Quote

http://www.polargraph.co.uk/forum/polargraphs-group2/troubleshooting-forum5/trouble-getting-motors-to-move-thread264/

This thread shows code to be added in the Mega Source I'm just trying to figure out were it goes within the Mega code?

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Adafruit Shield V2 + Arduino Mega 2560
on: December 6, 2014, 13:19
Quote

Do you need the features of the polargraph_server_mega firmware? Spiral pixel and SD card reading.

It has seen minimal love since it was made and the _a1 branch has diverged from in a significant way - I would not recommend it. I had forgotten it was still being distributed in the bundle - I'll take it out for the next release.

Supporting custom implementations of every combination of controller board and motor driver just isn't something that's practical, so "officially" use the _polarshield firmware for MEGAs with Polarshields, and use the _a1 firmware for any other motor drivers.

The glib answer is that it goes into the MEGA code the same place as it is in the UNO code. The structure is still the same (pretty much).

sn

sigmaz
Newbie
Posts: 7
Permalink
Post Re: Adafruit Shield V2 + Arduino Mega 2560
on: March 14, 2015, 03:25
Quote

Can I get spiral on the uno?
Or do I need to run it in my mega?
I haven't got a real deal polargraph, but I may add in an SD card reader and display since I have the parts already.

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