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
26/10/2017 at 23:50
I have tested the framework with S4A and Arduino Uno but this don´t work. Please let me know how to get it.
30/10/2017 at 09:26
Hello Dover,
Did you try it with Adafruit Motor Shield? You can find this shield here:
https://www.adafruit.com/product/1438
You need to load this sketch on your UNO:
https://www.albertpalomas.com/s4a_afms/
You need to run Scratch for Arduino on your computer and connect to UNO via USB (emulated serial port COM on your computer)
http://s4a.cat/index_es.html
And you can be sure it works. I was playing with it successfully.
Good luck!
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
07/10/2020 at 16:55
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!