302 views|0 replies

5

Posts

0

Resources
The OP
 

【Follow me Season 2 Episode 2】Introductory Tasks - Setting Up the Environment - Blink - Serial Port Printing [Copy link]

 This post was last edited by sinc_sila on 2024-9-16 11:02

I am honored to participate in this Follow me event and experience the highly respected Arduino open source hardware platform firsthand. Arduino has won the favor of electronics enthusiasts and educators around the world for its excellent ease of use and flexibility. I look forward to returning home with a lot of gains from this event.

Purchase original parts display:
1. Arduino UNO R4 WiFi

2. SHT40 temperature and humidity sensor expansion board

Environment setup:

Open the Arduino official website: Software | Arduino download and install the software


Open the Arduino software, connect the development board to the computer, and select the corresponding serial port:
At this point, the preparations before writing code have been completed.
-------------------------------------------------- ----------------

Getting started task: light up the onboard LED and print Hello EEWorld on the serial port!

From the schematic diagram provided by the development board, we can see that the pin of the user LED is: DL4 (yellow).

Open File->Example->Basics->Bink
to create a basic Bink example and add serial port printing on this basis.
Sample code and comments:
The Arduino's built-in LED flashes once every second and sends a "Hello EEWorld!" message over the serial port each time the LED changes state:
void setup() {
  // 初始化内置LED引脚为输出模式。
  pinMode(LED_BUILTIN, OUTPUT);
  
  // 初始化串口通信,波特率为9600
  Serial.begin(9600);
}

// loop函数会无限次地反复运行
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // 打开LED(HIGH表示高电压水平)
  Serial.println("Hello EEWorld!"); // 通过串口打印消息
  delay(1000);                      // 等待一秒钟
  
  digitalWrite(LED_BUILTIN, LOW);   // 关闭LED,通过使电压变为LOW
  Serial.println("Hello EEWorld!"); // 再次通过串口打印消息
  delay(1000);                      // 等待一秒钟
}

Video effect display after code burning:

a2c4f98f897cd418646109bdfb14b687_raw

This post is from DigiKey Technology Zone
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

Featured Posts
[Classic Books] Bluetooth Core Technology (for reference by researchers and developers in the communications industry)

This book was written by two members who participated in the formulation of the Bluetooth standard. It consists of four ...

How should Japan deal with nuclear waste water? Give us some ideas

April 13, Japanese Government Official decision to discharge Fukushima nuclear wastewater into the sea Once nuclear w ...

How to find out what the abbreviation of the following command in AT command is?

As shown in the figure below, what is the abbreviation of CGSN? Where is the information on this subject? I can't rememb ...

Relationship between PN conduction voltage drop and current and temperature

*) , the E junction is affected by temperature, and the change in on-state voltage drop is related to Is and Ic The cond ...

【Topmicro Intelligent Display Module】V. Interact with the screen via the network

This post was last edited by Digital Leaf on 2021-11-21 13:31 Topmicro intelligent display module supports network func ...

Portable LED Light Retrofit

592276 This is actually the lamp head of a foldable LED desk lamp. One day, I accidentally dropped the desk lamp on the ...

[RVB2601 Creative Application Development] LVGL Horizontal Scrolling Display

This post was last edited by lugl4313820 on 2022-3-14 13:12 MP3 Player - Pingtou Ge RISC-V RVB2601 Activity Zone - Ele ...

40 "Millions" of Raspberry Pi Cars - ROS Learning (C Language Programming to Control the Turtle)

This post was last edited by lb8820265 on 2022-11-1 14:52 In the previous section, we introduced how to run the "tu ...

Multisim Fourier analysis results

I would like to ask, what do the two terms on the right side of the results of multisim Fourier analysis mean? Is there ...

Unboxing of "Lane Change Racing: China's Road to New Energy Vehicles"

This post was last edited by nemon on 2024-3-1 15:48 Before the Chinese New Year, I participated in an event called "A ...

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list