So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By MasterIphone
#95139 Hello.
Interested in the issue of adapting the code from arduino pro micro for esp8266.
As I understand it, esp8266 does not support working with ports, it simply does not have them.
The code for working with DDRB PORTB or DDRD PORTD does not work, incl. gives a compiler error.
Code: Select all   uint8_t pd = PIND & B10100; // pins 2 and 4 direct reading
   ((pd == B10100) || (pd == B00000)) ? encoderPos++ : encoderPos--;

In general, of course, it’s interesting, ESP8266 is a fairly powerful module with 80 MHz CPU and Wi-Fi on board, but it cannot process the same code as in a slower arduino UNO or PRO MICRO - 16 MHz and without Wi-Fi.
Give advice on how to be.
Or the code does not solve the problem, and it is necessary to combine the ESP8266 and UNO together in the hardware?
...
Also a question - maybe someone came across the N5110_SPI library?
https://github.com/cbm80amiga/N5110_SPI
I connect the pins of the RST/CE/DC in digital pins on ESP8266.
And connect the pins of the DIN/CLK in hardware SPI pins.
The display Nokia 5110 does not show an image.
Tell me some advice on how to be, or is there only one solution - to take a board from atmega 328p and ESP8266 on board?
User avatar
By davydnorris
#95188 The ESP has ports but they are addressed completely differently to other MCUs.

Even different Arduino models have different port addressing schemes - I have an Arduino Every and it won't run any of the code from other Arduinos if it has used direct hardware addressing.

There are libraries for Arduino that encapsulate the different board types, such as Wire - if your code uses that library then you'll find it will compile for the ESP, but even then you'll need to figure out if the ports used in your code are going to be appropriate.