一区二区三区三上|欧美在线视频五区|国产午夜无码在线观看视频|亚洲国产裸体网站|无码成年人影视|亚洲AV亚洲AV|成人开心激情五月|欧美性爱内射视频|超碰人人干人人上|一区二区无码三区亚洲人区久久精品

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內(nèi)不再提示

如何通過Wekinator平臺使用手勢控制Arduino

454398 ? 來源:工程師吳畏 ? 2019-07-30 14:35 ? 次閱讀
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

電路圖

將其中一個蜂鳴器的正極連接到Arduino的9針和Arduino的10針的另一個蜂鳴器的正面。然后將兩個蜂鳴器的負片連接到項目的Arduino.section的地面。

如何運行代碼

首先,在Arduino IDE中粘貼為本文末尾的Arduino提供的代碼并上傳代碼。

然后您需要從Wekinator的示例頁面下載草圖。

下載源代碼以處理簡單的10x10顏色網(wǎng)格。解壓縮并在處理中運行代碼。該程序?qū)⑹褂媚墓P記本電腦的網(wǎng)絡攝像頭,根據(jù)您在攝像頭前所做的操作,它將為Wekinator提供輸入。

您需要另一個草圖來輸出Wekinator的輸出。這篇文章末尾的草圖代碼。將其粘貼到處理中并運行草圖。這個草圖將從Wekinator輸出并將其發(fā)送到Arduino,蜂鳴器將播放不同的聲音。

兩個處理窗口應如下所示。

現(xiàn)在打開Wekinator并進行如下圖所示的設置。將輸入設置為100,將輸出設置為2.將類型設置為“自定義”,然后單擊“配置”。

點擊“配置”時“,一個新窗口將打開,如下所示。更改設置,如下圖所示。

現(xiàn)在退出網(wǎng)絡攝像頭并點擊“隨機化”。開始錄制半秒。

現(xiàn)在將右手顯示在網(wǎng)絡攝像頭的右側(cè),然后單擊“隨機化”。然后開始錄制半秒。

現(xiàn)在將左手顯示在網(wǎng)絡攝像頭的左側(cè),然后單擊“隨機化”。然后開始錄制半秒。

然后,單擊“訓練”,然后單擊“運行”?,F(xiàn)在,Arduino將根據(jù)您在網(wǎng)絡攝像頭前顯示的手勢播放聲音。

處理代碼(Wekinator輸出)

import vsync.*; // Importing the library that will help us in sending and receiving the values from the Arduino

import processing.serial.*; // Importing the serial library

// Below libraries will connect and send, receive the values from wekinator

import oscP5.*;

import netP5.*;

// Creating the instances

OscP5 oscP5;

NetAddress dest;

ValueSender sender;

// These variables will be syncronized with the Arduino and they should be same on the Arduino side.

public int output;

public int output1;

void setup()

{

// Starting the serial communication, the baudrate and the com port should be same as on the Arduino side.

Serial serial = new Serial(this, “COM10”, 19200);

sender = new ValueSender(this, serial);

// Synchronizing the variables as on the Arduino side. The order should be same.

sender.observe(“output”);

sender.observe(“output1”);

// Starting the communication with wekinator. listen on port 12000, return messages on port 6448

oscP5 = new OscP5(this, 12000);

dest = new NetAddress(“127.0.0.1”, 6448);

}

// Recieve OSC messages from Wekinator

void oscEvent(OscMessage theOscMessage) {

if (theOscMessage.checkAddrPattern(“/wek/outputs”) == true) {

// Receiving the output from wekinator

float value = theOscMessage.get(0).floatValue(); // First output

float val = theOscMessage.get(1).floatValue(); // Second output

// Converting the output to int type

output = int(value);

output1 = int(val);

}

}

void draw()

{

// Nothing to be drawn for this example

}

Arduino代碼

#include // Including the library that will help us in receiving and sending the values from processing

ValueReceiver《2》 receiver; /*Creating the receiver that will receive up to 2 values.

Put the number of values to synchronize in the brackets */

/* The below two variables will be synchronized in the processing

and they should be same on both sides. */

int output;

int output1;

// Pin connected to buzzer

int buzzer = 9;

int buzzer1 = 10;

int i,j;

void setup()

{

/* Starting the serial communication because we are communicating with the

Arduino through serial. The baudrate should be same as on the processing side. */

Serial.begin(19200);

// Synchronizing the variables with the processing. The variables must be int type.

receiver.observe(output);

receiver.observe(output1);

// Defines the Buzzer pins as output

pinMode(buzzer,OUTPUT);

pinMode(buzzer1,OUTPUT);

}

void loop()

{

// Receiving the output from the processing.

receiver.sync();

// Making the buzzer to beep according to the output from the processing

tone(buzzer1, output);

delay(5);

noTone(buzzer1);

tone(buzzer,output1);

delay(5);

noTone(buzzer);

}

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權轉(zhuǎn)載。文章觀點僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學習之用,如有內(nèi)容侵權或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報投訴
  • Arduino
    +關注

    關注

    190

    文章

    6497

    瀏覽量

    192016
  • 手勢控制
    +關注

    關注

    4

    文章

    44

    瀏覽量

    22046
