XC3802 Manualmain

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

ESP8266 WiFi Mini

Hardware
The main focus of the ESP8266 is the WiFi compatibility in a small form factor. It also
has an 80Mhz microcontroller and 4 MB of on-board flash.

Computer Drivers (Windows)


Linux and Mac computers will have the drivers installed already.
To use the XC3802 on windows, you must first download the driver package on our
website, and fully extract the zip file into a folder on your desktop.
In that folder, you will find SETUP.EXE which you can run and click ‘OK’ to install the
drivers.
Once the drivers have been installed, you can now delete the folder on your desktop.

Arduino Setup
To set it up in the Arduino IDE software, you must first add the index, then install the
board type:

 Open File > Preferences


o In the “Additional Boards Manager URLs, place the following:

http://arduino.esp8266.com/stable/package_esp8266com_index.json

 Click OK to save.
 Click Tools > Board > Board Manager
o In the new window that shows up, type in “esp8266” in the search bar.
o Install esp8266 by ESP8266 Community.
 Once the boards have been installed, you can now select ESP8266 boards in the
boards menu.
The board to select for XC3802 is “LOLIN(WEMOS) D1 R2 & mini”
Once you have selected the board and selected the correct port, you can go File >
Examples and upload the blink sketch to test. There are more examples to try as well.

Using on-board Flash


The ESP8266 has 4MB flash on board; this can be useful if you want to upload static
website data or images to the ESP. The Data is sharing the same memory as code.
The easiest way is to download the zip file from this github repository:
XC3802

https://github.com/esp8266/arduino-esp8266fs-plugin/releases/latest
Then extract the zip into your Documents/Arduino/tools directory, creating it if it does
not already exist.
The final path of the tool should be:
Documents\Arduino\tools\ESP8266FS\tool\esp8266fs.jar

Australia New Zealand


www.jaycar.com.au www.jaycar.co.nz
[email protected] [email protected]
1800 022 888 0800 452 922 Page 1 of 2
ESP8266 WiFi Mini
Restart your Arduino IDE and you should find “ESP8266 Sketch Data Upload” in your
Tools menu.
Create a folder in your sketch directory called “data” and put what data you want to
upload into this folder.
In the latest version of the ESP8266 WEMOS board, the default value in the arduino IDE
reserves 2MB of flash for the data folder. You can use the Sketch Data Upload
command to push the data folder onto the memory.

Source Code to use on-board flash


#include <FS.h>

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
SPIFFS.begin(); // must always begin() SPIFFS

File f = SPIFFS.open("/hello.txt", "r");


if(!f){
Serial.println("failed to open hello.txt, did you upload data?");
} else {
String firstLine = f.readStringUntil('\n');
Serial.println("first line of hello.text :");
Serial.println(firstLine);
}
}

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

}
XC3802

Australia New Zealand


www.jaycar.com.au www.jaycar.co.nz
[email protected] [email protected]
1800 022 888 0800 452 922 Page 2 of 2

You might also like