Arduino Nicla Vision can't connect to digital pin

Try to connect arduino nicla vision to 2-5v buzzer using digital pin but can't buzz the buzzer. Try the analog input but also can't connect. Is there any solution?

Code ?

this is my code

void setup() {
//init pin
pinMode(PG_1, OUTPUT);
pinMode(LEDG, OUTPUT);
pinMode(LEDR, OUTPUT);
}

void loop() {
//set buzzer to ON
digitalWrite(PG_1, HIGH);
digitalWrite(LEDG, HIGH);
digitalWrite(LEDR, LOW);
delay(5000);

//set buzzer to OFF
digitalWrite(PG_1, LOW);
digitalWrite(LEDG, LOW);
digitalWrite(LEDR, HIGH);
delay(5000);
}

No it is some of your code not all of it.

It is also incorrectly posted for this forum. See getting the best from this forum, sticky post.

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project.

1 Like

This all of my code that I've used for the buzzer

#include<Arduino.h>

void setup() {
//init pin
pinMode(PG_1, OUTPUT);
pinMode(LEDG, OUTPUT);
pinMode(LEDR, OUTPUT);
}

void loop() {
//set buzzer to ON
digitalWrite(PG_1, HIGH);
digitalWrite(LEDG, HIGH);
digitalWrite(LEDR, LOW);
delay(5000);

//set buzzer to OFF
digitalWrite(PG_1, LOW);
digitalWrite(LEDG, LOW);
digitalWrite(LEDR, HIGH);
delay(5000);
}

The code is compiled and uploaded properly and the led also can blink properly, but the buzzer still not "buzzing".

I feel very sorry if I post this in the inappropriate forum :frowning:

Time for a schematic (photo of handdrawn is fine) as well as the datasheet of the buzzer that you're using. It will help others to help you.

If you replace the buzzer by a LED plus resistor, does it work?

What sort of buzzer is this?
Will it work on the voltage output and the current capability of your nicla vision?

Is it an active or passive buzzer.
An active buzzer needs a rapidly alternating on / off to make a sound, where as a passive buzzer just needs a voltage.

What happens when you connect your buzzer to just 5V and ground? Does it make a sound, if it does it is a passive buzzer and you code will work.
Otherwise your code will not work.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.