Ralph S Bacon
Ralph S Bacon
  • 286
  • 5 473 056
#BB12 Pointer vs References - and why you don't need 👉pointers in C++
It's true! At the beginner to moderate hobbyist coder, pointers are just trouble 😮
► PCBWay $5 for 10 pieces www.pcbway.com
00:00 Welcome Back
00:01 Intro and quick C++ vs C discussion
04:43 Why the need for references or pointers?
10:08 References walkthrough
16:50 Pointers walkthrough
31:03 Conclusion
GitHub entry for this video: github.com/RalphBacon/BB12-Pointers-and-References-in-C-
which contains the example files used in the demo.
So you asked "What about pointers, Ralph?". And I kept telling you, "Not needed". I was finally brow-beaten, er, sorry, "persuaded" to show you the difference between C++ user-friendly References and C-style, hard-to-decipher (and use) Pointers.
It is, of course, good to know about pointers, as other people's code might be full of them. Especially libraries, ported from the C language. But it doesn't mean you should be tempted to use them when we have References available.
Unless you know differently? Your views in the comments, please!
► List of all my videos
(Special thanks to Michael Kurt Vogel for compiling this)
bit.ly/UA-camVideoList-RalphBacon
► If you like this video please give it a thumbs up, share it and if you're not already subscribed please consider doing so and joining me on my Arduinite (and other μControllers) journey
My channel, GitHub and other stuff are here:
------------------------------------------------------------------
• ua-cam.com/users/RalphBacon
• github.com/RalphBacon
• buymeacoffee.com/ralphbacon
------------------------------------------------------------------
My ABOUT page with email address: ua-cam.com/users/RalphBaconabout
Переглядів: 5 754

Відео

