国产精品久久久aaaa,日日干夜夜操天天插,亚洲乱熟女香蕉一区二区三区少妇,99精品国产高清一区二区三区,国产成人精品一区二区色戒,久久久国产精品成人免费,亚洲精品毛片久久久久,99久久婷婷国产综合精品电影,国产一区二区三区任你鲁

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

完善資料讓更多小伙伴認(rèn)識你,還能領(lǐng)取20積分哦,立即完善>

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

如何訓(xùn)練Wekinator控制Arduino

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

掃碼添加小助手

加入工程師交流群

電路圖

Arduino的引腳11連接到橙色LED的正極引線,通過220歐姆電阻將LED的負(fù)極引線連接到Arduino的地。類似地,通過220歐姆電阻將白色LED的正極引線連接到Arduino的引腳10和LED的負(fù)極引線連接到Arduino。

如何訓(xùn)練Wekinator控制Arduino

程序入門

首先,在Arduino IDE中加載下面為Arduino提供的代碼。然后上傳給定代碼以在IDE中處理。

之后,打開Wekinator并將輸入更改為1并輸出為2并離開另一個選項(xiàng)。

點(diǎn)擊“下一步”,會出現(xiàn)一個新窗口。現(xiàn)在從處理的輸入窗口,單擊橙色框,在Wekinator中,在輸出-1框中輸入1,然后開始錄制半秒。

現(xiàn)在,單擊處理中的白色框,在Wekinator中,在輸出-1框中輸入0并在輸出-2框中輸入1并開始記錄半秒。

現(xiàn)在點(diǎn)擊“Train”,然后點(diǎn)擊“Run”。現(xiàn)在,當(dāng)您點(diǎn)擊橙色框時,連接到引腳11的LED將亮起,當(dāng)您單擊白色框時,連接到Arduino引腳10的LED將亮起。

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;

// Initializing the pins for led‘s

int orange_led = 11;

int white_led = 10;

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);

pinMode(white_led, OUTPUT);

pinMode(orange_led, OUTPUT);

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

receiver.observe(output);

receiver.observe(output1);

}

void loop()

{

// Receiving the output from the processing.

receiver.sync();

// Matching the received output to light up led’s

if (output == 1)

{

digitalWrite(orange_led, HIGH);

}

else if (output == 0)

{

digitalWrite(orange_led, LOW);

}

if (output1 == 1)

{

digitalWrite(white_led, HIGH);

}

else if(output1 == 0)

{

digitalWrite(white_led, LOW);

}

}

處理代碼(輸入到Wekinator)

// Importing the library which will help us in communicating with the wekinator

import oscP5.*;

import netP5.*;

//creating the instances

OscP5 oscP5;

NetAddress dest;

float bx;

void setup() {

// Size of output window

size(400, 100, P3D);

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

oscP5 = new OscP5(this,9000);

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

}

void draw() {

// Creating the boxes in window

blocks();

// Send the OSC message to wekinator

sendOsc();

}

void mousePressed()

{

if (mouseX 》 25 && mouseX 《 75)

{

bx=1;

}

if (mouseX 》 325 && mouseX 《 375)

{

bx=2;

}

}

void sendOsc() {

OscMessage msg = new OscMessage(“/wek/inputs”);

msg.add((float)bx);

oscP5.send(msg, dest);

}

void blocks()

{

background(0);

fill(255, 155, 0);

rect(25, 25, 50, 50);

fill(255, 255, 255);

rect(325, 25, 50, 50);

}

處理代碼(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 value1 = theOscMessage.get(1).floatValue(); // Second output

// Converting the output to int type

output = int(value);

output1 = int(value1);

}

}

void draw()

{

// Nothing to be drawn for this example

}

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

    關(guān)注

    190

    文章

    6526

    瀏覽量

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

掃碼添加小助手

