--- /dev/null
+/*
+ Pin assignment for 5161AS
+ G F com A B
+ --|--|--|--|--|--
+ | 10 9 8 7 6 |
+ | 1 2 3 4 5 |
+ --|--|--|--|--|--
+ E D com C P
+
+Segment to board pin (0 and 1 can not be used for this)
+A=2
+B=3
+C=4
+D=5
+E=6
+F=7
+G=8
+P=9
+com=GND
+
+ LED segment assignment corresponding to pins
+ A
+ ---
+F | | B
+ --- G
+E | | C
+ --- . P
+ D
+*/
+
+// a list with 11 entries
+// each entry has its own 8 int (HIGH or LOW) entries
+// display a number on the 7seg is telling each segment to HIGH or LOW
+// A,B,C,D,E,F,G,P
+int num_array[11][8] = { { 1,1,1,1,1,1,0,0 }, // 0
+ { 0,1,1,0,0,0,0,0 }, // 1
+ { 1,1,0,1,1,0,1,0 }, // 2
+ { 1,1,1,1,0,0,1,0 }, // 3
+ { 0,1,1,0,0,1,1,0 }, // 4
+ { 1,0,1,1,0,1,1,0 }, // 5
+ { 1,0,1,1,1,1,1,0 }, // 6
+ { 1,1,1,0,0,0,0,0 }, // 7
+ { 1,1,1,1,1,1,1,0 }, // 8
+ { 1,1,1,0,0,1,1,0 }, // 9
+ { 0,0,0,0,0,0,0,1} // Dot
+};
+
+void setup() {
+ pinMode(2, OUTPUT);
+ pinMode(3, OUTPUT);
+ pinMode(4, OUTPUT);
+ pinMode(5, OUTPUT);
+ pinMode(6, OUTPUT);
+ pinMode(7, OUTPUT);
+ pinMode(8, OUTPUT);
+ pinMode(9, OUTPUT);
+
+ displayNum(2);
+}
+
+void loop() {
+ // display all the numbers
+ for(int num = 0; num < 11 ; num++) {
+ displayNum(num);
+ delay(500);
+ }
+ delay(500);
+}
+
+void displayNum(int number) {
+ int pin = 2; // the starting pin on the arduino board
+ for (int segment=0; segment < 8; segment++) {
+ digitalWrite(pin, num_array[number][segment]);
+ pin++;
+ }
+}
--- /dev/null
+The idea is that using the analog or digital sound sensor reads sound changes.
+Tracks the highest value and display/store
+Or even print it with a label printer
+
+# Soundsensor
+
+Rotes rechteckiges Board. Blauer Potentiometer. Silberner Zylinder mit schwarzem Aufkleber (rau)
+4 Pins
+Rechte LED (Sensor oben, pins unten) strom
+Linke LED Anzeige wenn Ton registriert wurde.
+
+## Sensitivität einstellen:
+Potentiometer so lange nach links oder rechts drehen bis LED ausgeht.
+Darüber dann einstellen ab wann ein Signal kommen soll.
+
+Laut Beschreibung soll der Potentiometer nur für den DO sein, wenn man diesen
+einstellt ändert sich aber auch der Wert des AO.
+
+## Weitere Informationen
+
+https://arduinogetstarted.com/tutorials/arduino-sound-sensor
+https://circuitdigest.com/microcontroller-projects/interfacing-sound-sensor-with-arduino
+https://www.build-electronic-circuits.com/arduino-sound-sensor/
+https://polluxlabs.net/arduino-tutorials/einen-sound-sensor-am-arduino-verwenden/
+https://www.elektronik-kompendium.de/sites/praxis/bauteil_ky037-mikrofon.htm
+https://projecthub.arduino.cc/lakshyajhalani56/sound-sensor-arduino-project-sound-sensor-module-arduino-31a654
+https://sensorkit.arduino.cc/sensorkit/module/lessons/lesson/06-the-sound-sensor
+https://wiki.seeedstudio.com/Grove-Sound_Sensor/
+
+Chipset PDF
+https://www.onsemi.com/pdf/datasheet/lm358-d.pdf
--- /dev/null
+#define ANALOG_IN A0
+
+void setup() {
+ Serial.begin(9600); // initialize serial communication at 9600 bits per second
+ pinMode(ANALOG_IN, INPUT);
+}
+
+int soundPeak = 0;
+unsigned long previousMillis = 0;
+const long resetAfterMillis = 5000;
+
+void loop() {
+ int soundValue = 0; //create variable to store many different readings
+ unsigned long currentMillis = millis();
+
+ for (int i = 0; i < 32; i++) {
+ soundValue += analogRead(ANALOG_IN);
+ }
+
+ soundValue >>= 5; //bitshift operation
+
+ if(soundValue > soundPeak) {
+ soundPeak = soundValue;
+ }
+
+ if (currentMillis - previousMillis >= resetAfterMillis) {
+ previousMillis = currentMillis;
+ Serial.println(soundPeak);
+ soundPeak = 0;
+ }
+
+ delay(50);
+}