Polargraph Server for Adafruit Motorshield v2

There’s been a bit of ongoing investigation about getting the polargraph firmware running with the new Adafruit Motorshield (v2). I have just got one of these shields recently, so have only just had a chance to work on it tonight.

https://github.com/euphy/polargraph_server_a1

The new Adafruit library is slightly bigger than the old one, and the polargraph_server_a1 firmware was super tight on space already, so I’ve split up the code into a set of features that can be easily enabled or disabled at compile time to save space:

  • PIXEL_DRAWING – This is pixel shading.
  • PENLIFT – Controlling a servo to lift the pen.
  • VECTOR_LINES – Drawing straight lines, aka vector plotting.

So to get this to fit on, you need to disable either PIXEL_DRAWING or VECTOR_LINES – can’t have both anymore, not with Motorshield v2.

For convenience, I’ve pre-compiled two binaries, one for Motorshield v1 (using AFMotor), and the other for Motorshield v2 (using Adafruit_MotorShield). The firmware for Motorshield v2 has pixel drawing disabled.

This is a bit of a pain, but I don’t see an acceptable alternative.

I haven’t tried this for actual drawing yet, because I haven’t got a machine made up that uses this system, but at least the motors move! Please let me know if there is any success – or otherwise.

Happy scribbling!

See also http://www.polargraph.co.uk/forum/polargraphs-group2/troubleshooting-forum5/motors-not-working-when-i-compile-but-hex-works-thread324/

This knowledge transferred to: https://github.com/euphy/polargraph/wiki/Polargraph-Server-for-Adafruit-Motorshield-v2

Leave a Reply