Wemos D1 not able to run code - arduino

I bought this board
As far as I can tell I installed the drivers and libraries properly(I can see the board in the usb devices and upload the code), but every time I try to run a program, I get this result in the serial monitor and the board doesnt light up any led. I also tried to just print an hello world, but i get the same result.
My configs are :
And a example is:
I hope you can help me out, thank you!

I think the issue with the LED not blinking is because many of the ESP12 boards use GPIO 2 rather than GPIO 1 for the built in LED.
See this issue for more details.
Try adding this to the beginning of the sketch:
#define LED_BUILTIN 2
or just use 2 in place of LED_BUILTIN
which will re-define LED_BUILTIN to use gpio 2 rather than gpio 1
As for the serial monitor, I have not directly used the Arduino IDE in a while, but you are not printing anything to the serial port anyway.
Here is an updated version of the sketch that should blink the led and print some messages to the monitor. (set the baud rate of the serial port to 115200 in the IDE)
#define LED_BUILTIN 2
void setup() {
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
Serial.println("turning ON LED");
digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is acive low on the ESP-01)
delay(1000); // Wait for a second
Serial.println("turning OFF LED");
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}

The problem in my case was a faulty board. I requested a new one from the seller, and the one worked just fine with the code that I provided in the question.

Related

ESP32 output pins not working with Arduino IDE

So this is my first time working with ESP32 or any MCU at all and I'm trying to blink an external LED connected to my GPIO16 pin but it doesn´t seem to be working. My board is a 38pin ESP32 with only one internal LED connected to pin 1 (not to pin 2 as many other esp32 dev boards) which I was actually able to blink with the blink example program.
I've tried connecting my external LED positive terminal to GPIO17 and GPIO18 as well but still doesn't work. I'm grounding my LED negative terminal with one of the GND pins of the dev board and I've also tried using the other 2 GND pins available but the result is the same.
In the Arduino IDE I'm using ESP32 Dev Module as my board in the boards manager and the serial communication seems to be working just fine, I'm just not being able to output the HIGH and LOW signals to light up my LED.
The limiting resistor I'm using is a 220 Ohm.
Here's the code I've been trying to achieve this:
int ledPin = 16;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop () {
digitalWrite(ledPin,HIGH);
delay(1000);
digitalWrite(ledPin,LOW);
delay(1000);
}
Is it possible that my pins are outputting a very low voltage or that they might not work?
I leave a picture of my pinout. Thank you very much in advance!!
ESP32 Dev Module 38 Pin Layout

LED of pin 13 in Arduino Uno always on even if there is no program uploaded to it

I have purchased a brand new Arduino Uno today. While it was connected to the PC, the LED (pin 13) was always remaining on. I have uploaded a blank program, but the LED doesn't go off.
Help me with this issue, please. I am in a fix about it.
The Arduino does not remember any states which have been set before a new program start. Without setting the digital port 13 the LED is turned on. You can set the port 13 by program (using it as output port) or you pull down the port by connecting it to ground (using it as input port).
Also see tutorial about digital pins on the Arduino website.
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, LOW);
}

BLE Nano using Arduino Ide issue

Hi I'm trying to load sample blink application on BLE Nano device using Arduino Ide. It starts compiling but than it crashes with
processing.app.debug.RunnerException
at processing.app.debug.Compiler.compileHex(Compiler.java:793)
at processing.app.debug.Compiler.compile(Compiler.java:148)
at processing.app.Sketch.build(Sketch.java:1589)
at processing.app.Sketch.exportApplet(Sketch.java:1611)
at processing.app.Sketch.exportApplet(Sketch.java:1597)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2397)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at processing.app.helpers.StringReplacer.replaceFromMapping(StringReplacer.java:97)
at processing.app.helpers.StringReplacer.replaceFromMapping(StringReplacer.java:89)
at processing.app.helpers.StringReplacer.formatAndSplit(StringReplacer.java:37)
at processing.app.debug.Compiler.compileHex(Compiler.java:791)
... 6 more`enter code here`
So the question is. What is the reason of this crash. And how to fix it?
UPDATE:
I've used http://redbearlab.com/getting-started-nrf51822/ to configure connection.
Here is sample code:
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Can you please post the sample code it's importing? Also, can you see the board in the ports as a COMM#? I have an inkling that the installation process of the IDE might not have occurred correctly, cause some components/libraries to be missing. This can potentially cause the problems you're describing, IF you're sure that your board is connected correctly and all you're doing is importing a sample code.

