Albert Palomas

Electronics & Life Lover

Scratch 4 Arduino with Adafruit Motor Shield v2

S4A is a powerful platform to learn programming Arduino but by default it can’t be interfaced with Adafruit Motor Shield. I have rewritten S4A firmware in order to achieve this goal.

You can download firmware from here.

I have tested it on Arduino UNO and this shield.

https://www.adafruit.com/products/1438

This is the relationship with S4A variables and Adafruit Motor Shield outputs:

S4A Adafruit Motor Shield
Analog 5 Speed DC Motor 1
Analog 6 Speed DC Motor 2
Digital 10 Direction DC Motor 1 (HIGH = FRONT) (LOW = BACKWARD)
Digital 11 Direction DC Motor 2 (HIGH = FRONT) (LOW = BACKWARD)
Digital 7 PWM Servomotor 1
Digital 8 PWM Servomotor 2

 

For compiling this firmware you will need Adafruit Motor Shield Library. It can be downloaded from Adafruit website:

https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/install-software

4 Comments

  1. I have tested the framework with S4A and Arduino Uno but this don´t work. Please let me know how to get it.

  2. Mihai Dascaliuc

    14/05/2020 at 07:21

    Good day Albert,

    I work with my kids on the old version of adafruit motor shield: V1, using arduino IDE. I want to use it also with smaller kids, based on S4A. tell me please, is there any chance that the V1 library can be inserted into the firmware? thank you

    • Hi Mihai,

      Apologize for the delay. I have no choice to test it on this shield because I don’t have any. The only thing you need to do is to replace the port numbers for the V1 shield.

      Good luck!

Leave a Reply

Your email address will not be published.

© 2024 Albert Palomas

Theme by Anders NorenUp ↑