#270 Lightweight PLA, Hot Melt Inserts Mk2, JTAG for WROOM/WROVER boards
Переглядів 5 тис.10 місяців тому
An almost 3D collection of items for ESP32 and Arduino Projects ► PCBWay $5 for 10 pieces www.pcbway.com Much more information in my GitHub for this video: github.com/RalphBacon/270-ESP32-JTAG-AIR-PLA-HOT-MELT-INSERTS Lightweight PLA Filament OVERTURE PLA Filament 1.75mm,AIR PLA,Filament PLA 0.8kg Spool, Dimensional Accuracy /-0.03mm, Fit Most FDM Printer (Many Colours) amzn.to/3DPJa0g Hot Melt...
#269 TFT 3.5" Touch Screen & ESP32 built in - Elecrow review
Переглядів 30 тис.11 місяців тому
A useful ESP32/TFT ILI9488 combo board from Elecrow. ► PCBWay $5 for 10 pieces www.pcbway.com Much more information (example sketches, TFT_eSPI info, GPIO assignments) in my GitHub here: github.com/RalphBacon/269-Elecrow-3.5-TFT-with-ESP32-built-in Intro Elecrow kindly asked me to review their combo ESP32/TFT screen board - rather similar to the one I used in my ESP32 Web Radio project a few ye...
#268 Soldering Flux from Jar to Syringe - with a Luer! 😁
Переглядів 6 тис.11 місяців тому
My soldering flux syringe has run out. Now what? ► PCBWay $5 for 10 pieces www.pcbway.com I use flux on my PCBs when soldering SMD components; except I ran out suddenly and didn't know of a clean way to transfer the flux in the jar to my syringe. Luckily, others have trod the path before me and I now have a near-perfect way of doing this. More information (including all links, photos etc in my ...
#267 The Arduinite 3D experience - forget the printer, choose the CAD!
Переглядів 5 тис.Рік тому
So you are a maker confused about 3D printing? ► PCBWay $5 for 10 pieces www.pcbway.com Intro So you are a maker, confused about 3D printing? More in the GitHub, as always: github.com/RalphBacon/267-3D-printing starting-out You use Arduinos, ESP32s, RasPies... and others? You like the idea of 3D printing as an extension to your activities but are confused about where to start? Stay tuned! When ...
#266 ESP32 Deep Sleep Project - Door Open/Closed Detection with ESP-NOW
Переглядів 9 тис.Рік тому
A Real World project that uses an ESP32 in Deep Sleep ► PCBWay $5 for 10 pieces www.pcbway.com More information and diagrams here: github.com/RalphBacon/269-ESP32-Deep-Sleep Intro I need to be able to detect when my workshop door has been opened - and STAYS open. And when it SHUTS again. The ESP32 needs to communicate with my Smart Heater Controller to turn off the heater (if it's on) so I don'...
#265 Me & My 3D Printer - Just a quick chat!
Переглядів 7 тис.Рік тому
So what have I been doing with my 3D printer? ► PCBWay $5 for 10 pieces www.pcbway.com Much more in my GitHub: github.com/RalphBacon/265-3D-Prints-Arduino-Projects INTRO So I've now got a 3D printer (several years after everyone else) and have been learning how to use FreeCAD, the design tool that you need to "master" in order to get the 3D printer to do anything at all! So what have I done so ...
#264 ESP32 World🕑Clock and Reminder🎗️Project (Assembly Stage)
Переглядів 6 тис.Рік тому
Display the day, date and three different time zones, plus a web-based reminder system! PCBWay $5 for 10 pieces www.pcbway.com PCBWay - up to 60% off Flex/Rigid PCBs All code, links and much more in my GitHub: bit.ly/GitHub_For_Code_And_Details See also: github.com/RalphBacon/256-MAX7219-Ultimate-Display, where we initially discussed this project, the libraries, the power supply requirements an...
#263 Using WhatsApp with your ESP32 (and other μControllers)
Переглядів 12 тис.Рік тому
A simple (and cheap) way to send a WhatsApp message to your (and others') phone. PCBWay - up to 60% off Flex/Rigid PCBs pcbway.com/ All code and more information in my GitHub: bit.ly/ESP32_WhatsApp_Demo So you need your ESP32 (or other Internet-connected system) to "phone home" and let you know there is a problem? This simple method of using WhatsApp may be the answer for you. For hobbyists, it...
#262 ESP32 + NeoPixel + Wi-Fi + I2C + nRF24L01 disaster!😮What to do?🤷
Переглядів 6 тис.Рік тому
How many things can go wrong in a project? Too many! JLCPCB 1-8 Layer PCB at $2. PCBA from $0 (Free Setup, Free Stencil) Sign Up Here to Get $54 New User Coupons at - jlcpcb.com/?from=SKL Much, much more in my GitHub for this video: bit.ly/ESP32NeoPixelWithWiFiDisaster Long story short I modified my ESP32 NeoPixel project (yes, the three circular LED rings that tell me if I have left the storag...
#261 ESP32 Line-by-line Debugging - works with many ESP32 modules
Переглядів 23 тис.Рік тому
Debug your ESP32 the proper way - line-by-line with a cheap JTAG module! JLCPCB 1-8 Layer PCB at $2. PCBA from $0 (Free Setup, Free Stencil) Sign Up Here to Get $54 New User Coupons at - jlcpcb.com/?from=SKL More information than you can shake an ESP32 at: github.com/RalphBacon/261-ESP32-Debugging-with-cheap-JTAG-module Rather than use a lot of Serial.print statements in your code, just connect...
#260 ESP32 Web Pages PART 2 - adding a sensor value on the page & more!
Переглядів 8 тис.Рік тому
Adding a temperature sensor reading onto a web page, two methods. ► PCBWay $5 for 10 pieces www.pcbway.com Don't start with this video! PART 1 shows how to create a landing page on the ESP32 along with OTA (Over The Air, wireless) updates and can be found here ua-cam.com/video/6yiuImbqKYY/v-deo.html with the code you need too! 😉 And whilst we're on the subject, Part 3 will be available soon whi...
#259 Desoldering Chips the Easy Way & Waterproofing💦Wire Joins
Переглядів 6 тис.Рік тому
Two tips that have helped me when constructing Arduino projects. ► PCBWay $5 for 10 pieces www.pcbway.com So it's a more practical video this week as I share a couple of tips on how to desolder chips from PCBs without destroying either the chip, the PCB or neighbouring components. And how to join two low-voltage wires for (outdoor) use to make them strong and waterproof (mine's going into my go...
#258 ESP32 Web Pages AND OTA updates - just3️⃣libraries! ESP8266 also!
Переглядів 19 тис.Рік тому
Simple introduction to web-enabling your ESP32 (or ESP8266). ► PCBWay $5 for 10 pieces www.pcbway.com ► 1. Introduction Using the Arduino IDE 2.0.x available here bit.ly/Arduino2v0_IDE or Visual Studio Code (PlatformIO) Many more details including pictures, code and more: bit.ly/Web_Enabled_ESP32_With_OTA ► 2a. Installing the libraries (Arduino method) Go to the following GitHub site github.com...
#257 Wireless Serial Comms⚡for your Arduino (or other μController)
Переглядів 14 тис.Рік тому
Want to see the Arduino's Serial Monitor output remotely? Easy! ► PCBWay $5 for 10 pieces www.pcbway.com Much more information in my GitHub for this video: bit.ly/Wireless-Serial-Comms I want to send everything my project Arduino (or ESP32 etc) sends out on the TX pin to another Arduino on my workbench so I can see what's going on - remotely! Easy enough but there are some caveats if you want t...
#256 MAX7219 Matrix 3ft/0.9m Strip Display - Awesome 😉🎄🎅
Переглядів 6 тис.Рік тому
#256 MAX7219 Matrix 3ft/0.9m Strip Display - Awesome 😉🎄🎅
#255 Cheap PWM speed controller for my pond - but is it any good? 🧑‍🎄
Переглядів 7 тис.Рік тому
#255 Cheap PWM speed controller for my pond - but is it any good? 🧑‍🎄
#254 Web-enabled ESP32 Pond 🐠 Pump Controller - on my 📲 phone
Переглядів 6 тис.Рік тому
#254 Web-enabled ESP32 Pond 🐠 Pump Controller - on my 📲 phone
#BB11 Create an Arduino Library😨 - A Real World Example (Easy)
Переглядів 25 тис.Рік тому
#BB11 Create an Arduino Library😨 - A Real World Example (Easy)
#253 Accurate Task Scheduler for the Arduino (and STM32, ESP32...)
Переглядів 20 тис.Рік тому
#253 Accurate Task Scheduler for the Arduino (and STM32, ESP32...)
#252 SMD Soldering Walk-through - easier than you think
Переглядів 6 тис.Рік тому
#252 SMD Soldering Walk-through - easier than you think
#251 8-bit Shift Register for your Arduino's LEDs or 7-Segment Display
Переглядів 8 тис.Рік тому
#251 8-bit Shift Register for your Arduino's LEDs or 7-Segment Display
#250 Intel Core-i5 12600K PC Upgrade, 32Gb, 3Tb SSDs 🎉🥳What did I buy?
Переглядів 3,1 тис.Рік тому
#250 Intel Core-i5 12600K PC Upgrade, 32Gb, 3Tb SSDs 🎉🥳What did I buy?
#249 🎈7-Segment LED Digit Multiplexing with fewer GPIO pins
Переглядів 8 тис.Рік тому
#249 🎈7-Segment LED Digit Multiplexing with fewer GPIO pins
#248 Resistor Component Storage - it's been a rocky road
Переглядів 9 тис.Рік тому
#248 Resistor Component Storage - it's been a rocky road
#247 What's gone wrong? How do we know?
Переглядів 5 тис.Рік тому
#247 What's gone wrong? How do we know?
PCBWay 8th Anniversary Message
Переглядів 1,1 тис.Рік тому
PCBWay 8th Anniversary Message
#246 e-Ink e-Paper project with ESP32 Deep😴Sleep
Переглядів 8 тис.Рік тому
#246 e-Ink e-Paper project with ESP32 Deep😴Sleep
#BB10 Namespaces & Macros for Arduino (and other) microcontrollers
Переглядів 14 тис.2 роки тому
#BB10 Namespaces & Macros for Arduino (and other) microcontrollers
#245 Project Experiences - Better tools, connectors and more! 🎉🧨🥂
Переглядів 6 тис.2 роки тому
#245 Project Experiences - Better tools, connectors and more! 🎉🧨🥂

КОМЕНТАРІ

  • @allistergilbert4564
    @allistergilbert4564 12 годин тому

    Very cool

  • @geneh9210
    @geneh9210 День тому

    Glad I searched the Internet and found your video before implementing the P channel MOSFET technique for reverse polarity protection. The ChatGPT AI had told me about using a P channel MOSFET for this purpose, and it was adamant (if you want to call it that) to connect the source to BAT+ and the drain to the VCC load line. After watching your video and another from GreatScott, I told the AI that its configuration was wrong. The drain should be connected to BAT+, while the source should be connected to the VCC line. It finally agreed with me :) Thanks again for straightening this out!

  • @guidovlaere
    @guidovlaere 2 дні тому

    Thanks From the Netherlands Ralph. Very helpfull video. I'm really a fan from you. You made so many helpfull video's! Thanks again for all your work to make this! 👍

  • @philipwalker2800
    @philipwalker2800 4 дні тому

    Missing your videos Ralph - Hope all is well.

  • @vivektodmal1
    @vivektodmal1 5 днів тому

    Great but does it actually work on animals ? Do they get used to it ?

  • @ThierryC2373
    @ThierryC2373 9 днів тому

    This is a lot of confusing information when you simply are calling "intOne" twice then calling "result" which does increment with the function... Your videos are great but look like they are design to drag your feet on empty statements.

  • @Ancipital_
    @Ancipital_ 12 днів тому

    Thanks for the tutorial, really happy with it.

  • @djtomoy
    @djtomoy 12 днів тому

    Are you not still relying on the main loop to be fast enough to see all the state changes of your volatile boolean?

  • @gregcox9532
    @gregcox9532 13 днів тому

    Loving your series of videos. Your method of teaching is so clear and informative. Thank you.

  • @mohamedsadokjomaa5579
    @mohamedsadokjomaa5579 14 днів тому

    why i type in the serial monitor and hit enter there's no response how can i fix that

  • @TheMadManPlace
    @TheMadManPlace 14 днів тому

    I seem to remember this type of thing was called "timeslicing" back in the distant past.

  • @cobrashipwreck
    @cobrashipwreck 16 днів тому

    I started with an arduino then moved to a raspberry pi using a nunchuck connected to a wiimote over bluetooth. I found if you have too much going on the Arduino freaks.

    • @RalphBacon
      @RalphBacon 16 днів тому

      A technical term, obviously 😉 More accurately, the Arduino can be overloaded with requests/signals and become unresponsive and sluggish, agreed. But it is a relatively slow processor; the Espressif ESP32 is some 20x faster! The RasPi is not a real replacement as it has an operating system, so you can never be quite sure when it will service your latest (hardware) request, but it is even faster than an ESP32 so can easily handle the load.

    • @cobrashipwreck
      @cobrashipwreck 16 днів тому

      @@RalphBaconYou are not wrong in what you say. the raspberry pi seems to work great on my predator setup running 7 servos, 3 sets of lights, and a 100 sound effects with no issues. The key difference being you have to set it to run a script at startup that runs another script. Python and C are very similar now you just have to use different syntax for the respective language to accomplish the same tasks...

  • @markgilding6500
    @markgilding6500 18 днів тому

    Head scratching over Ralph. Thank you for this video. Used libraries from your Github. Switched on worked first time (after installing libraries!) Hoope you are keeping well.

    • @RalphBacon
      @RalphBacon 18 днів тому

      Glad you got it working and watch out for splinters 😆

  • @Ed19601
    @Ed19601 18 днів тому

    Interesting board. I am dabbling in the somewhat popular "cheap yellow display', but i presume in essence there isnt much difference

    • @RalphBacon
      @RalphBacon 18 днів тому

      Correct. The CYD is effectively a (touch) screen attached to an ESP32 with all the connections made for you. Doesn't give you (m)any GPIO pins to play with, so treat as a self contained display module!

  • @clausjrgenahlerhansen1236
    @clausjrgenahlerhansen1236 20 днів тому

    Great channel. I have at question regarding global variables. void loop() { int x=5; x will get reset after every turn, a global will not get reset. How to workaround it?

    • @RalphBacon
      @RalphBacon 20 днів тому

      Declare the integer as you have done in the loop but with the word 'static' in front of it. This will ensure it is removed (by the compiler) from the actual loop but is accessible to the code in there. A sort of pseudo global variable!

    • @clausjrgenahlerhansen1236
      @clausjrgenahlerhansen1236 20 днів тому

      @@RalphBacon Thank you Ralph😄

  • @ttac2011
    @ttac2011 20 днів тому

    Lots of blabla

    • @RalphBacon
      @RalphBacon 20 днів тому

      Thank you for the feedback.

  • @edwinov
    @edwinov 20 днів тому

    23:40 vTaskDelay takes ticks, not milliseconds

    • @RalphBacon
      @RalphBacon 20 днів тому

      Luckily, the ticks are the same as milliseconds here. I didn't want to confuse things!

  • @StarChild.no1
    @StarChild.no1 21 день тому

    If timeNow minus timeStarted is greater than (or equal to) setTimePeriod, do something and then reset timeNow to now.

    • @RalphBacon
      @RalphBacon 16 днів тому

      Um... I'm not clear of the context in which you are applying this. I do millis() now minus oldMillis > delay between iterations then reset oldMillis and do the work.

    • @StarChild.no1
      @StarChild.no1 16 днів тому

      @RalphBacon millis is timeNow, oldMillis is timeStarted and check if it's greater than delay - setTimePeriod. Reset oldMillis - is the new timeStarted, which is now..

  • @mattpfeiffer7528
    @mattpfeiffer7528 21 день тому

    Hi fantastic videos thanks! Also, how did you get those color coded bars on the left side of your code organizing it?

    • @RalphBacon
      @RalphBacon 16 днів тому

      I use VSC/PlatformIO and it's an add-in called something like Rainbow Indents (MS will suggest it)

  • @patrickkeirton6458
    @patrickkeirton6458 22 дні тому

    Thank you for all these tips and tricks, much appreciated! I appreciate that JLCPCB is your sponser, I have had nothing but nighmares with them for anything even moderately complicated.

  • @Enigma758
    @Enigma758 23 дні тому

    In the ToneAC documentation, it's mentioned that a 100 ohm resistor should be placed on one side of the piezo buzzer.

    • @RalphBacon
      @RalphBacon 16 днів тому

      Hmm, it depends on how much current the buzzer is going to take. More than 20mA seems unlikely but a 100Ω resistor will ensure current is limited to 5/100 = 50mA, still a bit high as 40mA max per pin!

    • @Enigma758
      @Enigma758 16 днів тому

      @@RalphBacon Yes, makes sense to go higher on the current limiting resistor, but I noticed that you ommitted the resistor altogether and I was curious to know why you did that.

    • @RalphBacon
      @RalphBacon 16 днів тому

      Because my buzzer only consumed a few milliamps, not enough for any concern. Measure it with a multimeter to determine whether a resistor is really necessary!

    • @Enigma758
      @Enigma758 16 днів тому

      @@RalphBacon Good point, better to actually test to see if it is needed rather than just mindlessly following general rule!

  • @WrakArman-ny9mo
    @WrakArman-ny9mo 25 днів тому

    Great job sir! I want to display this two-way communication with LEDs instead of a serial monitor. Pleas guide sir Tnx alot

    • @RalphBacon
      @RalphBacon 16 днів тому

      You can use IR (infrared) diodes to do this. A modulated signal (like a TV remote control) should work.

  • @mojibake7868
    @mojibake7868 25 днів тому

    This also works with polling instead of using interrupts FYI. I'm doing a project with ±16 encoders and some switches on an ESP32 so I don't have enough interrupt pins. I'm using multiple HC165 shift registers to read my input (encoders+switches) states, and I'm polling for changes. The function from Marko Pinteric works like a charm! I've struggled with getting correct values from my encoders for many hours, but this seems to work perfectly :)

    • @RalphBacon
      @RalphBacon 16 днів тому

      Glad you got it working OK! Wow! 16 encoders, a glutton for punishment!

  • @rodneytapit5636
    @rodneytapit5636 25 днів тому

    Thanks for good informative video Ralph. Is it possible to use ESP-NOW to send voice from a I2S microphone to a second ESP32?

    • @RalphBacon
      @RalphBacon 16 днів тому

      No, not really. ESP-NOW is limited to a 256-byte data packet, not a continuous stream. That said, you might be able to send enough packets per second to transmit audio that is clear.

  • @klausbrinck2137
    @klausbrinck2137 27 днів тому

    I don´t know a lot about electronics, but noticed, that people use many gate-driver-designs... Is a LL-mosfet also in need of those drivers, or does the fact, that it conducts at 1,3v, lets it work finely even with solely an arduino? I´m thinking thereby of course on the switch-on/off-speed of the mosfet. In other words, turning on already at 1,3 out of 5 available volts, lets it turn on faster (shorter turning-on time), cause at just 1,3v the arduino has more mA left to give, and thus shorten the turning-on-time (????????????) In my case, I want to drive cleanly a mosfet at 5-30kHz, 1-2Α (so, not long delays while turning on/off), and looking for any easy way to do it, without having to study electronics first... ;-( Thanks á priori for every answer...

    • @RalphBacon
      @RalphBacon 16 днів тому

      A TTL-level MOSFET will switch cleanly but the propagation delay can only be found by (a) reading the data sheet (to see the delay in switching on) and (b) by trying it out using a 'scope. Best not to use any kind of gate resistor (slows down the gate capacitor charge time) even though some people seem to think they are necessary (I don't, but what do I know?)

    • @klausbrinck2137
      @klausbrinck2137 16 днів тому

      @@RalphBacon Ok, thanks, so, my "very basic" assumptions were right... My perspective was to avoid artificially prolonging the data-sheet-delay by wrong-handling, and not to shorten that delay even further, so, thanks. The "trick" with the no-gateresistor, I´ve learned about it recently, too, after I have posted my question (above) to you. Still, the knowledge about the gate-resistor didn´t mean, that my question didn´t need any answer, so, your answer was bitterly needed, still... So, a big "Thanks" again...!!!

  • @TBoy58_405
    @TBoy58_405 29 днів тому

    Hope to see you back soon Ralph. I appreciate that you need your life balance, but once you have us hooked, you’re easily missed. Take care. Talk soon 👍🏾🤓

  • @TheRealNVT
    @TheRealNVT 29 днів тому

    Ralph, I hope you are ok, missing your content

    • @RalphBacon
      @RalphBacon 16 днів тому

      Whatever you do, don't unsubscribe or you will miss any future videos!

  • @noweare1
    @noweare1 Місяць тому

    Excellent Ralph, I have been wanting to get more familiar with libraries but do not know C++. This is a very good starting point though.

    • @RalphBacon
      @RalphBacon Місяць тому

      Glad you are finding it useful.

  • @kevingpearce
    @kevingpearce Місяць тому

    A great video as always Ralph. I've got a couple of unused ESP2-VROOM modules that I'd like to press into service, so I have downloaded your sketches for the ESP32 Tx and Rx. The Tx sketch compiled and uploaded to my board fine. But the Rx sketch will not successfully compile, and throws up the following error: Compilation error: invalid conversion from 'void (*)(const uint8_t*, const uint8_t*, int)' {aka 'void (*)(const unsigned char*, const unsigned char*, int)'} to 'esp_now_recv_cb_t' {aka 'void (*)(const esp_now_recv_info*, const unsigned char*, int)'} [-fpermissive] Why, and what does it all mean ?

    • @RalphBacon
      @RalphBacon Місяць тому

      Is that from my sketch or have you modified it? It seems to be complaining that the receive data structure is not what it is expecting. Email me the sketch if you still have issues and I can have a look much more easily than trying to do it here! (Email address is in my about page on the channel, only visible on a PC, not a phone).

    • @RalphBacon
      @RalphBacon Місяць тому

      OK, got your email and understand that downgrading the ESP framework (eg from 3.0.0 to 2.0.14) solved it for you. This is an ongoing problem with the new Espressif Arduino framework using the newer IDF (Espressif framework) APIs. OLD ESP-NOW callback function: void OnDataRecv(const uint8_t *mac, const uint8_t *incomingData, int len) {... your code...} NEW ESP-NOW (Framework 3.0) callback function: void onDataRecv(const esp_now_recv_info_t *info, const uint8_t *incomingData, int len) {... your code...} If you used to access the (old) first parameter of the sender's MAC address, you can get that now from the 'info' parameter pointer thus: info->src_addr although you will have to convert the octets into printable bytes as we always have had to.

    • @tabmaryland2333
      @tabmaryland2333 25 днів тому

      @@RalphBacon Thank you both!!! I just started working with ESP-NOW and I was very frustrated with this invalid conversion error. Have a great day!

  • @hucobo
    @hucobo Місяць тому

    Thanks for the explanation, I think I understand it. I like to program an Arduino for more then just 2 leds which flash. I have written a simple skecth for two photographers who are waiting for a train to enter a platform and then shoot each two pictures with a random pause between the flashes. But watching your explanation for state machine, I like to use more outputs of the Arduino... ;-)) I will give it a go and will try to write these flashes as (finite) states.

    • @RalphBacon
      @RalphBacon Місяць тому

      Flashing LEDs are all well and good for a visual demo, but most users like yourself will want to do something more useful. Start small, and expand. It's too easy to not spend enough time on drawing out all the possible states and start coding before you're ready! Don't ask how I know this. 🤦‍♂️

  • @iantcroft
    @iantcroft Місяць тому

    Hi @Ralph S Bacon Thanks for your efforts on this and making it public. I had a look on your GitHub but couldn’t find the code for this project. Is it available? I have just received some Si4599 duel mosfets and with help from your schematic have got it on breadboard now and working great! - Joy 😁. I am just trying to monitor the button now so I can switch the project off manually rather that waiting for the count down to end. The code from your auto switch off project doesn’t monitor the button. I will also experiment with the normal way to read the button. Thanks.

  • @TheUnofficialMaker
    @TheUnofficialMaker Місяць тому

    will you be making anymore videos or are you done?

    • @RalphBacon
      @RalphBacon Місяць тому

      Not done, exactly but certainly taking a break. Getting my life back! I've several topics in mind for future videos and I'm sure I'll eventually get the time to do the videos.

  • @user-ic4xj1kl8r
    @user-ic4xj1kl8r Місяць тому

    Thank you, great job Is there a way to factory reset the Arduino Leonardo board ؟

    • @RalphBacon
      @RalphBacon Місяць тому

      By "Factory Reset" what do you mean? When it comes out off the production belt it normally has the Blink sketch loaded (just to give a visual indication it's all working) but that's almost irrelevant. Can you still upload sketches to the board?

  • @jukkapekkaylitalo
    @jukkapekkaylitalo Місяць тому

    y do not need adaptor just squeeze flux from big syringe to little one. The little one have the same little larger end in other end. Then just squeeze the little one until flux comes out of the other end.

    • @RalphBacon
      @RalphBacon Місяць тому

      Thanks for the info, sounds pretty easy!

  • @WagonLoads
    @WagonLoads Місяць тому

    I want to know if there is a RTC with a programmable register that tells the RTC how many ticks of the crystal to one second? The reason.. I want to make a RTC run a 24 hour day on Mars time... 1 Mars day = 24h 37m Earth time I want to do it in such a way, that I set it only one time using NTP,, then let it keep Mars time on it's own from that time going forward...

    • @RalphBacon
      @RalphBacon Місяць тому

      So you want a Mars RTC? I've never heard of anything that keeps anything other than Earth time, but you could program a simple Arduino (UNO/Nano) to keep Mars time instead. The downside of using any kind of electronics is that you will be hard pushed to run it on a battery like the DS3231 (pretty accurate). You _could_ put it to sleep for a second, wake up, do the necessary calculations and put it back to sleep again to enable running off a battery but an Arduino will still take several milliamps for the short period it is running. You mention using NTP to set the time (initially). That requires Internet access. If you don't need to run it on a battery then one of the small, newer ESP32 devices do this all automatically (for Earth Time) but you could easily run a simple routine to convert to Mars Time. The ESP32 gets the time from NTP periodically to ensure there is no drift as every microcontroller I've ever tried is not accurate enough for a clock. I'm wondering if a DS3231 that has been correctly set initially could be used with an ATTINY processor of some sort so it can run on a battery for months if not years...? Finally, if I were a Martian I would not say that my day is 24h and 37min (ie based on Earth time). It would just be 24 hours (or whatever the Martians agreed) and each "second" would be a longer-than-Earth second and so on. Now that could be programmed just by counting 'ticks' in a microcontroller (milliseconds) and then translating that to Mars seconds, minutes and hours. Just a thought.

    • @WagonLoads
      @WagonLoads Місяць тому

      @RalphBacon I want to thank you for responding to my crazy question. The NASA Mars Rover team runs on Mars time, so they know when the window to transmit to the Rover is open.. (Rover being on the Earth side of Mars) So in my scenario, if the Mars Rover had a spotting scope pointed straight up. Every time Earth passed the center field of view, would be noon.. (I know real Mars noon is based on the sun..not Earth) but I want a clock that would tell me when the Mars Rover was on the Earth facing side of Mars.. (6AM to 6PM Mars time) If I had to look it up every day, then there would be no point to using a RTC at all... My RTC is the Ds1307.. It has an error of 7 seconds a day, which means I would have to NTP 7 times a day to keep it accurate to the second.. I was hoping there was a RTC that I could tweak the tick counter to compensate for tolerance errors in the crystal... If it is fast by 7 seconds a day. How many ticks do I need to adjust by so it is accurate to 1 millisecond a day??? Do you know of any RTCs that have a tick count register to adjust how many ticks equals one second? Then I make a 24 hour Mars day = (24h 37m 22.5s Earth time) The only problem this would not fix is a Mars year is over 600 days but I would at least have the Mars 24 hour day worked out... I hope you could do a video on making a Mars clock to solve this problem.. One that you only need to set one time a year or better...

    • @RalphBacon
      @RalphBacon Місяць тому

      I'm afraid I don't know of a variable/programmable RTC, but the DS1307 is very poor at keeping time, which is why I mentioned the much more accurate DS3231. A daily NTP update is all you need, at most, perhaps even once a week is good enough. If you don't need to run on a battery (like the RTC does) then you can easily program your own Mars clock, ideally with a huge LED display so you don't miss a critical time (like the ones NASA uses when a meteor is about to impact Earth). Using an ESP32, it auto-updates from an NTP. Although you mention "Mars Time", you know how many seconds in a Mars Hour, Day etc so by using a standard RTC DS3231, you can just count the Earth seconds and create your own Mars clock.

    • @WagonLoads
      @WagonLoads Місяць тому

      @@RalphBacon My thought was to proportionally stretch the 24 hour RTC day, so it takes 24h 37m 22.5s to complete (or whatever the actual calculated Mars day is).... The problem with using (Earth time RTC) is knowing how many days expired since it was set.... Is it possible to edit the RTC library to stretch a 24 hour day? I would be glad to use another RTC... I was looking at the data sheet for the RV-3028-C7 (RV-3028-C7_App-Manual.pdf) and it looks like it has (calibration registers) to adjust Aging compensation with user programmable EEPROM Offset value (Factory Calibrated value may be changed by the user) but I don't know if I could add as much as 37m to a day.. My thought on making the RTC keep the time, is if I set it, I could put it away for a month or two and when I get it out, it is still on Mars time.. Anyway, thank you so much for your ideas.. I would love to see if such a thing is possible..

    • @RalphBacon
      @RalphBacon Місяць тому

      I was thinking more in terms of counting the seconds from a DS3231 (probably using an interrupt) via the 1Hz output pin, and then in the Arduino program incrementing the user-controlled secs/mins/hours/days etc according to Mars rules. That way, you have full control over all aspects of Mars time.

  • @vishwanathb4181
    @vishwanathb4181 Місяць тому

    Useless device, not catching anything, and whatever catching is too weak

    • @RalphBacon
      @RalphBacon Місяць тому

      More likely your antenna is not correctly attached, or you live up a mountain, as I got a number of stations in a town (as the video demonstrated, I believe).

  • @jumbo999614
    @jumbo999614 Місяць тому

    I'm going to use this trick to make my 8x8 dot matrix led which requires 2 sets of 74xx595 IC. I already soldered ATTiny85 and 74xx595 onto the PCB and I just found out pin5 is not usable until reset is disabled. You mentioned it's weak I/O pin. Does it have enough current to make 74xx595 clock pin work?

    • @RalphBacon
      @RalphBacon Місяць тому

      It _might_ work with its weak output - or else wire it to a transistor to boost the signal. Make sure you test your design on a breadboard first!

    • @jumbo999614
      @jumbo999614 Місяць тому

      @@RalphBacon Thank you for your advice. I have more questions. What is Zener Diode model number you put in your circuit? How many voltage and how many watt? and what value of that capacitor?

    • @RalphBacon
      @RalphBacon Місяць тому

      Are you talking about the fuse resetter circuit, or something else? No Zener in the former, hence my query.

    • @jumbo999614
      @jumbo999614 Місяць тому

      @@RalphBacon At 21:17, there is one component next to the capacitor. It sits between 12v rail and resistor that goes into the collector of the BC547 transistor. It looks like Zener Diode. That's why I'm confused.

  • @miguelraulgonzalez7744
    @miguelraulgonzalez7744 Місяць тому

    Brilliant!!!

    • @RalphBacon
      @RalphBacon Місяць тому

      Thanks for the feedback!

  • @hiddevandijk143
    @hiddevandijk143 Місяць тому

    Just wrote my first library after seeing this video a few times. Never understood it before, but now it starts to make sense. Thank Mr Bacon.

    • @RalphBacon
      @RalphBacon Місяць тому

      I'm delighted you did this! Congrats! Start small and then you can increase the complexity of your library (class). 👍

  • @adamhartman8361
    @adamhartman8361 Місяць тому

    Do you have any suggestions on how to go about listing all the states and actions for a system? Is there a best practice for describing a typical use case and then converting that description into states and actions? Any resources you can suggest would be a great help.

    • @RalphBacon
      @RalphBacon Місяць тому

      Well, it's been a long time since I learned how to do SM programming, but from what I remember the most important thing it so list (in bubbles) all the possible states that your device could find itself in, then link the states (with an arrow) that defines the action (or change of state) to bring it to that state. Your best bet is to search UA-cam for a simple, beginners intro into this topic - I bet there are loads!

  • @sandesh.achari
    @sandesh.achari Місяць тому

    Thanks, Ralph for a clean demonstration. Very nice!

  • @river6210
    @river6210 Місяць тому

    Good video!!! i have a cuestion for you, is it possible to obtain de RSSI information of this transmitter? Thank you

    • @RalphBacon
      @RalphBacon Місяць тому

      The receiver module that you use might already have this functionality - or you might have to build one yourself with a simple BT receiver module. You phone might have an app available to do this too, I use one for Wi-Fi so maybe someone has built one for BT too?

  • @c0smiq
    @c0smiq Місяць тому

    Thanks for the video. Really educational :) I have an old T-65 which needs some kind of cool project, and this helps.

  • @vannogbrod
    @vannogbrod Місяць тому

    Hi, I love your videos, perfect teacher, but when not in your class I cant raise my hand :-) Please explain line 21-23-25, I don't get it... (case and switch). Is log-v a macro to enable/disable Serial.print?

    • @RalphBacon
      @RalphBacon Місяць тому

      Yes, you at the back, what's your question? Switch/Case? It's just a nice "IF" style construct. Instead of multiple, nested (and unmaintainable) if else... if else... statements we just use ONE switch case to inspect a (numeric) variable, then have a CASE statement for each matching condition. log_v is an ESP32 logging macro that only logs if the build debug level is set to VERBOSE (v). There's a version for d (Debug), i (Info) w (warning) and e (error) too. Try it out, very useful.

    • @vannogbrod
      @vannogbrod Місяць тому

      @@RalphBacon Thanks for giving me answer. The "case" way I now get, I now use it to se esp wake up reason.

  • @aliwhoisalive3288
    @aliwhoisalive3288 Місяць тому

    Ive once bought a flux that came with a metal can, and i thought putting it in a syringe would make the work much easier, i simply put the can in the air fryer with the lid off and turn it on on the lowest heat, 80c, after three or four minutes it melted completely and simply sucked by the syringe, you can use this method or putting it in hot water even if it came in a plastic container, just remember to not use very hot water it could possible melt the plastic

    • @RalphBacon
      @RalphBacon Місяць тому

      Yes, I've tried this too, but once re-solidified the flux can be too solid for a syringe to work well. You might have to add some extra "flux thinner" aka IPA.

  • @wayneski4
    @wayneski4 Місяць тому

    you guy that make these videos and don't keep them up to date should shut the video down or fix any issue that have arises for example sketch no longer works that come up error no good

    • @RalphBacon
      @RalphBacon Місяць тому

      I don't believe there are any issues with the information in this video; it's a barebones ATMega328p chip running in a minimal configuration! What's the problem you're experiencing?

  • @MrFixitMods
    @MrFixitMods Місяць тому

    I am trying to use a similar chip for a BT project of mine in a Gameboy, there are tons of tutorials online about this but none of them show a way to turn off the stock speaker on the gameboy when this chip is turned on... Would you happen to have any idea about how someone would go about doing this? there is a headphone jack on the Gameboy but it uses a mechanical switch in the headphone port to switch off the speaker rather than through an electrical connection. So if you install this it keeps the stock speaker on and you have BT at the same time which is not the desired result I'm looking for. I want the speaker to shut off when I turn on the chip or pair my headphones.

    • @RalphBacon
      @RalphBacon Місяць тому

      I've had a similar situation; I just got a pair of earphones and plugged them into the device to shut it up, and listen to better quality via the BT method. You could also just use a spare jack plug, not a complete set of headphones to do this. Simple and fairly unsophisticated, but it does the job!

  • @Rperes2000
    @Rperes2000 Місяць тому

    Thank you. Very good work!

  • @joaquingutierrez3072
    @joaquingutierrez3072 Місяць тому

    Amazing