加入工程師交流群

    評論

    相關(guān)推薦
    熱點(diǎn)推薦

    BTN9970/BTN9990電機(jī)控制盾牌:Arduino評估利器

    BTN9970/BTN9990電機(jī)控制盾牌:Arduino評估利器 在電子工程師的日常工作中,電機(jī)控制是一個常見且重要的領(lǐng)域。今天,我們就來深入探討一下英飛凌(Infineon)的BTN9970
    的頭像 發(fā)表于 12-21 11:35 ?735次閱讀

    探索用于Arduino的TLE94112ES直流電機(jī)控制盾牌

    探索用于Arduino的TLE94112ES直流電機(jī)控制盾牌 引言 在電子工程領(lǐng)域,電機(jī)控制一直是至關(guān)重要的部分。對于Arduino開發(fā)者而言,一款功能強(qiáng)大且易于使用的電機(jī)
    的頭像 發(fā)表于 12-18 16:35 ?315次閱讀

    Arduino plc和termux esp

    Arduino plc和termux esp
    的頭像 發(fā)表于 12-06 06:41 ?1860次閱讀

    在Ubuntu20.04系統(tǒng)中訓(xùn)練神經(jīng)網(wǎng)絡(luò)模型的一些經(jīng)驗(yàn)

    本帖欲分享在Ubuntu20.04系統(tǒng)中訓(xùn)練神經(jīng)網(wǎng)絡(luò)模型的一些經(jīng)驗(yàn)。我們采用jupyter notebook作為開發(fā)IDE,以TensorFlow2為訓(xùn)練框架,目標(biāo)是訓(xùn)練一個手寫數(shù)字識別的神經(jīng)網(wǎng)絡(luò)
    發(fā)表于 10-22 07:03

    如何在 NuMaker-IoT-M467 板上使用 Arduino IDE 控制 Wi-Fi 模塊?

    在NuMaker開發(fā)板上,有一個ESP-12F Wi-Fi模塊;但是,Arduino IDE 中的 NuMaker UNO 包不提供該模塊的相關(guān)控制。如果您希望在 Arduino IDE 中
    發(fā)表于 09-04 08:28

    使用 ai cude 里面自帶的案例訓(xùn)練UI顯示異常的原因?怎么解決?

    案例的配置是默認(rèn)的,顯示訓(xùn)練ui更改顯示異常
    發(fā)表于 06-23 06:21

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

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

    k210在線訓(xùn)練的算法是yolo5嗎?

    k210在線訓(xùn)練的算法是yolo5嗎
    發(fā)表于 06-16 08:25

    OCR識別訓(xùn)練完成后給的是空壓縮包,為什么?

    OCR識別 一共弄了26張圖片,都標(biāo)注好了,點(diǎn)擊開始訓(xùn)練,顯示訓(xùn)練成功了,也將壓縮包發(fā)到郵箱了,下載下來后,壓縮包里面是空的 OCR圖片20幾張圖太少了。麻煩您多添加點(diǎn),參考我們的ocr識別訓(xùn)練數(shù)據(jù)集 請問
    發(fā)表于 05-28 06:46

    免費(fèi)分享Arduino入門+進(jìn)階(全套例程+書籍)

    創(chuàng)意,比如控制燈光、傳感器、電機(jī)等。以下是Arduino入門+進(jìn)階學(xué)習(xí)資料1.Arduino編程語言說明(相關(guān)文件可在下文掃碼領(lǐng)取)2.Arduino系列學(xué)習(xí)例程
    的頭像 發(fā)表于 05-22 11:40 ?1126次閱讀
    免費(fèi)分享<b class='flag-5'>Arduino</b>入門+進(jìn)階(全套例程+書籍)

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

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

    請問訓(xùn)練平臺訓(xùn)練完的識別程序,可以實(shí)現(xiàn)在識別到物體時屏幕再顯示出來,沒有識別到物體時屏幕不顯示嗎?

    問題如題,訓(xùn)練平臺訓(xùn)練完的識別程序,可以實(shí)現(xiàn)在識別到物體時屏幕再顯示出來,沒有識別到物體時屏幕不顯示嗎?比較小白,可以解釋一下怎么做嗎?或者是我應(yīng)該學(xué)哪里? 如果直接使用平臺下載的代碼不行,改一改可以。
    發(fā)表于 04-29 06:12

    海思SD3403邊緣計(jì)算AI數(shù)據(jù)訓(xùn)練概述

    AI數(shù)據(jù)訓(xùn)練:基于用戶特定應(yīng)用場景,用戶采集照片或視頻,通過AI數(shù)據(jù)訓(xùn)練工程師**(用戶公司****員工)** ,進(jìn)行特征標(biāo)定后,將標(biāo)定好的訓(xùn)練樣本,通過AI訓(xùn)練服務(wù)器,進(jìn)行AI學(xué)習(xí)
    發(fā)表于 04-28 11:11

    OrinNano yolov11訓(xùn)練部署教程

    ORinNano yolov11訓(xùn)練部署教程
    的頭像 發(fā)表于 04-10 15:26 ?2585次閱讀
    OrinNano  yolov11<b class='flag-5'>訓(xùn)練</b>部署教程

    訓(xùn)練好的ai模型導(dǎo)入cubemx不成功怎么處理?

    訓(xùn)練好的ai模型導(dǎo)入cubemx不成功咋辦,試了好幾個模型壓縮了也不行,ram占用過大,有無解決方案?
    發(fā)表于 03-11 07:18