Week 3
This week, after
discussion, the work plan of two groups in week two was decided.
For
motor group, they should complete the library files of controlling part, and test
them to make sure they work. Furthermore, they should spend some time too study
the working principle of Bluetooth on arduino.
For
Flex Sensor Group, they are planned to test the resistance of flex sensors, and
study the work principle of flex sensors on arduino. In addition, if they have
enough time, they should complete some codes of Bluetooth and flex sensors.
However, the flex sensors still not available and we can't test the resistance and work principle of them this week. We had to work on the codes of Bluetooth and flex sensors first.
Working detail
Motor Group:
In
the morning of the lab day in week three, the work is boring. Actually, we
spend almost the whole morning in debugging, because it is the first time for
us to write the library files for arduino. There were some data type problems
and structure problems on it, and it cost us too much time to check and solve
them. After that, the codes were tested, and all of them were working. In
addition, some comments of the library files were written. The completed
library files were shown in figure 1 and 2.
Figure 1: motor.h
file of library file
Figure 2: motor.cpp
file of library file
In
the motor.h file, it has defined the pins, variables and functions. Moreover,
the motor.cpp file defined the codes for each function, and connected the pins
to the outputs and inputs.
In
the afternoon, we start to working on the receiver part of the Bluetooth. Thank
to the slow delivering glove group did not get the flex sensors, so we have no
master part of the Bluetooth. Therefore, we can only test the receiver part of
the Bluetooth without master part. However, glove group have paired the
Bluetooth. Consequently, we have to employ a new Bluetooth and try to connect it
to phone, and use phone to communication.
At the beginning, as it shown in Figure 3, we connect the BH 05
Bluetooth module to arduino. After that, we adjusted it into AT mode, and we do
a lot of adjustment on Bluetooth such changing name, pairing and changing
password. Then we change the name and the password of it. The glove group had tested and found the address of each Bluetooth, so
we just need to find the corresponding Bluetooth on the application of the
phone. However, in the whole afternoon, we could not found the corresponding
Bluetooth on the phone, and we feel depressed about that.
Figure 3, Car
with Bluetooth
Flex Sensor Group:
In the morning, we
test the two HC05 Bluetooth and tried to match these two Bluetooth. After
searching for information, the code for Bluetooth matching had completed. Then we made some adjustments to the code, uploaded
the code to Arduino and adjusted the relevant data, two Bluetooth matched
successfully.
In the afternoon, our
flex sensor hasn't arrived yet, so we can’t test the whole circuit. We looked
up a lot of information about sensors and wrote a rough code for it, the code of flex sensors is shown in Figure 4. When the
sensor arrives next week, we can use this code to test it.
Figure 4. The code of flex sensor
By
communicating with the motor group, the basic communication plan was worked out
and the rough code was written. Work outside the sensor is almost complete, we only need to wait for flex sensors to link these small sections together.
评论
发表评论