The 433 HZ RF transmitter destroys my project if there is a digitalRead in the code

#include <RH_ASK.h>


const int speed = 2000;
const int pinReceive = 6;   // not used on the transmitting side
const int pinTransmit = 4;
const int pinPushToTalk = -1; // not used and not sure if that is the right description

RH_ASK driver(speed, pinReceive, pinTransmit, pinPushToTalk);

void setup() {
    Serial.begin(115200);
    if (!driver.init())
        Serial.println("RF Driver Init Failed");
  Serial.println("setup");
}

void loop() {

int read =  digitalRead(10);

    char msg[] = "Hello";
    driver.send((uint8_t *)msg, strlen(msg));
    driver.waitPacketSent();
    delay(1000);
    Serial.println(msg);
    Serial.println(read);
}```


If I comment out     driver.send((uint8_t *)msg, strlen(msg)); it works just fine, or if I comment out int read =  digitalRead(10); it works just fine. I have tried different pins, different, Arduino Nanos, and different transmitters. The only piece of code that breaks it is the digitalRead, even the analogRead works just fine. Is anyone able to help with this issue?

I completely missed what your problem is. You’ve done a great job posting the code, but what exactly is it controlling? Providing an annotated schematic would go a long way in helping us assist you more effectively.

By "works just fine" what do you mean? Surely it is no longer transmitting msg to the receiver.

Can you please say what sort of Arduino you are using.
Is the Title correct? Should it not be "433MHz".

What exactly does the RH_ASK library do, and why are you using it?

Honestly, I'm not that smart, so I don't know what an annotated schematic is. The Nano is controlling a transmitter, probably 433 MHZ which I saw was commented, and I am trying to send strings using that transmitter and receive them on the receiver. Without any digitalReads in the code, the code works and I can transmit strings by radio and receive them using a receiver, but when there are digitalReads, the code just freezes and won't proceed past the driver.send line.

When it works, it will transmit the message and print the lines at the bottom, but when it doesn't work, it will print the "setup" once and do nothing else after and just freeze.

Like I said, I'm not a genius and am not sure how exactly libraries work, but I use it to communicate with the transmitter to actually transmit the strings. All of the lines with driver are part of the library.

Here are the websites for the transmitter and receiver
Transmitter and receiver

This is the link to the library
RH library

That is easy to figure out, use your search engine. "An electronic schematic is a graphical representation of an electrical circuit that uses standardized symbols to show the components and their connections. It serves as a blueprint for designing, building, and troubleshooting electronic circuits." This will help: The Basics of Schematics: Understanding Circuit Diagrams and Symbols

It seems like you might not be fully prepared to tackle this project just yet. I strongly recommend getting a copy of the Arduino Cookbook and reading it thoroughly. It’s a fantastic resource that will help build your knowledge and confidence.

Starting with Arduino: My Recommended Approach

It seems you might not be fully ready to start the project just yet, but that’s perfectly okay! We don't know your skill set or what resources you have at your disposal, so I recommend starting with some online tutorials. While the quality varies, many tutorials are excellent and will help you build a solid foundation.

Here’s How to Get Started:

  1. Learn the Basics: Begin with the fundamentals, such as controlling outputs (like LEDs) and interpreting inputs (such as reading a switch or receiving a message). LEDs are a great starting point since they’re inexpensive and most Arduino boards come with a built-in LED.
  2. Explore Basic Electronics Tutorials: Look for beginner-friendly tutorials on electronics concepts. These will help you understand key principles that you’ll need as you progress.
  3. Recommended Resources:
  • Arduino Cookbook: Consider going through the Arduino Cookbook, which is a comprehensive guide filled with practical projects and step-by-step instructions.
  • Online Tutorials: Check out YouTube channels like CodeBeauty for easy-to-understand lessons presented in small, digestible parts.
  • Embedded: Arduino Interrupts Tutorial & Examples
  1. Learning the IDE: During this process, you will also learn what an IDE (Integrated Development Environment) is and how to use it to write, generate, and upload your code to the Arduino.
  2. Practice and Learn at Your Own Pace: Everyone learns at different speeds, and that’s completely normal. It may take a few months to grasp the basics, but with consistent practice, you’ll see progress.

Additional Help:

Please keep us updated on your journey, and don’t hesitate to ask questions as you learn. We’re here to help and guide you along the way!

Ok to be honest I was making it seem like I'm dumber than I am, I am making a remote controlled tank, and I used to be using an ESP32, bluetooth and an Xbox controller, but there were problems with the ESP32. Now I am creating my own controller, and it worked perfectly two days ago and I could send and receive a string of all of the information I needed from the controller, but then I left for a couple hours and then everything broke itself and none of my Arduino Nanos would do anything. Yesterday I tried again and the Nanos worked all of a sudden but then I found this issue, so I am using just the basic code to try and troubleshoot it, but I'm not sure why it used to work fine and now it doesn't and what's causing the issue. I'll try my best to send a schematic.

I’m sorry, but I don’t have time to engage in unproductive discussions. My time is valuable, and I prefer to assist those who genuinely appreciate the help provided on this forum. Best of luck in finding an answer! I am Out!

This is all the schematic is. The big one is the Arduino Nano microcontroller and I couldn't find any way to add the transmitter, so I put this instead and am only using the 3 pins I need for the transmitter. Q0 I am using as power and the Pin4 is the VCC on the transmitter, Q1 is ground and Pin2 is GND on the transmitter, and Q2 is any digital pin on the Nano and Pin0 is the data pin on the transmitter.

ChatGPT told me to add a capacitor between the VCC and GND, but it didn't fix the issue.

Well I have been working on changing the code to try to fix the issue and all of a sudden it fixed itself when the code and circuits are both the same as before. Is there any reason it should be breaking and fixing itself without changes in either hardware or software?

Flimsy wiring or bad soldering for example...