• 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

Module 2 error?? 'T0' was not declared in this scope

Q&A Forum › Category: Arduino › Module 2 error?? 'T0' was not declared in this scope
0 Vote Up Vote Down
Clyde Cox asked 5 years ago

So far so good, but when I try to run the Touch Sensor example outlined in Mod 2, Unit 2 I get the following error:
“T0 was not declared in this scope”
What am I missing?

Question Tags: "TouchRead" gives error, Module 2 Touch Sensor example
6 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

Which ESP32 board do you have selected in your Arduino IDE (is it the ESP32 DOIT DevKit V1?)?

0 Vote Up Vote Down
Clyde Cox answered 5 years ago

I’m using the OLIMEX ESP32-EVB.

ESP32_CORE_BOARD_V2

0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

I’ve just checked now and unfortunately that pin definition with the T’s is not properly set to all the boards.
Instead of using T0, you’ll need to replace it with the GPIO number, for example 4 (which is the touch pin used in Module 2 Unit 2):

Serial.println(touchRead(4));

https://rntlab.com/esp32-touch-sensor/
Does using 4 as a parameter solve the problem for you?
Thanks!

0 Vote Up Vote Down
Clyde Cox answered 5 years ago

I recompiled the code using  ESP32 DOIT DevKit V1 as the selected device and it works fine.
Is it safe to assume the  ESP32 DOIT DevKit V1 will work after this?
I also ordered an ESP32 DOIT so in the future I can exactly follow the instructions.
Thanks for the quick response!

0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

You’re welcome!
I think that using the 4 number to refer to GPIO 4 might be a better approach than using T0, because it ensure that it works for everyone. I’ll update the course to use the 4.
I think that all the other projects should work for you, even if you have the “OLIMEX ESP32-EVB” board selected. I think that Unit was the only special pin definition case that I can remember…
 

0 Vote Up Vote Down
Clyde Cox answered 5 years ago

THANKS 

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] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

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

Copyright © 2013-2023 · 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.