top of page

Week 4: Starting Arduino Code

Vasyl

Updated: Jun 18, 2024

Phone App:

Block code was restructured for simpler view of all the code for each mode/ Bluetooth initialization [18] [19]. The AUTO and MANUAL, CUSTOM string values were modified in order to differentiate received strings in Arduino. Current time string has “T:” before it in order to identify it as current time to set for Arduino internal clock. Before sending selected MODE, “MODE:” followed by capital letter of each Mode.

AUTO mode has been implanted with 6 choices of lumen (will change to lux) ranging from 0- 1800 lumens, with 300 increments. The user choice is sent as L:A1 – L:A6 (representing each lumen range) in order to shorten the string sending over Bluetooth [20]. MANUAL mode sends M:U or M:D to Arduino in order to indicate mode and position to move the blinds (UP or DOWN) [21].



Arduino Code:

Arduino is continuously checking for incoming data. The first 2 characters of transmitted data indicate what is being sent Arduino. When “T:” is received, Arduino will save the incoming string as current time of the internal clock [22]. If Arduino receives A:, M:, or C:, that’s the mode that has been selected and the next values received will be going to that function. For AUTO mode, the lumen values are received as: L:A1 – L:A6 indicating range selected by the user. Thus far, the first 2 modes have been implemented depending on user input. For debugging purposes, the values received by Arduino are shown in COM port, as seen in video below.  




Flowcharts:

Made modifications to the flowcharts according to what was discussed. Whenever a condition was met, the if statements do not loop through unnecessarily and move on to the next step.



10 views0 comments

Recent Posts

See All

Week 8

Had the Flu from Tuesday to Saturday. Vasyl ordered and delivered a new solar panel, charge controller and battery for me to implement...

Comments


bottom of page