เรียกใช้ตัวอย่าง Blink ในตัว
เปิด คอมไพล์ และอัปโหลดสเก็ตช์ที่ใช้งานได้ชิ้นแรก
เรียกใช้ตัวอย่าง Blink ในตัว เป็นบทเรียน Arduino & IoT Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Arduino & IoT Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Arduino & IoT Academy มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
The Hello World of Hardware
Every maker starts with Blink, the classic first sketch. It makes the onboard LED flash, proving your whole setup works. 💡
Open the Examples
The IDE ships with ready-made sketches under File then Examples. You do not even have to type anything yet.
Find Blink
Go to Examples, then Basics, then Blink. The IDE opens the complete code in a fresh window for you.
Look at setup
The setup block runs once at startup. Here it tells the built-in LED pin to act as an output.
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}Look at loop
The loop block repeats forever. It turns the LED on, waits, turns it off, waits, then starts over.
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}What HIGH Means
Writing HIGH sends voltage to the pin, lighting the LED. Writing LOW removes it, turning the LED off.
What delay Does
The delay call pauses the program for the given milliseconds. Here 1000 means a full one-second wait.
Compile It
Click Verify to compile Blink. A clean run with no red errors means the code is ready to upload.
Upload It
Press Upload to flash Blink onto the board. Watch the tiny lights flicker as the code transfers over USB.
Watch It Blink
The orange onboard LED now flashes on and off once per second. You just made hardware do your bidding. 🎉
Make It Yours
Change both delay numbers to 200 and upload again. The LED blinks faster, proving the code is truly under your control.
Quick Check
Let's check how to speed the blink up.
Recap
You opened Blink, read setup and loop, uploaded it, and tuned the delay. Your first smart device is alive. 🎉
คำถามที่พบบ่อย
บทเรียน “เรียกใช้ตัวอย่าง Blink ในตัว” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “เรียกใช้ตัวอย่าง Blink ในตัว” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Arduino & IoT Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Arduino & IoT Academy มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “เรียกใช้ตัวอย่าง Blink ในตัว”
เปิด คอมไพล์ และอัปโหลดสเก็ตช์ที่ใช้งานได้ชิ้นแรก คุณปฏิบัติ Arduino & IoT Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Arduino & IoT Academy หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Arduino & IoT Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน
บทเรียน “เรียกใช้ตัวอย่าง Blink ในตัว” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Arduino & IoT Academy นี้ได้ไหม
ได้ บทเรียน Arduino & IoT Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- ทำความรู้จัก Arduino Uno
- ติดตั้ง Arduino IDE
- เลือกบอร์ดและพอร์ต แล้วอัปโหลด
- เรียกใช้ตัวอย่าง Blink ในตัว