Cannot convert String to Int


I am having problems converting a string to an integer. I am trying to use some RF modules to transmit potentiometer analog readings to another Arduino. The receiver code is where the problem is.

// Include RadioHead Amplitude Shift Keying Library
#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
    // Setup Serial Monitor

void loop()
    // Set buffer to size of expected message
    uint8_t buf[4];
    uint8_t buflen = sizeof(buf);
    // Check if received packet is correct size
    if (rf_driver.recv(buf, &buflen))
      // Convert received data into string
      String str_out = String((char*)buf);

      // Print values to Serial Monitor

      // Convert String to Int
      int int_out = srt_out.toInt();


This code runs into problems trying to convert the string to an integer. the following error is returned.

Reciever:47:21: error: 'srt_out' was not declared in this scope

       int int_out = srt_out.toInt();


exit status 1
'srt_out' was not declared in this scope

What could be causing this?


What could be causing this?

Maybe the fact that you do not have a variable named srt_out in your sketch ?

You do, however, have one named str_out

Well, that would do it.


Well, it does pay to read the error message and of you don't understand it, read it again