xBee communication Arduino to Arduino

I have a realy weird problem with my xBee S1 Pro moduls. I used the XCTU software to configure them. I set one Arduino to recive data and the other one to transmit. When i use the XCTU Software to send some testframes, it works, the reciver gets the data. But if i want my arduinos to communicate it dosent work. I assume that the moduls are configured the right way because PC -> Arduino works. So i'll provide the Sketches so you can tell me whats going wrong
reciver
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop()
{
if(Serial.available() > 0){
digitalWrite(13, HIGH);
delay(500);
digitalWrite(13, LOW);
Serial.print("recived some data: ");
Serial.println(Serial.read());
Serial.flush();
}
}
and now the sender
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop()
{
Serial.println("data");
Serial.flush();
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(4000);
}
whats wrong? any ideas?
I would check the connections to the Xbee, i.e. make sure that RX is actually connected to DOUT and TX is connected to DIN. Also if you are sending actual "Frames" then it sounds like you are running your xbees in api mode so you will need to do more then just send out "data" what you want is for it to be running in serial pass through mode.
One last thing to check is if you are using arduino Leonardo or Micro the hardware Serial port is Serial1 not Serial.
You're using the same Serial port for communicating with XBee and USB. That's the problem. You need to set another Serial port instead of the used for USB to communicate with XBee.
It will be good if you share what arduino boards and shields you are using.
So first thing is first... If these xBees have separate passcodes at a different baud rate, shit is going to happen. Also what command mode are these in (AT or API)? Factory default settings ? Accepting AT commands to change these ? (By default you are in AT mode)
Open a serial program (I use coolTerm for OS X ). Ensure to setup correctly of these steps.
Once you know these transmitters are talking at the same baud, passcode, etc... Ensure you have the code uploaded to your Arduinos BEFORE connecting these transmitters to the RX/TX pins with a simple serial read and write.
The code seems right, but make sure what you are trying to send. Xbees can transmit and receive 8bit data only.
First send a known byte of data such as a=100; and see whether this data receives there perfectly or not.

Arduino YUN: Serial Communication not working

I have been unable to use the serial monitor with the Arduino YUN, I can download the compiled sketch with IDE 1.5.5 (on Windows XP via the USB connector that appears as COM6), the serial monitor opens but displays nothing. In order to investigate I modified the Blink example sketch as follows:
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
Serial.begin(9600);
while (!Serial) {;}
Serial.println("Blink Program");
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
Serial.println("Blink Program -H");
delay(5000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
Serial.println("Blink Program -L");
delay(5000); // wait for a second
}
The sketch upoloads and runs, I see the LED blinking, it does not wait for SerialMonitor to open. The SerialMonitor displays nothing. I have noticed that during the upload COM6 disappers from the Windows device manager, a new port COM7 appears, the upload completes successfully, COM7 disappears and COM6 reappears.
I have also found that the YunSerialTerminal example is not working.
Do other people have successfully used the IDE 1.5.5 SerialMonitor on Windows XP?
Should I conclude that my Arduino Yun board is malfunctioning?
Any help would be greatly appreciated.
I had the same problem. A reset on 32U4 solved the problem (the button on the left top corner, next to the Ethernet connector). The serial port appeared on the arduino 1.5.x IDE and the connection was established and the data received.
Bridge and Console should be used when the selected port is the wifi one, not the real serial port.
I hope that helps.
Best,
I am running 1.5.5 and had a similar problem. Console.begin() and Bridge.begin() work just fine. Serial gives me nothing. I started with the following.
void setup() {
// for debugging, wait until a serial console is connected
Serial.begin(9600);
delay(4000);
while(!Serial);
Serial.print("Initializing the bridge...");
Bridge.begin();
Serial.println("Done");
}
void loop()
{
Serial.println("running...");
}
Try to change your USB cable(needs to be USB data cable) and Port settings in Arduino IDE. Tools-->Port-->COM6(Arduino Yun).
This solved my problem in Windows.

Resources