EasyManua.ls Logo

SunFounder 3in1 Kit - Page 325

Default Icon
351 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SunFounder 3in1 Kit
How it works?
The function BLYNK_WRITE(V0) gets the status of the Switch widget and assigns it to the variable doorFlag, which
will be used to determine if the smart gate system is enabled or not.
BLYNK_WRITE(V0)
{
doorFlag = param.asInt(); // Enable Gate
}
In the Blynk Timer, doorFlag is judged every second and if it is enabled, the main function of the gate is executed.
void myTimerEvent()
{
if (doorFlag)
{
channelEntrance();
}
}
The main function of the gate is channelEntrance(). When an object approaches the gate (the sensor detects that
there is an obstacle), the count is increased by 1. Write count to the datastream V8 of Blynk Cloud and 7-segment
display on the circuit, and open the door. If the object goes from present to absent, which means the object has entered
the door, close the door.
void channelEntrance()
(continues on next page)
6.7. 7. Current Limiting Gate 321

Related product manuals