void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Yes, today was my first time using the board, and when i was installing libraries and trying examples, was a moment when 3 LEDs was on, the green 'ON', the orange 'CHRG' and a third blinking. I assume the third is what i looking for
To be honest I've never worked with that board. Do you have any other boards you can try?
From what I've read the LED is on D6 - might be worth trying replacing LED_BUILTIN with "6" - or even hooking up an LED to another port (via a 220 ohm resistor) and see if that works.
That is the output from a successful upload, including the "cpu reset" part. It's only some helpful information provided by the upload tool. So this is normal and expected. If your sketch is not working as expected, it has absolutely nothing to do with this output.
Ah! ok thanks. But in this case why when i use the ScanNetworks exmple of Wifi101 it doesnt show anything but the message of CPU reset? Thats actually the reason for why i come to the blink example.
(I dont nknow if i have to put this in another thread)
ScanNetworks code:
#include <SPI.h>
#include <WiFi101.h>
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while (true);
}
// Print WiFi MAC address:
printMacAddress();
// scan for existing networks:
Serial.println("Scanning available networks...");
listNetworks();
}
void loop() {
delay(10000);
// scan for existing networks:
Serial.println("Scanning available networks...");
listNetworks();
}
void printMacAddress() {
// the MAC address of your WiFi shield
byte mac[6];
// print your MAC address:
WiFi.macAddress(mac);
Serial.print("MAC: ");
printMacAddress(mac);
}
void listNetworks() {
// scan for nearby networks:
Serial.println("** Scan Networks **");
int numSsid = WiFi.scanNetworks();
if (numSsid == -1)
{
Serial.println("Couldn't get a wifi connection");
while (true);
}
// print the list of networks seen:
Serial.print("number of available networks:");
Serial.println(numSsid);
// print the network number and name for each network found:
for (int thisNet = 0; thisNet < numSsid; thisNet++) {
Serial.print(thisNet);
Serial.print(") ");
Serial.print(WiFi.SSID(thisNet));
Serial.print("\tSignal: ");
Serial.print(WiFi.RSSI(thisNet));
Serial.print(" dBm");
Serial.print("\tEncryption: ");
printEncryptionType(WiFi.encryptionType(thisNet));
Serial.flush();
}
}
void printEncryptionType(int thisType) {
// read the encryption type and print out the name:
switch (thisType) {
case ENC_TYPE_WEP:
Serial.println("WEP");
break;
case ENC_TYPE_TKIP:
Serial.println("WPA");
break;
case ENC_TYPE_CCMP:
Serial.println("WPA2");
break;
case ENC_TYPE_NONE:
Serial.println("None");
break;
case ENC_TYPE_AUTO:
Serial.println("Auto");
break;
}
}
void printMacAddress(byte mac[]) {
for (int i = 5; i >= 0; i--) {
if (mac[i] < 16) {
Serial.print("0");
}
Serial.print(mac[i], HEX);
if (i > 0) {
Serial.print(":");
}
}
Serial.println();
}
You need to open Tools > Serial Monitor from the Arduino IDE's menus to see the Serial.println() messages from the sketch. You won't see those in the black console window at the bottom of the Arduino IDE's window where the upload output is shown.
Here's a good sketch for testing out serial output:
It's sort of the serial print version of "Blink".
If you upload that to your Arduino board and then open Serial Monitor, do you see it printing "hello" at 1 Hz?
No, actually was my mistake. The LED was blinking all the time, even before upload the code. So how it doesnt display anything after the reset, even at codes when it have to, and it continue blinking like usual, i assume that it was working wrong