Skip to content

Commit

Permalink
Merge pull request #1407 from Love4yzp/docusaurus-version
Browse files Browse the repository at this point in the history
change the code header that could not render
  • Loading branch information
Love4yzp authored Jul 16, 2024
2 parents d6a0589 + f13e843 commit 898d51d
Show file tree
Hide file tree
Showing 258 changed files with 677 additions and 642 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ To see how can you build your own UI application for reTerminal with LVGL 8.0, y

All the necessary components are imported and initialized in main.c, after that the main UI function is called. The UI description, callbacks and helper functions are located inside of **lv_demo_reterminal_UI/lv_demo_reterminal_UI.c**.

```C
```cpp
tv = lv_tabview_create(lv_scr_act(), LV_DIR_TOP, tab_h);

lv_obj_set_style_text_font(lv_scr_act(), font_normal, 0);
Expand All @@ -166,7 +166,7 @@ We create a Tabview widget on the active screen and populate it with three tabs:
The content of each tab is initialized separately in a corresponding function:
```C
```cpp
assistant_create(t1);
debug_create(t2);
stats_create(t3);
Expand All @@ -178,7 +178,7 @@ The content of each tab is initialized separately in a corresponding function:

Additionally color changer elements are created on the Tabview widget and built-in accelerometer is initialized. After that we create three timer callbacks with dummy input data:

```C
```cpp
static uint32_t user_data = 10;
lv_timer_t * time_timer = lv_timer_create(time_timer_cb, 1, &user_data);
lv_timer_t * system_timer = lv_timer_create(system_timer_cb, 500, &user_data);
Expand All @@ -187,7 +187,7 @@ Additionally color changer elements are created on the Tabview widget and built-

These are responsible for getting system time, system status (CPU, Mem, Disk Space, Ethernet current speed, etc) and accelerometer readings respectively. You can find these three callback functions at the bottom of the lv_demo_reterminal_UI.c.

