remote control car

Hello I am trying to only use only one transmitter and receiver each 433 mhtz to make a remote control car. I am using 4 regular dc motors to drive this car. I am also trying to have 4 controls,forward,left,right,backwards. For some reason the receiving end isn't doing anything even though the Serial monitor gets all 4 different messages I have already tried a BUNCH of stuff from the internet. Here's the transmitter code:

#include <RH_ASK.h>
#include <SPI.h> 
 
RH_ASK rf_driver;
 
void setup()
{
 
    rf_driver.init();
}
 
void loop()
{
    if(digitalRead(29) == 0){
const char *msg = "a";
    rf_driver.send((uint8_t *)msg, strlen(msg));
    rf_driver.waitPacketSent();
}
  if(digitalRead(42) == 0){
const char *msg = "b";
    rf_driver.send((uint8_t *)msg, strlen(msg));
    rf_driver.waitPacketSent();
}
  if(digitalRead(4) == 0){
const char *msg = "c";
    rf_driver.send((uint8_t *)msg, strlen(msg));
    rf_driver.waitPacketSent();
}
  if(digitalRead(37) == 0){
const char *msg = "d";
    rf_driver.send((uint8_t *)msg, strlen(msg));
    rf_driver.waitPacketSent();
}
}

And here's the receiver code:

#include <RH_ASK.h>
// Include dependant SPI Library 
#include <SPI.h> 
 
// Create Amplitude Shift Keying Object
RH_ASK rf_driver;
 
void setup()
{
    // Initialize ASK Object
pinMode(12,OUTPUT);
pinMode(13,OUTPUT);
pinMode(52,OUTPUT);
pinMode(53,OUTPUT);    
rf_driver.init();
    // Setup Serial Monitor
    Serial.begin(9600);
}
 
void loop()
{
    // Set buffer to size of expected message
    uint8_t buf[24];
    uint8_t buflen = sizeof(buf);
    // Check if received packet is correct size
    if (rf_driver.recv(buf, &buflen))
    {
      
Serial.println((char*)buf);         
if((char*)buf == "a"){
digitalWrite(12,HIGH);
    }
if((char*)buf == "b"){
digitalWrite(13,HIGH);
}
if((char*)buf == "c"){
digitalWrite(52,HIGH);
}
if((char*)buf == "d"){
digitalWrite(53,HIGH);
}
}

For some reason nothing is lighting up, can someone tell me why???

I'd try comparing characters rather than strings.

I'd also give pins names, and make sure I always set their pinMode.

What data type will be in the buf array when data is received ?

You cannot do comparisons between C style strings like that

If buf is a C style string then try

if (strcmp(buf, "a") == 0)  //compare buf and "a"

just to be clear, it does show the 'a' in the Serial monitor, but doesn't light up whatever you have connected to pin ?

Serial.println((char*)buf);         
if((char*)buf == "a"){
digitalWrite(12,HIGH);
    }

but you buffer is 24 bytes long yet you compare it as a char* , but for one thing your buffer is not null terminated, and secondly, that is not the way to compare char*, use strcmp() instead. Still if you only want the single character, you could compare

if( (char) buf[0] == 'a')

i think you probably don't even need to cast it.

Yes the serialmonitor printed a and do I have to add anything when I do strcmp() like change the char to a string

Why use strcmp?

If you're interested only in characters, compare with characters.

Yes I've been trying that but every time I try to extract the data from the Serial monitor on the receiving side it has failed do you know a way?

Did you see reply #3?

Yes and it said "that is not the way to compare char*, use strcmp() instead." but I researched on that and that only compares STRINGS not CHARACTERS. So I tried converting it and I messed up so now I am asking how.

Can we get back to basics ?

Exactly what is received into the buf array ? For instance is it a series of bytes (chars) or is it zero terminated to turn it into a C style string ?