Implement I2C support into firmware
This commit is contained in:
		
							parent
							
								
									05ada31f0e
								
							
						
					
					
						commit
						c4edb43af6
					
				@ -31,6 +31,12 @@ void setup() {
 | 
				
			|||||||
  pinMode(LED_BUILTIN, OUTPUT); 
 | 
					  pinMode(LED_BUILTIN, OUTPUT); 
 | 
				
			||||||
  digitalWrite(LED_BUILTIN, LOW);
 | 
					  digitalWrite(LED_BUILTIN, LOW);
 | 
				
			||||||
  dht.begin();
 | 
					  dht.begin();
 | 
				
			||||||
 | 
					  Wire.begin(8);                // join i2c bus with address #8
 | 
				
			||||||
 | 
					  Wire.onRequest(requestEvent); // register event
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void requestEvent() {
 | 
				
			||||||
 | 
					  Wire.write("he1234");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void loop() {
 | 
					void loop() {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user