Difference between revisions of "Smart Piggy Bank"
(Created page with "{| style="width: 1000px;" |- | ==Overview== 600px|center Make a smart piggy bank, which can record the coin number and display it on OLED, a...") |
(→Start to Program) |
||
Line 62: | Line 62: | ||
===Start to Program=== | ===Start to Program=== | ||
− | ''' Judge if a coin passed''' | + | ''' Judge if a coin has passed''' |
<br> | <br> | ||
Declare a variable coin to record the coin number. If the distance value detected by the line finder is less than 180, there are coins in front of the sensor. | Declare a variable coin to record the coin number. If the distance value detected by the line finder is less than 180, there are coins in front of the sensor. |
Revision as of 06:08, 4 November 2016
ContentsOverviewMake a smart piggy bank, which can record the coin number and display it on OLED, and emit “ding” sound every time throw a coin into it.
Module BillModule
Other Equipment
Module SetupSetup
ProgramRequired Program Blocks
Programming ThoughtJudge whether the distance value of the line finder is less than 180. If it is, there was coins thrown in (according to the material of the coins, the judgement value can be adjusted appropriately), the buzzer will produce a ding sound, the coin number will increase 1, and it will be displayed on the screen.Finally wait for the distance of the line finder to be larger than 220. Start to Program Judge if a coin has passed
Technical Specification
Related Cases
FAQ |