Issue with a black pill board programmed via the Arduino IDE
Hello, all. I am currently trying to program a black pill board to print out the output from a sound sensor, for which I use the Arduino IDE 2.3.2.
Used components:
- STM32F411CEU6 black pill
- KY-037 sound sensor
Current connections:
- the "G" pin from the sensor is connected to the "GND" pin on the black pill
- the "+" pin from the sensor is connected to the "3v3" pin on the black pill
- the "A0" pin from the sensor is connected to the "A9" pin on the black pill
The code:
#define DIGITAL_INPUT PA9
void setup() {
Serial.begin(9600);
pinMode(DIGITAL_INPUT, INPUT);
}
void loop() {
Serial.println(analogRead(DIGITAL_INPUT));
}
This code prints out values around 270-290 and it doesn't seem like creating any loud noises has any effect on the output, and neither does changing the potentiometer on the sensor itself. What I am trying to get is an output that has a clear and visible change between different amounts of noise. I am starting to think that the current output is just the floating value of the "A9" pin.
Other relevant info:
- I believe the problem isn't in the black pill itself, since I can successfully implement a simple "blink" functionality.
- I have already adjusted the potentiometer on the sensor so that the L2 is off. It turns on briefly when it detects a noise (such as clapping or anything louder).
- Changing the pin from "A9" outputs values from different ranges, but those values still don't seem to be affected by any noise, no matter how loud.
- The values don't change if "A9" is connected to the "A0" pin on the sensor instead of "D0".
If anyone can offer some assistance, I would majorly appreciate it.
