I'm working on a project for which I am using a wireless radio transmitter and receiver.
I'm using the transmitter to send a string of 3 digits.
The receiver maps these and converts them to an int.
When i try to use this int to controll the analogwrite function, the servo i'm trying to controll doesn't respond at all.
The Serial.print is outputting the correct values in the serial port.
I have no clue what the problem might be at this point.
A servo motor ?
There is a servo library for that: Servo - Arduino Reference.
A servo motor uses specific pulses. Some will say that those pulses are some kind of PWM signal, but don't call it a PWM signal
The analogWrite() is for a DC motor for 0% to 100% power or for a led from 0% to 100% brightness.
I assume that you have a integer in the Transmitter. So you convert that to text and then in the receiver to a String to a integer to a String to a integer. That is not very efficient
When you use the RadioHead to transmit two bytes of a 16-bit integer (not as a text, but the binary data), then you have a integer. I think that is all that you want. Perhaps all you need is a single byte for a value of 0 to 180.
For the RadioHead, I suggest to use a MKR/Zero/M0 board. The RadioHead uses a lot of memory and that might be a problem with an Arduino Uno/Nano. Some fall back to the older VirtualWire library. The RadioHead has bug fixes, but the VirtualWire still works good enough for the Arduino Uno/Nano boards.
Both the VirtualWire and RadioHead set three pins to their default pin numbers. You have to check that. You could set them to unused pins.
The very cheap 433MHz transmitters and receivers have no processing on the module. The complete protocol is done in software in the VirtualWire and RadioHead library. That means the interrupts of the Servo library might reduce the reliability of the VirtualWire/RadioHead. Some libraries turn off the interrupts for a while (NeoPixel, OneWire, DS18B20, and other libraries), which has an immediate effect on the VirtualWire/RadioHead.
I don't think I've ever seen an ESC or servo that will respond to an analogWrite() command. For one thing it's far too fast (490Hz instead of the 50Hz that the ESC/servo expects).
Please give details or a link to the ESC you have that responds correctly to analogWrite() over a range of 0-180 (which are the values normally used with servo.write() NOT analogWrite()).
Keep servo motors and ESC drivers in the servo-world.
Keep leds and DC motors in the PWM-analogWrite-world.
Dutch: If wooden shoes can be made out of cheese, that does not mean that it is a good idea.
Belgian: If filet americain can be used instead of mortar for bricklaying, that does not mean that it is a good idea.