0

I'll ask for your help. The code below is a part of the source code that operates on the NodeMCU.

#define DHTPIN 12 //temp&humi sensor pin setting, GPIO12, D6
#define M1 5 //motor pin setting, GPIO5, D1
#define M2 4 //motor pin setting, GPIO4, D2 

I know that NodeMCU's pin D6 is like GPIO12. And D1,D2 are compared with GPIO5 and GPIO4. But this is the case at NodeMCU. So does it need to change the number in the #define line when this diagram is configured as ArduinoUNO? If so, how do we change it? I need answers.

Thank you. I'm learning a lot.

ellemedit
  • 11
  • 2

1 Answers1

0

The arduino uno has GPIO pins from 0-13, with some marked as PWM, e.g. 5,6. If you want speed control on the motor, you will have to use those pins. To change the pins, just change the number, e.g.

#define M1 5
#define M2 6

For DHT, any pin is fine.

So, in short, you can use these lines without any problems.