Controlling vibration motors DaisyDuino DaisySeed

Hi there,

I’m trying to add some haptic feedback to a synth using small vibration motors.
So far I’m just trying to test the motors by calling a function in setup, but there is nothing is happening.

Here is the function I am calling;

void setup() {
  pinMode(D1, OUTPUT);
  pinMode(D2, OUTPUT);
  pinMode(D3, OUTPUT);

void testHardware() {
  digitalWrite(D1, HIGH); 
  digitalWrite(D1, LOW); 
  digitalWrite(D2, HIGH);
  digitalWrite(D2, LOW);
  digitalWrite(D3, HIGH);
  digitalWrite(D3, LOW);

The audio side of things is working fine so I’ve just shared the code for the output. When I reset the board there is about a 3 second delay before the audio starts - so the function is read and delays are working, but no vibration. The vibration motors and wiring definitely work as I’ve hooked them up with resistors to the 3.3v board power.

Is this the correct way to turn the GPIO pins on or off with DaisySeed?
Do i need to include a header file for the STM32 chip to program output?

Not sure if it’s related butthe

Thanks in advance for you help!

Welcome dan!

Could you add these before void setup() and see if helps?

#include "DaisyDuino.h"

#define D1 1 //Pin D1 

This worked! I don’t know what I was thinking not defining them… That is why you should not work late into the night!

1 Like

I’m glad to hear that it’s working now!! :slight_smile: