• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

OUTPUT not working. ESP32 WROOM 32

Q&A Forum › Category: ESP32 › OUTPUT not working. ESP32 WROOM 32
0 Vote Up Vote Down
Kenneth Flucas asked 1 year ago

Hello Random Nerds. I have a problem with getting an output on 2 ESP32s (ESP32 WROOM 32). I wrote a code using TouchPad as the INPUT and the OUTPUT turning on a LED. The code and circuit worked as expected on esp32#1. Trying the exact same code & circuit on 2 more ESP32s did not work. The input worked as expected but there was no OUTPUT…..the LED did not turn on. All 3 ESP32s were flashed with the exact same firmware. The Blink.py code worked on all 3 as well. On the 2 I’m having issues with I even tried a different GPIO for the OUTPUT but still got the same results. Can someone please point me in the right direction to resolve this issue? The code I used is below. Please keep in mind that the exact same code & circuit worked as expected on ESP32#1 but did not work on ESP32 #2 & #3. Thanks in advance. 
 
from machine import Pin, TouchPad
from time import sleep
 
touch_pin = TouchPad(Pin(4))
led = Pin(15, Pin.OUT)
 
while True:
    touch_value = touch_pin.read()
    print(touch_value)
    if touch_value < 500:
        led.value(1)
    else:
        led.value(0)  
    sleep(0.5)
       

Question Tags: D15, ESP32, GPIO15, not working, Output
5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
have you tried changing the GPIOs both of them?
Can you share a link to the boards that you have?
Regards.
Sara

0 Vote Up Vote Down
Kenneth Flucas answered 1 year ago

Hello Sara. I truly do appreciate you getting back with me, and as quickly as you did. That was awesome. Thanks again. I found the problem. I neglected the GNDs on boards #2 and #3. I kept seeing the GND from board #1 connected to the breadboard  and didn’t realize I did not have the GNDs from boards 2 & 3 connected to the breadboard. While I have your attention perhaps you can help me with my new issue. Using the same code & circuit, everything works while connected to my PC using the Thonny IDE. I have my touch code along with ‘boot.py’ uploaded to all 3 boards. I did not press the reset button before disconnecting from my PC. Using an expansion board with a  9 volt battery I could not get the touch code to run on neither of the 3 boards. What could I be doing wrong? 

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
You need to upload the code you want to run on the board automatically with the name “main.py”.
When the ESP32 boots it automatically runs the main.py file.
Let me know if this solves your issue.
Regards,
Sara

0 Vote Up Vote Down
Kenneth Flucas answered 1 year ago

Aaaaahhh🤔 It was previously said to use ‘main.py’ or it would not work. I thought it was just for that particular lesson. Is it safe to assume that that is the case across all versions of ESP32s? Is there no way to change that? If I have 5 boards running 5 different codes they would all be named ‘main.py’? So I will have to come up with a way to know which code is on each individual board.

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
Yes, the ESP32 will only run automatically the file called main.py.
 
What you can do is to call your file (that has a different name) from inside the main.py file.
 
Regards
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.