可编程自动盲开瓶器(6)
时间:2017-05-18 10:39 来源:未知 作者:admin 点击:次
| 
				 
			 | 
|  |  | 
|---|---|
|  |  | 
|  | 
								 | 
|  |  | 
|  | 
								 | 
|  | 
								 | 
			步骤40:显示连接 
		
				
				
				
				
			步骤41:电缆整理 
		
				
				
			步骤42:底Arduino 
		
				
				
|  |  | 
|---|---|
|  |  | 
|  |  | 
				
				
|  |  |  | 
|---|---|---|
|  |  |  | 
|  | 
								 |  | 
|  | 
								 |  | 
|  | 
								 |  | 
|  | 
								 |  | 
|  | 
								 |  | 
|  | 
								 |  | 
				
				注意:引脚3V3和int都没有用
			步骤43:Arduino IDE的制备 
		
				
				
				
				
				
				
			步骤44:颜色传感器的标定 
		
				
				
				
				
				
				
				
				
				代码 
			
				
/ *代码自动盲器校准由diytronics:< a href =“http:/ / www.instructables。COM /会员/ diytronics /”> HTTPS:/ / www.instructables。COM /会员/ diytronics / </a> *使用Adafruit tcs34725色彩传感器库:< a href =“http / / / / adafruit_tcs34725 GitHub网站Adafruit”> HTTPS:/ / www.instructables。COM /会员/ diytronics / </a> * / #包括<<丝。” #包括“adafruit_tcs34725。H” adafruit_tcs34725 TCS = adafruit_tcs34725(tcs34725_integrationtime_700ms,tcs34725_gain_1x);//初始化传感器 虚空(void){ 串口设置。开始(9600);//设置串行 如果(TCS。begin()){ //如果传感器fetected 串行out.println(“传感器成功地检测”);/ /通知其他用户 } { //如果传感器没有发现 println系列。(“不tcs34725发现… check your wiring"); //Notify user while (1); } } void loop(void) { uint16_t r, g, b, c, colorTemp, lux; tcs.getRawData(&r, &g, &b, &c); Serial.print("R: "); Serial.print(r, DEC); Serial.print(" "); //Print red values Serial.print("G: "); Serial.print(g, DEC); Serial.print(" "); //Print green values Serial.print("B: "); Serial.print(b, DEC); Serial.print(" "); //Print blue values Serial.print("C: "); Serial.print(c, DEC); Serial.print(" "); //Print clear values Serial.println(" "); } 
下载