```C
```cpp
void time_timer_cb(lv_timer_t * timer)
{

Expand Down Expand Up @@ -245,7 +245,7 @@ If you decide to follow our demo application closely when creating your first UI
**assistant_create**
We create a panel object for the tab and set its height.
```C
```cpp
lv_obj_t * panel1 = lv_obj_create(parent);
lv_obj_set_height(panel1, lv_pct(100));
```
Expand All @@ -256,7 +256,7 @@ Then we create an image button object from C array located in assets folder, obt

<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/ReTerminal/lvgl-3.png" alt="pir" height="400" height="auto"/></p>

```C
```cpp
LV_IMG_DECLARE(speech_btn_img);

/*Create a transition animation on width transformation and recolor.*/
Expand Down Expand Up @@ -289,7 +289,7 @@ In the next code block we create text labels for time, date, user greeting. Thes
<p style={{textAlign: 'center'}}><img src="https://files.seeedstudio.com/wiki/ReTerminal/lvgl-4.png" alt="pir" width="600" height="auto"/></p>
```C
```cpp
lv_obj_t * name = lv_label_create(panel1);
lv_label_set_text(name, "Hi there, Username");
lv_obj_add_style(name, &style_large, 0);
Expand Down Expand Up @@ -318,7 +318,7 @@ Note that the grid layout feature of LVGL needs to be globally enabled with ```L

You can read about Layouts in LVGL in more detail by following [this link](https://docs.lvgl.io/master/layouts/grid.html).

```C
```cpp
static lv_coord_t grid_main_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_main_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ To collect the weather data, we are going to be using an ESP32 with a DHT11 sens

- **Step 2.** Copy the following codes in the skecth.

```c++
```cpp
#include <Wire.h> //Import the required libraries
#include "DHT.h"
#include "Seeed_BMP280.h"
Expand Down
2 changes: 1 addition & 1 deletion docs/FAQ/XIAO/check_battery_voltage.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ In addition, during communication in particular, spike-like errors occurred, whi

The following is the procedure to test the battery voltage.

```c++
```cpp
void setup() {
Serial.begin(115200);
pinMode(A0, INPUT); // ADC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ After we generated the library from Edge Impulse. We need to modify the code for

Flash the test code below.

```c++
```cpp
#include <AIot_Example_inferencing.h>
#include"LIS3DHTR.h"
#include"TFT_eSPI.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ The above code has no restrictions on the Grove - Wio-E5 connection, it will aut
:::
Please select the LoRaWAN® band you wish to use. This band must be consistent with the gateway band you are using. The available frequency bands are in the comments of the code below. In the tutorials we use, the default is the **EU868** band.
```c++
```cpp
#define Frequency DSKLORAE5_ZONE_EU868
/*
Select your frequency band here.
Expand Down Expand Up @@ -532,7 +532,7 @@ If you want to apply the content of this tutorial to your own project developmen

At the beginning of the program, we need to prepare the necessary triad information to connect to Helium and to set the frequency of the Wio-E5.

```c++
```cpp
#define Frequency DSKLORAE5_ZONE_EU868
/*
Select your frequency band here.
Expand All @@ -556,7 +556,7 @@ Next, a `data_decord()` function is defined. This function converts the sensor v

In general, to prevent data overflow, we need to consider the maximum and minimum values that the sensor may read. And split into hexadecimal numbers that will not overflow.

```c++
```cpp
void data_decord(int val_1, int val_2, uint8_t data[4])
{
int val[] = {val_1, val_2};
Expand All @@ -580,20 +580,20 @@ void data_decord(int val_1, int val_2, uint8_t data[4])
For the SHT40 sensor, he will have two data, one is temperature data and one is humidity data, and there are positive and negative values, so the negative numbers need to be processed, and also the decimal places need to be processed.
```c++
```cpp
int_temp = temperature*100;
int_humi = humidity*100;
```

The next step is the initialization of the SHT40 and the initial setup of the Wio-E5. These will all be executed in the `setup()` function.

```c++
```cpp
lorae5.begin(DSKLORAE5_SWSERIAL_WIO_P2)
```

In the initialization code, `DSKLORAE5_SWSERIAL_WIO_P2` represents the Grove interface on the **right** side of the Wio Terminal, while `DSKLORAE5_SWSERIAL_WIO_P1` represents the Grove interface on the **left** side. For other projects without external sensors, you can also use `DSKLORAE5_SEARCH_WIO` , which will automatically search for the Grove interface your Wio-E5 is connected to.

```c++
```cpp
lorae5.send_sync( //Sending the sensor values out
8, // LoRaWan Port
data, // data array
Expand All @@ -606,7 +606,7 @@ lorae5.send_sync( //Sending the sensor values out

The important role of the `send_sync()` function is to send the sensor values over the LoRaWAN®. The first parameter indicates the channel number to send the data, the second parameter indicates the content of the data sent, and the third parameter indicates the length of the data sent. In general, we only need to focus on the content of the first three parameters.

```c++
```cpp
delay(15000);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Now, the 3-Axis Digital Accelerometer library can be installed to the Arduino ID

This repo demonstrates how to use the built-in IMU sensor as a component in Wio Terminal. Using the library's **getAccelerationX()**, **getAccelerationY()**, and **getAccelerationZ()** functions, you can directly obtain the X-axis, Y-axis, and Z-axis offsets of the IMU sensor. These three values may be positive or negative float numbers.

```c++
```cpp
#include"LIS3DHTR.h"
LIS3DHTR<TwoWire> lis;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ The reason why the wiring method of the soil moisture sensor is different from o

This repo demonstrates how to use the soil moisture sensor. The soil moisture sensor uses an analog interface where you can simply read the moisture value of the soil by reading its pins.

```c++
```cpp
int sensorPin = A0;
int sensorValue = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Now, the Grove Temp&Humi Sensor library can be installed to the Arduino IDE. Ope

This repo shows us the temperature and humidity data obtained. In the code, we use the `measureHighPrecision()` function to get the temperature and humidity information, which is positive and float.

```c++
```cpp
#include <Arduino.h>
#include <SensirionI2CSht4x.h>
#include <Wire.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Now, the Grove VOC and eCO2 Gas Sensor library can be installed to the Arduino I

This repo shows us the VOC and eCO2 data obtained. In the code, we use the `sgp_measure_signals_blocking_read()` function to get the VOC and eCO2 information, which is positive and integer.

```c++
```cpp
#include <Arduino.h>
#include "sensirion_common.h"
#include "sgp30.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Now, the Vision AI Module library can be installed to the Arduino IDE. Open the

This repo is able to obtain the number of models identified by the camera feed and the confidence level. They are unsigned integer data with no more than 8 bits.

```c++
```cpp
#include "Seeed_Arduino_GroveAI.h"
#include <Wire.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Please download the necessary environment for Arduino and Wio Terminal in [pre-a

Click [here](https://github.com/limengdu/Seeed-Studio-LoRaWAN-Dev-Kit/blob/main/example/Get-Grove-LoRa-E5-AppEUI-DevEUI/Get-Grove-LoRa-E5-AppEUI-DevEUI.ino) to download the code for the DevEUI, AppEUI that comes with Grove - Wio-E5 and upload it to Wio Terminal.

```c++
```cpp
#include <Arduino.h>
#include "disk91_LoRaE5.h"

Expand Down Expand Up @@ -164,7 +164,7 @@ lorae5.sendATCommand("AT+KEY=APPKEY,\"2B7E151628XXXXXXXXXX158809CF4F3C\"","","+K

Here is the complete code.

```c++
```cpp
#include <Arduino.h>
#include "disk91_LoRaE5.h"

Expand Down Expand Up @@ -472,7 +472,7 @@ If you want to apply the content of this tutorial to your own project developmen

At the beginning of the program, we need to prepare the necessary triad information to connect to TTN and to set the frequency of the Wio-E5.

```c++
```cpp
#define Frequency DSKLORAE5_ZONE_EU868
/*
Select your frequency band here.
Expand All @@ -496,7 +496,7 @@ Next, a `data_decord()` function is defined. This function converts the sensor v

In general, to prevent data overflow, we need to consider the maximum and minimum values that the sensor may read. And split into hexadecimal numbers that will not overflow.

```c++
```cpp
void data_decord(int val_1, int val_2, uint8_t data[4])
{
int val[] = {val_1, val_2};
Expand All @@ -520,20 +520,20 @@ void data_decord(int val_1, int val_2, uint8_t data[4])
For the SHT40 sensor, he will have two data, one is temperature data and one is humidity data, and there are positive and negative values, so the negative numbers need to be processed, and also the decimal places need to be processed.
```c++
```cpp
int_temp = temperature*100;
int_humi = humidity*100;
```

The next step is the initialization of the SHT40 and the initial setup of the Wio-E5. These will all be executed in the `setup()` function.

```c++
```cpp
lorae5.begin(DSKLORAE5_SWSERIAL_WIO_P2)
```

In the initialization code, `DSKLORAE5_SWSERIAL_WIO_P2` represents the Grove interface on the **right** side of the Wio Terminal, while `DSKLORAE5_SWSERIAL_WIO_P1` represents the Grove interface on the **left** side. For other projects without external sensors, you can also use `DSKLORAE5_SEARCH_WIO` , which will automatically search for the Grove interface your Wio-E5 is connected to.

```c++
```cpp
lorae5.send_sync( //Sending the sensor values out
8, // LoRaWan Port
data, // data array
Expand All @@ -546,7 +546,7 @@ lorae5.send_sync( //Sending the sensor values out

The important role of the `send_sync()` function is to send the sensor values over the LoRaWAN®. The first parameter indicates the channel number to send the data, the second parameter indicates the content of the data sent, and the third parameter indicates the length of the data sent. In general, we only need to focus on the content of the first three parameters.

```c++
```cpp
delay(15000);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ Now we need to set the Wi-Fi credentials and Google Cloud IoT Core information i

- **STEP 3:** Change the **Wifi network details**

```c++
```cpp
const char *ssid = "Enter_SSID";
const char *password = "Enter_Password";
```

- **STEP 4:** Change the **Google Cloud IoT details**

```c++
```cpp
const char *project_id = "Enter_Project_ID";
const char *location = "Enter_location";
const char *registry_id = "Enter_Registry_ID";
Expand All @@ -264,7 +264,7 @@ const char *device_id = "Enter_Device_ID";

- **STEP 5:** Copy the private key bytes that we obtained from **ec_private.pem** and saved into notepad before

```c++
```cpp
const char *private_key_str =
"6e:b8:17:35:c7:fc:6b:d7:a9:cb:cb:49:7f:a0:67:"
"63:38:b0:90:57:57:e0:c0:9a:e8:6f:06:0c:d9:ee:"
Expand All @@ -277,7 +277,7 @@ const char *private_key_str =

Open **esp32-mqtt.h** and replace the entire file with the following codes. Here we have replaced configTime function with the implementation of obtaining NTP time via UDP.

```c++
```cpp
#include <Client.h>
#include <rpcWiFi.h>
#include <WiFiClientSecure.h>
Expand Down Expand Up @@ -484,7 +484,7 @@ void setupCloudIoT(){
Add Wio Terminal board to macro definitions inside **Esp32-lwmqtt.ino**
```c++
```cpp
#if defined(ESP32) || defined(WIO_TERMINAL)
#define __ESP32_MQTT_H__
#endif
Expand Down Expand Up @@ -546,15 +546,15 @@ Navigate to **Esp32-lwmqtt.ino** and add the following

- **STEP 1:** After the loop, add the following for the built-in light sensor

```c++
```cpp
void loop() {
int light = analogRead(WIO_LIGHT); //assign variable to store light sensor values
light = map(light,0,1023,0,100); //Map sensor values
```
- **STEP 2:** Add the topic with the Subfolder name
```c++
```cpp
publishTelemetry(getDefaultSensor());
publishTelemetry("/light",String(light));
```
Expand Down Expand Up @@ -590,7 +590,7 @@ Navigate to the previously used **Esp32-lwmqtt.ino** and add the following:

- **STEP 1:** Add the following after **#include "esp32-mqtt.h"**

```c++
```cpp
#include "DHT.h" //DHT library

#define DHTPIN 0 //Define Signal Pin of DHT
Expand All @@ -600,13 +600,13 @@ DHT dht(DHTPIN, DHTTYPE); //Initializing DHT sensor
- **STEP 2:** Add the following inside the **setup** to start the DHT sensor
```c++
```cpp
dht.begin();
```

- **STEP 3:** Add the following inside the **if loop** within **void loop()**

```c++
```cpp
int temperature = dht.readTemperature(); //Assign variable to store temperature
int humidity = dht.readHumidity(); //Assign variable to store humidity

Expand Down
Loading

0 comments on commit 898d51d

Please sign in to comment.