-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection Error #6
Comments
Hi, batulaiko. Initialization of the sensor is written here: class MAX30102():
# by default, this assumes that physical pin 7 (GPIO 4) is used as interrupt
# by default, this assumes that the device is at 0x57 on channel 1
def __init__(self, channel=1, address=0x57, gpio_pin=7):
print("Channel: {0}, address: {1}".format(channel, address))
self.address = address
self.channel = channel As you can see, the address to be printed is decimal format, because no formatting is set here. Sensor reading is as: def read_sequential(self, amount=100):
"""
This function will read the red-led and ir-led `amount` times.
This works as blocking function.
"""
red_buf = []
ir_buf = []
for i in range(amount):
while(GPIO.input(self.interrupt) == 1):
# wait for interrupt signal, which means the data is available
# do nothing here
pass
red, ir = self.read_fifo()
red_buf.append(red)
ir_buf.append(ir)
return red_buf, ir_buf This code waits until the data becomes available and availability is notified via interrupt pin. |
FYI: I updated |
I can use max30100.py in another respiratory. I can get values from them. I am using 5 pin actually. There are 7 pins but I am using Vin, SDA,SCL, INT, GND pins. It shows me address is 0x57 now but still stucks in data reading. This is the code which I am using. I put some prints for being sure the function which makes stucking this code. I can use max30100.py in other respiratory but I need to figure the HR calculation function out. Simply, for calculation, I need a list which contaions 100 data which appended 25 sample rate, am I right? If I change sample rate, is the fuction be affected because of it? |
Your code looks good. Can you see red light from the sensor? This repository contains a modified version of
Yes.
Yes.
|
Hi i wrote a simpel code to check is it work or not. when m=max30102.MAX30102(), it prints (Channel = 1 , Address 87)
and stucks in red, ir = m.read_sequential part.
I checked in i2cdetect -y 1 , it shows the address 57. But in code, it is 87. The connections are true by the way.
I have 7 pin version but I think it doesn't matter it is 5 or 7 pin.
Do you have any idea about that?
Have a nice day.
The text was updated successfully, but these errors were encountered: