with it. Will I need an additional power supply for doing so? I couldnt find any information of the current draw of the vibration motor and am worried that it is above the 20mA that the Arduino can safely provide. Also if I need one, where do I attach it and what current/ voltage should I use?
Hi Jacket,
I now have the vibrator motor, the base shield v2 and my arduino all hooked up, however if I post a code like the following the motor goes first and then the LED lights up. I need both to start and stop simultaneously however (i.e. the LED needs to light up AND the motor needs to run at the same time). If I run the same code with two LEDs they light up simultaneously, what do I have to change to make this work with vibrator motor and LED too? Many Thanks, Isa
If you would like to change two or more pins of the same Port,(Simultaneously) use bare metal AVR code.
The AVR code for your application
void setup(){
DDRD=0b01001000;//This configures the 6th pin and 3rd pin as OUTPUT
}
void loop(){
PORTD=0b01001000;//This makes 6th and 3rd pins of PORT D as 1
delay(500);
PORTD=0b00000000;//This makes 6th and 3rd pins of PORT D as 0
delay(500);
}