2019.07.15.(pm): How to use IR sensor with ESP-WROOM-32

The ESP-WROOM-32 is a low-power communication module that combines Wi-Fi and Bluetooth. It has an appearance similar to the NodeMCU, and the specification is as follows.

There is the pin out of ESP-WROOM-32.

esp32 pinout에 대한 이미지 검색결과

You can add it by using the unofficial board URL for use in the Arduino IDE environment, and install it in the board manager.

int pinNum = 34; 

int distance = 0;

void setup() 
{  
  Serial.begin(9600); 
  pinMode (pinNum, INPUT); 
}
 
void loop() 
{
  int data = analogRead(pinNum); 
  int volt = map(data, 0, 1023, 0, 5000);
  distance = 27/(volt-0.17)*1000;
  Serial.println(distance);
  delay(50); 
}

57 Replies to “2019.07.15.(pm): How to use IR sensor with ESP-WROOM-32”

  1. I am really enjoying the theme/design of your weblog.

    Do you ever run into any internet browser compatibility problems?

    A few of my blog readers have complained about my
    blog not working correctly in Explorer but looks great in Firefox.
    Do you have any suggestions to help fix this issue?

  2. Thank you for any other excellent post. The place else could anybody get that kind of information in such an ideal way of writing?
    I have a presentation subsequent week, and I am at the search for such info.

  3. I blog quite often and I genuinely appreciate your information. Your article has truly peaked my interest.
    I am going to bookmark your blog and keep checking for new details about once
    per week. I subscribed to your RSS feed as well.

  4. That is very attention-grabbing, You’re a very professional blogger.
    I’ve joined your rss feed and sit up for in quest of extra
    of your excellent post. Also, I have shared your site
    in my social networks

  5. Very good blog you have here but I was curious about if you
    knew of any message boards that cover the same topics
    discussed here? I’d really love to be a part of community where I can get opinions from other experienced people that share the same
    interest. If you have any recommendations, please
    let me know. Thank you!

  6. Great goods from you, man. I’ve understand your stuff previous to
    and you are just extremely excellent. I actually like what you’ve acquired here,
    certainly like what you’re stating and the way in which you say it.
    You make it entertaining and you still care for to keep it wise.
    I cant wait to read far more from you. This is really a tremendous website.

  7. wonderful submit, very informative. I ponder why the other
    experts of this sector do not notice this.
    You should proceed your writing. I am sure, you’ve a huge readers’ base already!

  8. Hey there superb blog! Does running a blog like this take a
    lot of work? I have absolutely no knowledge of computer programming however I was hoping to start
    my own blog soon. Anyway, should you have any recommendations or techniques for new blog owners please share.
    I understand this is off subject but I just wanted
    to ask. Thanks a lot!

  9. This is the perfect website for anybody who would like to understand this topic.
    You realize a whole lot its almost tough too argue with you (not
    that I really wold want to…HaHa). You definitely put a new spin on a subject which has been discussed for decades.
    Great stuff, just excellent!

  10. I have been browsing online more than 3 hours today, yet I never found any interesting article like yours.
    It’s pretty worth enough for me. Personally, if all webmasters
    and bloggers made good content as you did, the web will be a lot more useful than ever before.

  11. Attractive section of content. I just stumbled upon your weblog and
    in accession capital to assert that I get in fact enjoyed account your
    blog posts. Anyway I’ll be subscribing to your augment and even I achievement you access consistently fast.

  12. Hello there! This blog post could not be written much better!
    Looking at this article reminds me of my previous roommate!
    He constantly kept talking about this. I will forward this
    information to him. Pretty sure he’ll have a good read.
    Thanks for sharing!

  13. Hi there! This post couldn’t be written any better!

    Reading this post reminds me of my old room mate!
    He always kept talking about this. I will forward this article to him.
    Fairly certain he will have a good read. Many thanks
    for sharing!

  14. Hello terrific blog! Does running a blog like this require a great deal of work?
    I have absolutely no knowledge of computer programming
    but I was hoping to start my own blog in the near future.
    Anyway, if you have any suggestions or tips for new blog owners please
    share. I understand this is off topic however I simply wanted to ask.
    Appreciate it!

  15. Please let me know if you’re looking for a writer for your site.
    You have some really great articles and I feel I would be a good asset.
    If you ever want to take some of the load off,
    I’d love to write some articles for your blog
    in exchange for a link back to mine. Please shoot me an e-mail if interested.
    Thank you!

  16. I got this site from my friend who told me regarding
    this website and at the moment this time I am browsing this web
    site and reading very informative articles at this place.

  17. Excellent weblog here! Additionally your site so much up very fast!

    What host are you using? Can I am getting your affiliate hyperlink for your host?
    I wish my site loaded up as fast as yours lol

  18. Great post. I was checking continuously this blog and I am impressed!
    Very useful info specifically the last part 🙂 I care for such information much.
    I was looking for this certain information for a long time.
    Thank you and best of luck.

  19. I like the valuable info you provide in your articles. I
    will bookmark your weblog and check again here frequently.
    I’m quite sure I will learn many new stuff right here! Good luck for the next!

  20. I’m extremely impressed along with your writing abilities as neatly as with the layout
    to your weblog. Is this a paid topic or did you customize it yourself?
    Anyway stay up the nice quality writing, it is uncommon to peer a nice weblog like this one
    today..

  21. Terrific article! This is the kind of info that should be shared across the internet.
    Disgrace on the seek engines for not positioning this publish higher!

    Come on over and discuss with my web site . Thank you =)

  22. I would like to thank you for the efforts you’ve put in writing this website.
    I really hope to view the same high-grade blog posts from you
    later on as well. In truth, your creative writing abilities has inspired me to get my very own site now 😉

  23. I’m more than happy to find this site. I need to to thank you for your time for this
    particularly wonderful read!! I definitely really liked every
    part of it and I have you saved to fav to see new things on your blog.

  24. My spouse and I stumbled over here from a different page and thought I might check things out.
    I like what I see so now i’m following you.
    Look forward to exploring your web page yet again.

  25. We’re a group of volunteers and starting a new scheme in our community.
    Your web site offered us with useful info to work on. You’ve performed an impressive activity and our entire community shall be thankful to you.

  26. “Having read this I thought it was very enlightening. I appreciate you taking the time and effort to put this article together. I once again find myself personally spending way too much time both reading and commenting. But so what, it was still worth it!”

  27. I just want to say I’m beginner to blogs and really enjoyed you’re blog site. Very likely I’m planning to bookmark your blog . You absolutely come with superb well written articles. Thanks for sharing with us your webpage.

Leave a Reply

Your email address will not be published. Required fields are marked *