收藏 人收藏
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

    評論

    相關推薦
    熱點推薦

    Arduino與LabVIEW聯(lián)合編程指南

    Arduino編程并與LabVIEW上位機結合實現(xiàn)設備的遠程控制與數(shù)據(jù)采集。
    發(fā)表于 06-19 15:54 ?0次下載

    免費分享Arduino入門+進階(全套例程+書籍)

    Arduino是一款開源電子原型平臺,由硬件(單片機開發(fā)板)和軟件(編程環(huán)境)組成,旨在讓非專業(yè)用戶也能輕松入門電子制作和編程。它的核心思想是簡化硬件開發(fā),通過直觀的編程和模塊化設計,讓用戶快速實現(xiàn)
    的頭像 發(fā)表于 05-22 11:40 ?226次閱讀
    免費分享<b class='flag-5'>Arduino</b>入門+進階(全套例程+書籍)

    《ESP32S3 Arduino開發(fā)指南》第二章 Arduino基礎知識

    的發(fā)展,在Arduino出現(xiàn)以前,雖然也有很多公司在推廣一些簡單易用的可編程控制器,但是由于開發(fā)平臺種類繁多,而且使用這些控制器基本上都需要對電子技術、數(shù)字邏輯、寄存器等內(nèi)容進行多方面
    發(fā)表于 05-13 09:28

    通過Arduino Nano Matter開發(fā)板構建智能卷簾系統(tǒng)

    在本指南中,您將學習如何通過Arduino NanoMatter開發(fā)板和板上的Silicon Labs(芯科科技)MGM240S多協(xié)議無線模塊來構建一個智能卷簾系統(tǒng)。該系統(tǒng)可通過 Amazon
    的頭像 發(fā)表于 02-28 09:46 ?531次閱讀
    <b class='flag-5'>通過</b><b class='flag-5'>Arduino</b> Nano Matter開發(fā)板構建智能卷簾系統(tǒng)

    STM32、Arduino、樹莓派開發(fā)方式差異大嗎

    異同點 STM32、Arduino、樹莓派是三種不同的硬件平臺,各自具有獨特的特點和適用場景。 ? 一、硬件特性 ? 硬件平臺 STM32 Arduino 樹莓派 類型 微
    的頭像 發(fā)表于 01-02 11:33 ?1337次閱讀

    如何使用Arduino實現(xiàn)CAN總線通信呢

    CAN(Controller Area Network)總線是一種常用于汽車和工業(yè)控制系統(tǒng)的串行通信協(xié)議,以其高可靠性和實時性而聞名。Arduino,作為一種流行的開源微控制平臺,可
    的頭像 發(fā)表于 12-23 09:06 ?1907次閱讀

    Arduino Nano Matter開發(fā)板正式上市

    Silicon Labs(芯科科技)和Arduino在近日共同宣布Arduino Nano Matter開發(fā)板現(xiàn)已正式上市。這是延續(xù)今年3 月芯科科技和Arduino釋出Arduino
    的頭像 發(fā)表于 12-10 13:50 ?917次閱讀

    HAL庫在Arduino平臺上的使用

    HAL庫在Arduino平臺上的使用 Arduino平臺是一個開源的電子原型平臺,它包括硬件(基于微控制
    的頭像 發(fā)表于 12-02 14:04 ?1599次閱讀

    stm32與Arduino的比較

    在微控制器的世界里,STM32和Arduino是兩個經(jīng)常被提及的名字。STM32是一系列由STMicroelectronics生產(chǎn)的高性能微控制器,而Arduino則是一個開源電子原型
    的頭像 發(fā)表于 11-19 15:45 ?4157次閱讀

    如何使用Arduino實現(xiàn)CAN總線通信

    開源硬件平臺,通過添加CAN總線模塊,也可以實現(xiàn)CAN通信。 硬件準備 Arduino開發(fā)板 :可以選擇Arduino Uno、Mega等型號。 CAN總線模塊 :如MCP2515或M
    的頭像 發(fā)表于 11-12 10:09 ?2685次閱讀

    樹莓派與Arduino的區(qū)別是什么

    在當今的科技世界中,樹莓派(Raspberry Pi)和Arduino是兩個經(jīng)常被提及的名字。它們都是開源硬件平臺,但它們的目標、功能和用途卻大相徑庭。 1. 目標和用途 樹莓派(Raspberry
    的頭像 發(fā)表于 11-11 11:14 ?2314次閱讀

    Cortex-A55國產(chǎn)處理器_教學實驗箱_操作案例分享:5-21 手勢識別實驗

    ,用戶可通過I2C接口總線采集信號并迅速識別出UP、Down、Right、Left等9種常用手勢。另外PAJ7620U2還提供內(nèi)置的接近檢測功能,用于檢測物體的接近或離開。 三、操作現(xiàn)象 實驗設備 本
    發(fā)表于 10-15 16:18

    貿(mào)澤電子開售Arduino新款解決方案

    的新款產(chǎn)品及解決方案。Arduino產(chǎn)品從設計之初就旨在提供一個便捷的平臺和生態(tài)系統(tǒng)來提升行業(yè)創(chuàng)造力和產(chǎn)品創(chuàng)新。Arduino解決方案彌補了工程領域的人才短缺,并通過強大的開源產(chǎn)品線擺
    發(fā)表于 09-24 15:54 ?300次閱讀

    通過機智云平臺電腦網(wǎng)頁控制設備的指南

    在現(xiàn)代智能家居管理中,機智云平臺為用戶提供了便捷的設備控制方式。通過電腦網(wǎng)頁,用戶可以利用WebSocketAPI實現(xiàn)對設備的實時控制。本文將為您詳細介紹如何在機智云
    的頭像 發(fā)表于 09-22 08:02 ?574次閱讀
    <b class='flag-5'>通過</b>機智云<b class='flag-5'>平臺</b>電腦網(wǎng)頁<b class='flag-5'>控制</b>設備的指南

    ESP-12 ESP8266如何通過I2C將SSID和RSSI信息發(fā)送到RPi / Arduino?

    我正在尋找我的 ESP-12 ESP8266,以便通過 I2C 將 SSID 和 RSSI 信息發(fā)送到 RPi / Arduino。關于如何進行的任何建議? 我查看了文檔,不禁注意到 SSID
    發(fā)表于 07-22 07:36