max30102血氧检测模块使用方法

因为工作室需要做一个项目,这个项目要求检测到心率和脉搏,所以我就到网上买了一个检测模块,今天研究了一天,终于成功出来了数据。模块大致长这样:

它总共有8个接口实际上只需要用到四个(当初我接6个搞了半天没有任何用,然后用arduino实验才发现只需要四个)

先来做arduino的测试,我们可以到github上下载源程序,然后就直接按照程序说明接在arduino开发板上。(建议VIN接5v  SCL可以接SCL或者A4  SDA接SDA或者A5) 注意:如果开发板上有SCL和SDA的接口话,可以直接插在这个上面,我尝试了A4和A5,发现插上去好像没有用

如果一切OK的话,就可以出现下面的情况

这里我用的是arduino的LEONARDO开发板,因为内存好像太小了,测试血氧浓度的时候没有反应,所以我就打算用stm32来进行试验。(之前是用stm32的精英板测试的,不过我接了六个管脚,而且因为开发板的原因,不得不更改IO口,测试了很久还是没有任何用,所以就用arduino开发的)

arduino测试成功后,我就打算到stm32上在试一次,这次我使用了stm32的最小系统开发板,所以就不需要更改IO口,同样我也只接了四个管脚,然后烧录程序后,终于成功了!

今天又测试了一下午,终于可以正常修改IO口了,需要修改3个地方(有一个地方非常隐蔽,其实是我才学stm32没多久)。

第一个地方是修改myiic.c中的文件:

第二个是修改myicc.h中的 文件:

这里要修改两个地方:

第一个是IO口方向设置那里,如果你的管脚在0-7内那么就改成CRL(全部),如果是8-15的话就改成CRH,0-7的需要从右往左数n个修改对应的CRL的对应位。比如我是PB2 那么就是CRL&=0xfffff0ff CRL|=0x00000400 。那个7也是和上面对应的位是一样的。

下面那个IO口操作函数只需要修改成自己定义的IO口即可。

最后说一下CRL和CRH是端口的配置寄存器。

这里设置为4就是0100 就是浮空输入模式和输入模式

设置为7就是0111 就是输出模式(50MHZ)和通用开漏输出模式

点赞
  1. Corrine说道:

    I don't know whether it's just me or if everyone else encountering problems with your
    site. It appears as if some of the written text within your content
    are running off the screen. Can someone
    else please provide feedback and let me know if this is happening to them as well?
    This could be a issue with my internet browser because I've had this happen previously.
    Cheers

  2. Samantha说道:

    What's up mates, how is the whole thing, and what you wish for to say on the topic of this post, in my view its genuinely amazing for me.

  3. Hello my loved one! I want to say that this post is amazing, nice written and come with approximately
    all vital infos. I'd like to see extra posts like this .

  4. Please let me know if you're looking for a article author for
    your weblog. You have some really great articles and I believe I would
    be a good asset. If you ever want to take some of the load off,
    I'd love to write some content for your blog in exchange for a link back to mine.
    Please shoot me an email if interested. Many
    thanks!

  5. You are so cool! I do not believe I've truly read something
    like this before. So great to discover somebody with some genuine thoughts on this topic.
    Seriously.. thank you for starting this up. This site is one thing that is needed on the web, someone with a bit
    of originality!

  6. I like what you guys are up too. This type of clever work and coverage!
    Keep up the good works guys I've incorporated you guys to
    my personal blogroll.

  7. If some one needs to be updated with newest technologies after that
    he must be pay a visit this site and be up to date
    all the time.

  8. Ahaa, its good discussion on the topic of this paragraph at this place at this website, I have read all that,
    so at this time me also commenting here.

  9. web gia re说道:

    Hello there! I could have sworn I've visited this website before
    but after looking at a few of the articles I realized it's new to me.
    Nonetheless, I'm certainly delighted I came across it and I'll be bookmarking
    it and checking back regularly!

  10. Hey there! I've been following your web site for some
    time now and finally got the courage to go ahead and
    give you a shout out from Humble Tx! Just wanted to say keep up the good job!

  11. For most recent information you have to go to see internet and on the web I found this website as a most excellent web
    site for hottest updates.

  12. Gordon说道:

    Ahaa, its fastidious dialogue regarding this post at this place
    at this weblog, I have read all that, so at this time
    me also commenting at this place.

  13. Hello my loved one! I want to say that this
    article is awesome, great written and come with almost all important infos.

    I would like to peer extra posts like this .

  14. seogiare.vn说道:

    We're a bunch of volunteers and starting a brand new
    scheme in our community. Your site provided us with helpful info to work on. You've done a formidable process and our entire group can be grateful to you.

thiết kế website wordpress giá rẻ进行回复 取消回复

昵称和uid可以选填一个,填邮箱必填(留言回复后将会发邮件给你)
tips:输入uid可以快速获得你的昵称和头像

Title - Artist
0:00