In this week I learned how use Bluetooth module to control the actions of the components.
My assignment idea is a limited counter which count form 0 to 9 according to plus button "P" and minus button "M" and the buzzer is on when I press "M" and the number is 0 and when I press "P" and the number is 9.
I used tinkercad software, Arduino 1.8.15 and Arduino BlueControl App.
The materials which I used is Arduino, 7 segments, Resistors, buzzer, Bluetooth module breadboard and jumpers.
1- I make the circuit in tinkercad and I used photoshop to put Bluetooth module with my circuit.
2- I used 2 action components (7 segments and buzzer), Arduino, Resistors (220 ohm connected with the 7 segment and 1K ohm and 2K ohm connected with Bluetooth module), buzzer, and jumpers. I made this circuit in real.
3- I made the code in steps:
Step1: I made the 7 segment count from 0 to 9
Step2: Connect buzzer and Bluetooth module
The concept of the code is:
I made x=0 to make the start number is 0. thin when I press "P" the action is (x=x+1) plus 1 above x to make it 1 then the light make number 1 and so on.
when I press "M" the action is (x=x-1) minus 1 from x.
When x=0 and I press "M" the buzzer on and print Error.
When x=9 and I press "P" the buzzer on and print Error.
Note: each no of x is contain a code to display the correct number in 7segment by high and low the correct pins.
1- Pair my Bluetooth module on my mobile and open the app.
2- connect the Bluetooth module.
3- Go to settings to change Buttons input.
4- Change button A data to "P"
4- Change button B data to "M"
5- The app is ready to check the circuit
This video show the assignment display.
My idea is like the hackathon idea.
My team in hackathon was Ramie and Esraa.
Esraa helped me to understand the hackathon connections and how to connect the Bluetooth module to the circuit.
Ramie helped me to understand the concept of the hackathon code.
In the EOW session at the hackathon the Bluetooth is lost the connection more than one time and the solution was turn off the Bluetooth and thin turn it on again and repeat the connection again.
In the first when I test the circuit the button plus is work but the minus not .
Serial read is read only one time so it read plus but didn't read minus.
The solution is make the serial read is variable and put it in "char"
Now I know how to attach Bluetooth module in my final project.
The hackathon competition although we are lose because the connection was unstable but it was soo cool and fun