# Arduino Nicla Vision can't connect to digital pin

**URL:** <https://forum.arduino.cc/t/arduino-nicla-vision-cant-connect-to-digital-pin/1059288>\
**Category:** Nicla Vision\
**Created:** [November 29, 2022, 8:53am UTC](https://forum.arduino.cc/t/arduino-nicla-vision-cant-connect-to-digital-pin/1059288 "2022-11-29T08:53:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zidansurya](https://avatars.discourse-cdn.com/v4/letter/z/3be4f8/32.png) [@zidansurya](https://forum.arduino.cc/u/zidansurya)\
**Post date:** [November 29, 2022, 8:53am UTC](https://forum.arduino.cc/t/arduino-nicla-vision-cant-connect-to-digital-pin/1059288/1 "2022-11-29T08:53:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jhaine](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jhaine/32/707424_2.png) [@jhaine](https://forum.arduino.cc/u/jhaine)\
**Post date:** [November 29, 2022, 8:55am UTC](https://forum.arduino.cc/t/arduino-nicla-vision-cant-connect-to-digital-pin/1059288/2 "2022-11-29T08:55:32Z")

</div>

Code ?

---

<div class="post-metadata">

**Author:** ![zidansurya](https://avatars.discourse-cdn.com/v4/letter/z/3be4f8/32.png) [@zidansurya](https://forum.arduino.cc/u/zidansurya)\
**Post date:** [November 29, 2022, 9:24am UTC](https://forum.arduino.cc/t/arduino-nicla-vision-cant-connect-to-digital-pin/1059288/3 "2022-11-29T09:24:19Z")

</div>

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);  
}

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [November 29, 2022, 4:24pm UTC](https://forum.arduino.cc/t/arduino-nicla-vision-cant-connect-to-digital-pin/1059288/4 "2022-11-29T16:24:34Z")

</div>

> [@zidansurya](#):
>
> this is my code

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.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [November 29, 2022, 4:46pm UTC](https://forum.arduino.cc/t/arduino-nicla-vision-cant-connect-to-digital-pin/1059288/5 "2022-11-29T16:46:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zidansurya](https://avatars.discourse-cdn.com/v4/letter/z/3be4f8/32.png) [@zidansurya](https://forum.arduino.cc/u/zidansurya)\
**Post date:** [November 30, 2022, 5:01am UTC](https://forum.arduino.cc/t/arduino-nicla-vision-cant-connect-to-digital-pin/1059288/6 "2022-11-30T05:01:39Z")

</div>

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

```cpp
#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 ☹

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [November 30, 2022, 5:20am UTC](https://forum.arduino.cc/t/arduino-nicla-vision-cant-connect-to-digital-pin/1059288/7 "2022-11-30T05:20:10Z")

</div>

> [@zidansurya](#):
>
> The code is compiled and uploaded properly and the led also can blink properly, but the buzzer still not "buzzing".

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?

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [November 30, 2022, 7:26am UTC](https://forum.arduino.cc/t/arduino-nicla-vision-cant-connect-to-digital-pin/1059288/8 "2022-11-30T07:26:38Z")

</div>

> [@zidansurya](#):
>
> but the buzzer still not "buzzing".

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.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 29, 2023, 7:27am UTC](https://forum.arduino.cc/t/arduino-nicla-vision-cant-connect-to-digital-pin/1059288/9 "2023-05-29T07:27:31Z")

</div>

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