Tab Content
Tab Title
Instructions
Tab Content

Click on the code below the line “#include ” Type “SoftwareSerial BTConnect(0,1);” Press enter and type “Servo myservo;” Press enter and type “int led = 13;” STEM Connections In this section, the first line of code names the SoftwareSerial connection “BTConnect” and initializes pins 0 and 1 to communicate with the Bluetooth module. This is similar to the next line of code, which you saw before, names our Servo “myservo”. The next line declares that “led” will stand for the number 13, the pin we will use to connect the LED to the Arduino. The last line of code in this section sets up “BTData” as a variable that we will use later in the code. Press enter and type “int BTData;”

Tab Title
Implementation
Tab Content

When writing code in Arduino, you can either review each line of code with the students as you type it or go back and review what the code means once you are all done. You could print the completed code for each group as a reference or use the Thinkabit Lab notebook.

Tab Title
Troubleshooting
Tab Content
  1. Colors don’t change like they do in the video
  • The words “Servo”, “SoftwareSerial” and “int” should all change colors as they are recognized functions in Arduino. If they did not change colors as shown in the video, check the following:
  • Check the spelling. Are the words spelled correctly with the proper capitalization?
  • Check the spacing. Is proper spacing used? Watch the video and read the instructions carefully.
  • If it changed color to a different color, the Arduino software may have been updated. If these words are colored, the code should still work properly.
Instruction Category
Video