Components and supplies
1
Arduino Nano R3
Apps and platforms
1
MIT App Inventor 2
Project description
Code
The Bluetooth part of the code
arduino
Comments
Only logged in users can leave comments
Components and supplies
Arduino Nano R3
Apps and platforms
MIT App Inventor 2
Project description
Code
The Bluetooth part of the code
arduino
1 2void InitializeBlueTooth() { 3 Serial.begin(9600); 4} 5 6void getBTDataLast() { 7 while (Serial.available()) { //get the last data 8 BTData = Serial.read(); 9 setMode(); 10 } 11} 12 13void getBTDataEvery() { 14 if (Serial.available()) { 15 BTData = Serial.read(); 16 setMode(); 17 if (BTData >= '1' && BTData <= '9') BTData -=48; 18 } else { 19 BTData = 200; 20 } 21} 22 23void setMode() { 24 if (BTData >= 100) { 25 mode = BTData - 100; 26 } 27}
Comments
Only logged in users can leave comments