電子發(fā)燒友App

硬聲App

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

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

3天內(nèi)不再提示
創(chuàng)作
電子發(fā)燒友網(wǎng)>電子資料下載>電子資料>使用TCS3200和Arduino Uno制作Arduino Chameleon

使用TCS3200和Arduino Uno制作Arduino Chameleon

2022-10-27 | zip | 0.30 MB | 次下載 | 2積分

資料介紹

描述

關(guān)于該項目

在這個項目中,我將指導(dǎo)您如何使用 TCS3200 和 Arduino Uno 制作自己的 Arduino Chameleon。有關(guān)更多信息以及 Arduino 和 Raspberry Pi 相關(guān)項目,

所需零件

  • TCS3200 x 1
  • Arduino Uno x 1
  • 面包板 x 1
  • 很多跳線

需要的軟件

  • Arduino IDE

要遵循的步驟

  • 請參閱下圖了解所有電線連接。
?
pYYBAGNX-gWAG8IoAACGFRgDZeo225.png
Arduino——Tcs3200
?

?

?
poYBAGNX-gmAR73xAADPPFo5ZAs065.png
RGB LED 連接
?
  • 現(xiàn)在只需將以下代碼上傳到您的 Arduino 上即可。
/* 
* Created By Manan Thareja 
* Color sensor using TCS3200 
*/ 
#define S0 3 
#define S1 4 
#define S2 5 
#define S3 6 
#define sensorOut 2 
int green = 9; 
int blue = 10; 
int red  = 11; 
int redfrequency = 0; 
int greenfrequency = 0; 
int bluefrequency = 0; 
void setup() { 
pinMode(S0, OUTPUT); 
 pinMode(S1, OUTPUT); 
 pinMode(S2, OUTPUT); 
 pinMode(S3, OUTPUT); 
 pinMode(sensorOut, INPUT); 
 pinMode(green, OUTPUT); 
 pinMode(blue, OUTPUT); 
 pinMode(red, OUTPUT); 
 // Setting frequency-scaling to 20% 
 digitalWrite(S0,HIGH); 
 digitalWrite(S1,LOW); 
 Serial.begin(9600); 
} 
void loop() { 
 // Setting red filtered photodiodes to be read 
 digitalWrite(S2,LOW); 
 digitalWrite(S3,LOW); 
 // Reading the output frequency 
 redfrequency = pulseIn(sensorOut, LOW); 
 //Remaping the value of the frequency to the RGB Model of 0 to 255 
 redfrequency = map(redfrequency, 25,72,255,0); 
 if (redfrequency > 255) 
 { 
     redfrequency = 255;   
 }   
  else if (redfrequency < 0) 
 { 
     redfrequency = 0;   
 } 
 // Printing the value on the Serial monitor 
 Serial.print("R ");//printing name 
 Serial.print(redfrequency);//printing RED color frequency 
 analogWrite(red, redfrequency); 
 delay(100); 
 // Setting Green filtered photodiodes to be read 
 digitalWrite(S2,HIGH); 
 digitalWrite(S3,HIGH); 
 // Reading the output frequency 
 greenfrequency = pulseIn(sensorOut, LOW); 
 //Remaping the value of the frequency to the RGB Model of 0 to 255 
 greenfrequency = map(greenfrequency, 30,90,255,0); 
 if (greenfrequency > 255) 
 { 
     greenfrequency = 255;   
 }   
 else if (greenfrequency < 0) 
 { 
     greenfrequency = 0;   
 }   
 // Printing the value on the Serial monitor 
 Serial.print(" G ");//printing name 
 Serial.print(greenfrequency);//printing GREEN color frequency 
 analogWrite(green, greenfrequency); 
 delay(100); 
 // Setting Blue filtered photodiodes to be read 
 digitalWrite(S2,LOW); 
 digitalWrite(S3,HIGH); 
 // Reading the output frequency 
 bluefrequency = pulseIn(sensorOut, LOW); 
 //Remaping the value of the frequency to the RGB Model of 0 to 255 
 bluefrequency = map(bluefrequency, 25,70,255,0); 
 if (bluefrequency > 255) 
 { 
     bluefrequency = 255;   
 }   
  else if (bluefrequency < 0) 
 { 
     bluefrequency = 0;   
 }   
 // Printing the value on the Serial monitor 
 Serial.print(" B ");//printing name 
 Serial.print(bluefrequency);//printing BLUE color frequency 
 analogWrite(blue, bluefrequency); 
 Serial.println("  "); 
 delay(100); 

?如果您有任何問題或建議,請隨時將其發(fā)布在我們網(wǎng)站論壇頁面的“Arduino Projects”類別中。


下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1山景DSP芯片AP8248A2數(shù)據(jù)手冊
  2. 1.06 MB  |  532次下載  |  免費
  3. 2RK3399完整板原理圖(支持平板,盒子VR)
  4. 3.28 MB  |  339次下載  |  免費
  5. 3TC358743XBG評估板參考手冊
  6. 1.36 MB  |  330次下載  |  免費
  7. 4DFM軟件使用教程
  8. 0.84 MB  |  295次下載  |  免費
  9. 5元宇宙深度解析—未來的未來-風(fēng)口還是泡沫
  10. 6.40 MB  |  227次下載  |  免費
  11. 6迪文DGUS開發(fā)指南
  12. 31.67 MB  |  194次下載  |  免費
  13. 7元宇宙底層硬件系列報告
  14. 13.42 MB  |  182次下載  |  免費
  15. 8FP5207XR-G1中文應(yīng)用手冊
  16. 1.09 MB  |  178次下載  |  免費

本月

  1. 1OrCAD10.5下載OrCAD10.5中文版軟件
  2. 0.00 MB  |  234315次下載  |  免費
  3. 2555集成電路應(yīng)用800例(新編版)
  4. 0.00 MB  |  33566次下載  |  免費
  5. 3接口電路圖大全
  6. 未知  |  30323次下載  |  免費
  7. 4開關(guān)電源設(shè)計實例指南
  8. 未知  |  21549次下載  |  免費
  9. 5電氣工程師手冊免費下載(新編第二版pdf電子書)
  10. 0.00 MB  |  15349次下載  |  免費
  11. 6數(shù)字電路基礎(chǔ)pdf(下載)
  12. 未知  |  13750次下載  |  免費
  13. 7電子制作實例集錦 下載
  14. 未知  |  8113次下載  |  免費
  15. 8《LED驅(qū)動電路設(shè)計》 溫德爾著
  16. 0.00 MB  |  6656次下載  |  免費

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935054次下載  |  免費
  3. 2protel99se軟件下載(可英文版轉(zhuǎn)中文版)
  4. 78.1 MB  |  537798次下載  |  免費
  5. 3MATLAB 7.1 下載 (含軟件介紹)
  6. 未知  |  420027次下載  |  免費
  7. 4OrCAD10.5下載OrCAD10.5中文版軟件
  8. 0.00 MB  |  234315次下載  |  免費
  9. 5Altium DXP2002下載入口
  10. 未知  |  233046次下載  |  免費
  11. 6電路仿真軟件multisim 10.0免費下載
  12. 340992  |  191187次下載  |  免費
  13. 7十天學(xué)會AVR單片機(jī)與C語言視頻教程 下載
  14. 158M  |  183279次下載  |  免費
  15. 8proe5.0野火版下載(中文版免費下載)
  16. 未知  |  138040次下載  |  免費