LMS行政E化暨班級社群教職員工數位歷程檔線上手冊登入
Arduino+HC05+DHT11
by 王文良 2018-12-04 09:50:56, 回應(0), 人氣(13)
code 1:
void setup() { Serial.begin(9600); pinMode(8, OUTPUT); // put your setup code here, to run once: } void loop() { // put your main code here, to run repeatedly: if(Serial.available()>0) { char data= Serial.read(); // reading the data received from the bluetooth module switch(data) { case 'a': digitalWrite(8, HIGH);break; // when a is pressed on the app on your smart phone case 'd': digitalWrite(8, LOW);break; // when d is pressed on the app on your smart phone default : break; } Serial.println(data); } delay(50); }
回應