Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 2461

General discussion • Time and connection issue on Rasperrry Pi Zero

$
0
0
Hi,

I have a new Raspberry Pi Zero, that I have been coding for lately. I have issues getting a signal from an microphone amplifier Maxim/Adafruit Max 4466. I have connected power from the GPIO header to the VCC port on the Max 4466, Out on the max connects to bcm port 5 on the pi and ground connects to ground.

I get only an 0 from the microphone amplifier. I also get "internal function" for calling time.time_ns().

I have an script that writes to an text file, with the first 20 entries from the microphone. I am also playing music at 60db during the test, with the decibels measured by my phone at the same location as the microphone relative to the speakers. On the Raspberry Pi, I have Python 3.11 and Rpi.gpio 0.7.1. The following is the code I used. I have run out of ideas to test and would be thankful to any help provided.

Code:

import timeimport RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM)GPIO.setup(5, GPIO.IN)mic = GPIO.input(5)file = open("test.txt", "w")measurements = []clock = []i = 0while i < 20:measurements.append(mic)clock.append(time.time_ns())i = i + 1file.write(str(measurements))file.write(str(clock))file.flush()file.close()print("Done")

Statistics: Posted by EthanSnow — Sun Sep 08, 2024 6:21 pm



Viewing all articles
Browse latest Browse all 2461

Trending Articles