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

User avatar
By SupDoc
#76171 I am trying to get Digital Read Serial to work to test it. My previous board did the same thing I ordered a new one, ditto.
I tried a different USB cable & then I tried a different USB port, same problem. Here is the error message & attached is the circuit:

Archiving built core (caching) in: C:\Users\Don XXX\AppData\Local\Temp\arduino_cache_687717\core\core_esp8266_esp8266_nodemcuv2_CpuFrequency_80,FlashSize_4M1M,LwIPVariant_v2mss536,Debug_Disabled,DebugLevel_WIFI,FlashErase_none,UploadSpeed_115200_f86d0967029055693339ddfef193ea10.a
Sketch uses 249376 bytes (23%) of program storage space. Maximum is 1044464 bytes.
Global variables use 32388 bytes (39%) of dynamic memory, leaving 49532 bytes for local variables. Maximum is 81920 bytes.
error: Failed to open COM11
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

Here is the code:
/*
DigitalReadSerial

Reads a digital input on pin 2, prints the result to the Serial Monitor

This example code is in the public domain.


http://www.arduino.cc/en/Tutorial/DigitalReadSerial*/

// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 2;

// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
// make the pushbutton's pin an input:
pinMode(pushButton, INPUT);
}

// the loop routine runs over and over again forever:
void loop() {
// read the input pin:
int buttonState = digitalRead(pushButton);
// print out the state of the button:
Serial.println(buttonState);
delay(1); // delay in between reads for stability
}
You do not have the required permissions to view the files attached to this post.
User avatar
By Bonzo
#76172 Try another cable; I have tried four cables and only one works and that is the one for a mobile phone.

This is the error I get with a bad cable:
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed



I assume you have not managed to upload the program?