Program guide: How to program a touch sensor

Sdílet
Vložit
  • čas přidán 24. 07. 2024
  • This is the additional program guide for the PIC16F627A touch sensor tutorial, where we talk about how to program a touch sensor and go through the C source code for the XC8 compiler line by line.
    Main video: • Breadboard capacitive ...
    Companion article: www.friendlywire.com/tutorials...
    Thanks for watching, and let me know in the comments if you have any questions!
    Website: www.friendlywire.com
    Twitter: / friendlywire
    Reddit: / friendlywire
    Facebook: / friendlywire
    Instagram: / friendlywire
    Timestamps:
    00:00 Introduction
    00:23 Program overview
    01:00 Source code inside MPLAB X IDE
    07:22 Summary

Komentáře • 43

  • @NotNotAsian
    @NotNotAsian Před 10 měsíci +2

    I like the style of renaming hardware dependent registers.
    Normally I don't like putting so many commands on one line, but in this case it actually improved readability.

    • @FriendlyWire
      @FriendlyWire  Před 10 měsíci

      Thank you, glad you liked the techniques! :-)

  • @lucapoliseno5291
    @lucapoliseno5291 Před 3 lety +2

    Best Electronics tutorials on youtube

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Thank you so much, Luca, I am very happy to hear that you like them! Let me know if you have anything you want to see in future videos! :)

  • @AmalMathewTech
    @AmalMathewTech Před 3 lety +1

    Nicely explained

  • @sivasankar4681
    @sivasankar4681 Před 2 lety +1

    Thank you very much for your crystal clear explanation.

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      Thank you for your kind words, so glad you find the video helpful! :)

  • @g0hjq
    @g0hjq Před 3 lety +1

    Thank you for a really nice, understandable PIC tutorial. I'm not a beginner, but I'm sure I'll be able to use the debouncing code and possibly the touch sensor code in my own projects.

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Hey, that's fantastic, glad you like it and, even better, got some use out of it!

  • @protechstudios5377
    @protechstudios5377 Před 3 lety +1

    You are really awesome.... Loved your projects...... U got a new subscriber 🎉

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Thank you very much. glad you like the projects! :) Do you have anything you want to see on this channel? I am always looking for new ideas :)

    • @protechstudios5377
      @protechstudios5377 Před 3 lety +1

      Yaaa Sure.... Try make video on ttp223 that is also a good sensor module and it's very popular also ...... I have also made video on
      But I think you can explain it better than me.... Go for it 🔥

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      @@protechstudios5377 The TTP223 is a useful touch sensor chip, true! But the whole idea of this touch sensor project was to build your own touch sensor so you don't have to use an extra sensor for that! :) So I have to think about it... :)

  • @_azaad_
    @_azaad_ Před 2 lety +1

    This is an awesome tutorial. Using an Arduino would've made this way more accessible but this was still super helpful

    • @FriendlyWire
      @FriendlyWire  Před 2 lety +2

      Thank you, I am so glad you like it! Arduino can be fun, but personally I like PIC microcontrollers :)

    • @_azaad_
      @_azaad_ Před 2 lety +1

      @@FriendlyWire Wouldn't be able to understand capacitive sensing without this tutorial so THANK YOU! :)

    • @FriendlyWire
      @FriendlyWire  Před 2 lety +1

      ​@@_azaad_ Thank you! The main idea of capacitive sensing is the same everywhere, regardless on which microcontroller you code it :)

    • @_azaad_
      @_azaad_ Před 2 lety +1

      @@FriendlyWire Absolutely. Having this detailed tutorial of the code is great because once you understand this, you can just code it on any microcontroller platform for sure! This was just a great explanation of an essential topic, I definitely subscribed over it. Kudos!

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      @@_azaad_ Thank you for sharing this perspective, it means a lot! I am thinking of creating similar code walkthrough videos for all my other PIC microcontroller projects, sort of as an additional video to the main one. Would that be interesting? In the main videos I cannot always cover all the details on the code, which is why I thought it might be useful to some of my viewers.

  • @taurruth
    @taurruth Před rokem +1

    Nice video. And well organized structure of program.
    Just one question. Why do you use PIC instead of Arduino?
    Before finding your channel I had no idea that this brand even exists.
    I wander if it is me being a beginner or is it not popular in my country?

    • @FriendlyWire
      @FriendlyWire  Před rokem

      Arduinos are great for removing the initial fear of using a microcontroller, but I find that they are often overpowered for hobbyist purposes. Moreover, there are a lot of libraries for the Arduino platform. This is a good thing, if you want to achieve a result fast, but I always like to program myself. I should probably do a video on this question at some point, I am getting this question a lot :)
      But my main point is this: the best tool is the tool you know how to use. So, if Arduinos are more interesting to you, then there is nothing wrong with using them. In my case, I like the more barebone structure of using a single PIC controller, I enjoy reading the different datasheets and trying to get everything to work the register level, and that's why I like to focus on those on my channel here.
      You are right, PICs are not as popular as the Arduino platform. at least for hobbyists, but I think they are a lot of fun, too :)

  • @thejoeblowshow
    @thejoeblowshow Před 2 lety +1

    Hi Jens! Nice work. Do you offer programming services?

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      Hey Joseph, I do not offer any paid services. If it's a small thing I may be able to do it for free, just send me an email :)

  • @mdsaifurrahman327
    @mdsaifurrahman327 Před rokem +1

    Hi,
    In the if (time-avg1 > thr1), what does the expression in the braces mean ? Does it do a subtraction operation and then compare against thr1? if so, how do you come up with this expression?

    • @FriendlyWire
      @FriendlyWire  Před rokem

      This compares the time it took for the button to read as digital low (stored in the variable "time") to the average time it takes for the button to read low (called "avg1"). If for some reason it takes much much longer than usual, then it must be because somebody touches the wire right now. The "much much longer" is specified by the threshold value "thr1" and this number is usually around 15-20, but you can try other values, too, to see if it works better. Hope it helps!

  • @paitangkinabuhi5165
    @paitangkinabuhi5165 Před 4 měsíci +1

    Can it work for PIC16F84A ?

    • @FriendlyWire
      @FriendlyWire  Před 4 měsíci

      Yes, it works for any pin that has a tristate register :) But you will have to write different code for the PIC16F84A because its internal registers are different from the ones of the PIC16F627A. Do you have some experience with PIC microcontrollers?

  • @burakcetin6504
    @burakcetin6504 Před 3 lety +1

    Hi can u answer my question please?
    Q: With what type of recorders is the screen rendered in the "scrolling text" application with recorders?
    A) SIPO
    B) SISO
    C) PIPO
    D) PISO

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Hi Burak, great question! :) The CD4094 that I use is a serial-in parallel-out type of register (SIPO). But in some sense it also has a serial output (the QS and /QS pins) so that part of it is serial-in serial-out (SISO). Hope that helps!

    • @burakcetin6504
      @burakcetin6504 Před 3 lety +1

      @@FriendlyWire I thought so too. I'm torn between two options. Which one should I mark? Thanks in advance.

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      ​@@burakcetin6504 It's just a name for things :) It's much more important to understand what it does! I think that strictly speaking the LEDs are just indicators and not part of the data structure, and in that sense it's probably a SISO-type of setup, but then again, it's just a name :)

  • @electroniclover5589
    @electroniclover5589 Před 3 lety +1

    sir can conduct a pic microcontroller course in UDEMY

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      Thank you! I have all my videos here on CZcams for free :)

    • @electroniclover5589
      @electroniclover5589 Před 3 lety

      @@FriendlyWire I think you should teach the PIC internal architecture and programming first

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      @@electroniclover5589 There are a lot of things to learn about PIC microcontrollers, yes! In my videos I take a different approach by building small projects that make use of some of the controller's features. I hope to make it easier for beginners to get acquainted with microcontrollers with this approach :)

    • @electroniclover5589
      @electroniclover5589 Před 3 lety +1

      @@FriendlyWire I see, hi sir do you have any recommended book for beginner

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      @@electroniclover5589 A book to learn how to program a PIC microcontroller specifically you mean? :)