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

User avatar
By kidbreaker22
#73360 Basically what the title says!

I coded a light sensor test where it works on my Genuino Uno board and then tried on my ESP8266 V3 NodeMCU (http://www.smartarduino.com/nodemcu-bas ... 94571.html) and it gives me random stuff in the Serial Monitor. Am I doing something wrong or am I missing an information that I don't know about in ESP8266 that I can't do while it's allowed in Genuino Uno? Can someone please help me figure out with this stuff?

Thank you.

Code: Select allint sensorValue = 0;
int value = 0;

const int sensorPin = A0;
const int LEDPin = 8;

void setup() {
  // put your setup code here, to run once:

  Serial.begin(9600);

  pinMode(LEDPin, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:

  sensorValue = analogRead(sensorPin);
  delay(500);

  Serial.print("Sensor Value: ");
  Serial.println(sensorValue);

  value = 255 - sensorValue/4;

  Serial.print("Analog Value of Pin D8: ");
  Serial.println(value);

  analogWrite(LEDPin, value);

}
You do not have the required permissions to view the files attached to this post.
User avatar
By jankop
#73422 Pin 8 is dedicated for flash memory! Your system colapsed. Change the pin to other free. I tried the program, it works.

here is your error message at 115200 baud:
Code: Select allwdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v4ceabea9
~ld