arduino nano digital pin to esp8266 analog pin?

Hello, Is it possible to connect a digital pin from a nano to a analog pin on a esp8266. The nano is 5v and esp is 3.3v and I'd rather not have to use resistors. I was planning on using a map function within the nano to limit max voltage to the esp at 3.3volts. If I limit max voltage in the code to 3.3 volts for the digital pin, will I have to worry about damaging the esp8266.
I'm doing this so I can send sensor data from the nano to a esp8266, I'm sure there is a simpler way but this is a way i'm familiar with.

I can't visualise how you would use map for that, but even if it worked in a sort of pwm-like way, the voltage on a nano digital pin is still either 5V or 0V and never actually anything else. PWM is a 0-5-0-5 cycle. So at some instant it's actually 5V, even though the average may be 2 or 3 or 4 or whatever.

On the ESP: enable pullup on input.
On the NANO: init:set pin LOW. When output should be HIGH, change pinmode to INPUT without pullups. When output should be LOW, set pinmode to output (pin goes LOW, as inititialized in setup).

Anyway, this is not worth the trouble, if you have 2 resistors build a voltage devider. And NANO does not have an analog output, just PWM (as said in the last posting)

analog pin of esp8266 is 0-1V

05silgto:
Hello, Is it possible to connect a digital pin from a nano to a analog pin on a esp8266. The nano is 5v and esp is 3.3v and I'd rather not have to use resistors. I was planning on using a map function within the nano to limit max voltage to the esp at 3.3volts. If I limit max voltage in the code to 3.3 volts for the digital pin, will I have to worry about damaging the esp8266.

Sorry, but everything you have said there is complete nonsense! :roll_eyes:

Just forget such a ridiculous suggestion. :astonished:

05silgto:
I'm doing this so I can send sensor data from the nano to a esp8266, I'm sure there is a simpler way but this is a way I'm familiar with.

So, this is the "XY problem" then.

To send data from ESP to Nano, you use the serial output on the ESP and the serial input on the Nano.

The bigger question here however is why if you have an ESP8266, you would want to add a less capable Nano? Just read the sensors with the ESP. :grinning: