กลับไปหน้ารวมไฟล์
getting-started-with-johnny-five-for-iot-part-1-398acd.md

สนใจโลกของการแฮกฮาร์ดแวร์ แต่รู้สึกว่าถูกทิ้งห่างเพราะไม่มีเวลาเรียนภาษาอื่นใช่ไหม หรืออาจไม่คุ้นเคยกับการใช้ Sketch ในการโปรแกรมใช่ไหม ไม่ต้องกลัว คุณสามารถใช้ JavaScript เพื่อโปรแกรมบอร์ดอย่าง Arduino และ Genuino ได้อย่างง่ายดาย ใช่ เพียงแค่ JavaScript เท่านั้น!

ในชุดวิดีโอสอนนี้ Tomomi Imura จาก PubNub จะแสดงวิธีเริ่มต้นแฮกบอร์ด Arduino ด้วย Node.js โดยใช้ Johnny-Five ซึ่งเป็น JavaScript Robotics Framework

ส่วนที่หนึ่งครอบคลุม:

  • การตั้งค่าบอร์ด
  • การสร้าง "Hello World" ของฮาร์ดแวร์ นั่นคือการกะพริบ LED
  • การเขียนโค้ด Johnny-Five เพื่อให้ LED กะพริบตามโปรแกรม

ขอให้สนุกกับการเรียนรู้!

รายละเอียดทางเทคนิคเพิ่มเติม

การควบคุมฮาร์ดแวร์ด้วย JavaScript

Johnny-Five เป็นหนึ่งใน JavaScript Robotics & IoT framework ที่ได้รับความนิยมมากที่สุด ช่วยให้นักพัฒนาสามารถควบคุม Arduino โดยใช้ Node.js แทน C++

  • Firmata Protocol: Arduino รันเฟิร์มแวร์มาตรฐานที่เรียกว่า StandardFirmata ซึ่งจะเปลี่ยน Arduino ให้กลายเป็น I/O expander สำหรับโฮสต์ PC หรือ Raspberry Pi
  • Serial over USB: Node.js สื่อสารกับบอร์ดผ่าน Serial port โดยส่งคำสั่งระดับสูง เช่น led.blink() หรือ servo.to(90)

การผสานรวม IoT

  • PubNub Connectivity: โปรเจกต์นี้จะแสดง "ส่วนที่ 1" โดยการเชื่อมต่อฮาร์ดแวร์เข้ากับ PubNub API ซึ่งช่วยให้สามารถสตรีมข้อมูลแบบเรียลไทม์และควบคุม Arduino จากระยะไกลได้จากเว็บเบราว์เซอร์ใดก็ได้ในโลก ผ่านเลเยอร์การส่งข้อความแบบ publish/subscribe ที่ปลอดภัย

ข้อมูล Frontmatter ดั้งเดิม

title: "Getting Started with Johnny Five for IoT (Part 1)"
description: "Tomomi Imura, developer evangelist at PubNub, walks through setting up a Arduino simple circuit to blink a LED on-command using Johhny-Five."
author: "user434464008"
category: "Internet of Things, BT & Wireless"
tags:
  - "iot"
  - "internet of things"
views: 15751
likes: 7
price: 99
difficulty: "Easy"
components:
  - "1x Jumper wires (generic)"
  - "1x Breadboard (generic)"
  - "1x Arduino UNO"
  - "1x LED (generic)"
  - "1x Resistor 220 ohm"
tools: []
apps:
  - "1x Arduino IDE"
  - "1x PubNub Publish/Subscribe API"
  - "1x Johnny-Five"
downloadableFiles: []
documentationLinks: []
passwordHash: "acfb290ad18074f02d77bc4e0fd1cf4d7b66b7ef57120ce0348cae6f5aa8c3a1"
encryptedPayload: "U2FsdGVkX18U/mDm3lRyX9e5ELLdrGak8ILDjW6fg40OF98GeaH4DkiVt3T0bQpH875+hJjD6rGbfdKmY5D/aeNNM796Gy2rR8P9/SqIgI+SyVoCN7REFjg8ATnYTOV8RFarF+FGIBdbFzbWmuet9sWjTz1lMz4LU0toWzZYZDA="
seoDescription: "Learn how to get started with Johnny Five for IoT by setting up an Arduino circuit to control an LED with Tomomi Imura."
videoLinks:
  - "https://player.vimeo.com/video/170236455"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/getting-started-with-johnny-five-for-iot-part-1-398acd_cover.jpg"
lang: "th"