In this article, we will learn about GPIO (General Purpose I/O) or pin connect to an external device of microcontroller with C++ of Arduino using esp8266 as reference chip. This can be applied to Arduino Uno, Arduino Mega or STM32 as well. Under this article, we describe the duty of the pin, output and the input signal.
This article is a compilation of information related to the ESP8266WiFi class, which performs the WiFi functionality of the ESP8266 microcontroller. This class can be accessed via a WiFi object, which is an object created for accessing the chip’s wireless module and must import a header file named ESP8266WiFi.h
After studying the ESP8266WiFi to control the microcontroller connected to a wireless network in an STA and SoftAP form, then learned how to use the WiFiClient to use the esp8266 as a client node. This time, it’s about WiFiServer to make esp8266 act as a service node or Server. The example in this article is to create an internal network system by using 3 esp8266 to act as SoftAP, Server and Client as shown in Figure 1.
After mentioning the ESP8266WiFi class in the previous article. This time, let’s learn how to use the WiFiClient class to write programs on the client side that link to a service or server.
This article discusses the SPI bus functionality of the Arduino framework for use with the STM32F030F4P6, STM32F103C8, STM32F401, esp8266 and esp32. The operation of this bus requires at least 3 intercommunication cables: SCLK, MISO. and MOSI for transmitting the clock signal between the sender and the receiver. It serves to receive information from the sender. and used for sending information to the recipient.
From the use of 3 signal lines, it is found that data can be transmitted and received simultaneously. This is different from I2C bus communication that uses only one SDA cable to communicate. At the same communication speed, the SPI bus will receive and transmit data without waiting for an idle line, while I2C will have to wait for idle. With this in mind, SPI can send/receive data faster.
In addition, SPI uses a method to select the destination to communicate by instructing the endpoint to know by sending a signal to the SS pin of the terminal. Therefore, when connecting to multiple devices, SPI requires a larger number of pins to operate, while I2C uses device identification to communicate with each other by still using only one SDA cable, which saves more pins.