Could someone please help to debug my code. I am new in Python programming and I wanted to make my robot scan the ‘barcode’ and at the same time count the ‘inventory boxes’ on the left. I tried doing it in Python Project using a function but my variable ‘inventory’ doesn’t increase the value whenever the distance sensor reads < 30cm. In the end, the display always shows ‘None’. Here is my Python Project link: https://www.robotmesh.com/studio/60a7162ad2cf776482d02749
I tried an alternative way in a Blockly Project to learn using a thread. However, the problem still persist. My variable on thread2 doesn’t count up. Here is my Blockly Project link: https://www.robotmesh.com/studio/60aafe5dd07e4038a62aaf82
I have no problem in scanning my ‘barcode line segments’, my only problem is to count the boxes.
Looking forward to your suggestions.