const int redPin = A0; // sensor to control red colorconst int greenPi การแปล - const int redPin = A0; // sensor to control red colorconst int greenPi ไทย วิธีการพูด

const int redPin = A0; // sensor to

const int redPin = A0; // sensor to control red color
const int greenPin = A1; // sensor to control green color
const int bluePin = A2; // sensor to control blue color

void setup() {
Serial.begin(9600);
}

void loop() {
Serial.print(analogRead(redPin));
Serial.print(",");
Serial.print(analogRead(greenPin));
Serial.print(",");
Serial.println(analogRead(bluePin));
}

/* Processing code for this example

// This example code is in the public domain.

import processing.serial.*;

float redValue = 0; // red value
float greenValue = 0; // green value
float blueValue = 0; // blue value

Serial myPort;

void setup() {
size(200, 200);

// List all the available serial ports
// if using Processing 2.1 or later, use Serial.printArray()
println(Serial.list());

// I know that the first port in the serial list on my mac
// is always my Arduino, so I open Serial.list()[0].
// Open whatever port is the one you're using.
myPort = new Serial(this, Serial.list()[0], 9600);
// don't generate a serialEvent() unless you get a newline character:
myPort.bufferUntil('
');
}

void draw() {
// set the background color with the color values:
background(redValue, greenValue, blueValue);
}

void serialEvent(Serial myPort) {
// get the ASCII string:
String inString = myPort.readStringUntil('
');

if (inString != null) {
// trim off any whitespace:
inString = trim(inString);
// split the string on the commas and convert the
// resulting substrings into an integer array:
float[] colors = float(split(inString, ","));
// if the array has at least three elements, you know
// you got the whole thing. Put the numbers in the
// color variables:
if (colors.length >=3) {
// map them to the range 0-255:
redValue = map(colors[0], 0, 1023, 0, 255);
greenValue = map(colors[1], 0, 1023, 0, 255);
blueValue = map(colors[2], 0, 1023, 0, 255);
0/5000
จาก: -
เป็น: -
ผลลัพธ์ (ไทย) 1: [สำเนา]
คัดลอก!
const int redPin = A0; // sensor to control red colorconst int greenPin = A1; // sensor to control green colorconst int bluePin = A2; // sensor to control blue colorvoid setup() { Serial.begin(9600);}void loop() { Serial.print(analogRead(redPin)); Serial.print(","); Serial.print(analogRead(greenPin)); Serial.print(","); Serial.println(analogRead(bluePin));}/* Processing code for this example// This example code is in the public domain. import processing.serial.*; float redValue = 0; // red value float greenValue = 0; // green value float blueValue = 0; // blue value Serial myPort; void setup() { size(200, 200); // List all the available serial ports // if using Processing 2.1 or later, use Serial.printArray() println(Serial.list()); // I know that the first port in the serial list on my mac // is always my Arduino, so I open Serial.list()[0]. // Open whatever port is the one you're using. myPort = new Serial(this, Serial.list()[0], 9600); // don't generate a serialEvent() unless you get a newline character: myPort.bufferUntil('
'); } void draw() { // set the background color with the color values: background(redValue, greenValue, blueValue); } void serialEvent(Serial myPort) { // get the ASCII string: String inString = myPort.readStringUntil('
'); if (inString != null) { // trim off any whitespace: inString = trim(inString); // split the string on the commas and convert the // resulting substrings into an integer array: float[] colors = float(split(inString, ",")); // if the array has at least three elements, you know // you got the whole thing. Put the numbers in the // color variables: if (colors.length >=3) { // map them to the range 0-255: redValue = map(colors[0], 0, 1023, 0, 255); greenValue = map(colors[1], 0, 1023, 0, 255); blueValue = map(colors[2], 0, 1023, 0, 255);
การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 2:[สำเนา]
คัดลอก!
const int redPin = A0; // sensor ในการควบคุมสีแดง
const int greenPin = A1; // sensor ในการควบคุมสีเขียว
const int bluePin = A2; // sensor ในการควบคุมสีฟ้า

ติดตั้งเป็นโมฆะ () {
Serial.begin (9600);
}

โมฆะห่วง () {
Serial.print (analogRead (redPin));
Serial.print ( "");
Serial.print (analogRead ( greenPin));
Serial.print ( "");
Serial.println (analogRead (bluePin));
}

/ * รหัสการประมวลผลเช่นนี้

. // โค้ดตัวอย่างนี้อยู่ในโดเมนสาธารณะ

. นำเข้า processing.serial *

ลอย redValue = 0; // ค่าสีแดง
ลอย greenValue = 0; // ค่าสีเขียว
ลอย blueValue = 0; // ค่าสีฟ้า

อนุกรม myport;

ติดตั้งเป็นโมฆะ () {
ขนาด (200, 200);

// รายการทั้งหมดพอร์ตอนุกรมใช้ได้
// ถ้าใช้การประมวลผล 2.1 หรือสูงกว่าใช้ Serial.printArray ()
println (Serial.list ()) ;

// ฉันรู้ว่าพอร์ตแรกในรายการอนุกรมบน Mac ของฉัน
. // อยู่เสมอ Arduino ของฉันดังนั้นฉันเปิด Serial.list () [0]
. // เปิดสิ่งที่เป็นหนึ่งในพอร์ตที่คุณกำลังใช้
myport = อนุกรมใหม่ (นี้ Serial.list () [0], 9600);
// ไม่สร้าง serialEvent A () เว้นแต่คุณจะได้รับอักขระ newline:
myPort.bufferUntil ( ' n');
}

โมฆะวาด () {
// กำหนดสีพื้นหลังที่มีค่าสี:
พื้นหลัง (redValue, greenValue, blueValue);
}

โมฆะ serialEvent (myport อนุกรม) {
// รับสตริง ASCII:
String inString = myPort.readStringUntil ( ' n');

if ( inString = null) {!
// ตัดช่องว่างใด ๆ
inString = ตัด (inString);
// แยกสตริงจุลภาคและแปลง
// ส่งผลสตริงเป็นอาร์เรย์จำนวนเต็ม:
ลอย [] = สีลอย (Split (inString ""));
// ถ้าอาร์เรย์มีอย่างน้อยสามองค์ประกอบคุณรู้
// คุณมีสิ่งที่ทั้ง ใส่ตัวเลขใน
// ตัวแปรสี:
ถ้า (colors.length> = 3) {
// แม็พกับช่วง 0-255:
redValue = แผนที่ (สี [0], 0, 1023, 0, 255);
greenValue = แผนที่ (สี [1], 0, 1023, 0, 255);
blueValue = แผนที่ (สี [2], 0, 1023, 0, 255);
การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 3:[สำเนา]
คัดลอก!
Const Int redpin = A0 ; / / เซ็นเซอร์เพื่อควบคุมสีแดงConst Int greenpin = 1 ; / / เซ็นเซอร์เพื่อควบคุมสี เขียวConst Int bluepin = A2 ; / / เซ็นเซอร์เพื่อควบคุมสี สีฟ้าsetup() { โมฆะต่อเนื่อง เริ่มต้น ( 9600 )}loop() { โมฆะต่อเนื่อง พิมพ์ ( analogread ( redpin ) )ต่อเนื่อง พิมพ์ ( " " ) ;ต่อเนื่อง พิมพ์ ( analogread ( greenpin ) )ต่อเนื่อง พิมพ์ ( " " ) ;ต่อเนื่อง println ( analogread ( bluepin ) )}/ * การประมวลผลรหัสตัวอย่าง/ / โค้ดตัวอย่างนี้เป็นสมบัติสาธารณะกระบวนการนำเข้า อนุกรม . * ;ลอย redvalue = 0 ; / / ค่าสีแดงลอย greenvalue = 0 ; / / สีเขียวค่าลอย bluevalue = 0 ; / / ค่า สีฟ้าอนุกรม myport ;setup() { โมฆะขนาด ( 200 , 200 )/ / รายการทั้งหมดของพอร์ตอนุกรม/ / ถ้าใช้การประมวลผล 2.1 หรือสูงกว่า printarray() แบบใช้println ( ต่อเนื่อง list() )/ / ฉันรู้ว่าพอร์ตแรกในรายการของฉัน Mac อนุกรม/ / เป็น Arduino ของฉันดังนั้นฉันเปิดต่อเนื่อง list() [ 0 ]/ / เปิดพอร์ตที่เป็นหนึ่งที่คุณกำลังใช้myport ใหม่ = อนุกรม ( serial . list() [ 0 ] , 600 )/ / อย่าสร้าง serialevent() จนกว่าคุณจะได้รับบทใหม่ตัวอักษร :myport bufferuntil ( " ." ) ;}draw() { โมฆะ/ / ตั้งค่าสีพื้นหลังกับสีค่า :พื้นหลัง ( redvalue greenvalue bluevalue , , )}serialevent เป็นโมฆะ ( อนุกรม myport ) {/ / เอา ASCII String :สาย instring = myport readstringuntil ( " ." ) ;ถ้า ( instring ! = null ) {/ / ตัดช่องว่างใด ๆ :instring = ประดับ ( instring )/ / แยกสตริงในเครื่องหมายจุลภาคและแปลง/ / ซึ่งเป็นจำนวนเต็มสตริงย่อยอาร์เรย์ :ลอย [ ] สี = ลอย ( แยก ( instring , " " ) ;/ / ถ้าอาร์เรย์มีอย่างน้อยสามองค์ประกอบ คุณรู้/ / คุณได้ทุกอย่าง ใส่ตัวเลขใน/ / สีตัวแปร :ถ้า ( colors.length > = 3 ) {/ / แผนที่พวกเขาช่วง 0-255 :แผนที่ redvalue = ( สี [ 0 ] 0 1023 , 0 , 255 )แผนที่ greenvalue = ( สี [ 1 ] 0 1023 , 0 , 255 )แผนที่ bluevalue = ( สี [ 2 ] 0 1023 , 0 , 255 )
การแปล กรุณารอสักครู่..
 
ภาษาอื่น ๆ
การสนับสนุนเครื่องมือแปลภาษา: กรีก, กันนาดา, กาลิเชียน, คลิงออน, คอร์สิกา, คาซัค, คาตาลัน, คินยารวันดา, คีร์กิซ, คุชราต, จอร์เจีย, จีน, จีนดั้งเดิม, ชวา, ชิเชวา, ซามัว, ซีบัวโน, ซุนดา, ซูลู, ญี่ปุ่น, ดัตช์, ตรวจหาภาษา, ตุรกี, ทมิฬ, ทาจิก, ทาทาร์, นอร์เวย์, บอสเนีย, บัลแกเรีย, บาสก์, ปัญจาป, ฝรั่งเศส, พาชตู, ฟริเชียน, ฟินแลนด์, ฟิลิปปินส์, ภาษาอินโดนีเซี, มองโกเลีย, มัลทีส, มาซีโดเนีย, มาราฐี, มาลากาซี, มาลายาลัม, มาเลย์, ม้ง, ยิดดิช, ยูเครน, รัสเซีย, ละติน, ลักเซมเบิร์ก, ลัตเวีย, ลาว, ลิทัวเนีย, สวาฮิลี, สวีเดน, สิงหล, สินธี, สเปน, สโลวัก, สโลวีเนีย, อังกฤษ, อัมฮาริก, อาร์เซอร์ไบจัน, อาร์เมเนีย, อาหรับ, อิกโบ, อิตาลี, อุยกูร์, อุสเบกิสถาน, อูรดู, ฮังการี, ฮัวซา, ฮาวาย, ฮินดี, ฮีบรู, เกลิกสกอต, เกาหลี, เขมร, เคิร์ด, เช็ก, เซอร์เบียน, เซโซโท, เดนมาร์ก, เตลูกู, เติร์กเมน, เนปาล, เบงกอล, เบลารุส, เปอร์เซีย, เมารี, เมียนมา (พม่า), เยอรมัน, เวลส์, เวียดนาม, เอสเปอแรนโต, เอสโทเนีย, เฮติครีโอล, แอฟริกา, แอลเบเนีย, โคซา, โครเอเชีย, โชนา, โซมาลี, โปรตุเกส, โปแลนด์, โยรูบา, โรมาเนีย, โอเดีย (โอริยา), ไทย, ไอซ์แลนด์, ไอร์แลนด์, การแปลภาษา.

Copyright ©2024 I Love Translation. All reserved.

E-mail: