kxkxYJ MockhongChin Zhi Rong
Published

Smart Cashier - Group 1 (C6)

This project aims to develop a solution to have an auto cashier that people can use to scan their items without the need for a cashier.

AdvancedShowcase (no instructions)Over 29 days144
Smart Cashier - Group 1 (C6)

Things used in this project

Hardware components

M5Stack FIRE IoT Development Kit (PSRAM 2.0)
M5Stack FIRE IoT Development Kit (PSRAM 2.0)
Payment and Scanning
×2
Mini RFID Unit RC522 Module Sensor
M5Stack Mini RFID Unit RC522 Module Sensor
Used for payment and scanning of items
×2
Time-of-Flight (ToF) VL53L0X Laser Ranging Unit (MCP4725/)
M5Stack Time-of-Flight (ToF) VL53L0X Laser Ranging Unit (MCP4725/)
To detect the distance of items shoppers scanned
×2
PIR Sensor Human Body Infrared PIR Motion Sensor (AS312)
M5Stack PIR Sensor Human Body Infrared PIR Motion Sensor (AS312)
To alert the shoppers if the station is occupied or unoccupied
×1
M5Stack RGB Unit with NeoPixel RGB LED (SK6812)
M5Stack RGB Unit with NeoPixel RGB LED (SK6812)
Output color to alert the shoppers if the station is occupied or unoccupied
×1
Mini HUB Unit 1 to 3 HUB
M5Stack Mini HUB Unit 1 to 3 HUB
Extension for all sensors
×2

Software apps and online services

UIFlow - Desktop IDE
An app that we use to code our 2 M5Stack
Draw.io
The online website used to create flowcharts

Story

Read more

Schematics

PowerPoint Presentation Slides

Our PowerPoint Presentation Slides

Block Diagram

Block Diagram

Flowchart (Listing)

Flowchart Listing

Flowchart (Payment)

Flowchart Payment

Code

Listing Code

Python
Each grocery has an RFID tag. When the RFID sensor senses this tag, it will input the item into the system and add up the prices and display everything on the display. Each station has a PIR sensor. The PIR sensor will alert the shoppers whether the station is occupied or unoccupied. The RGB unit will be used to alert the shoppers (Eg. Red=Occupied, Green=Unoccupied). Once the person is done placing all the items, they can see the total prices and items on the display. Then they will check out using their cards on another RFID sensor. If the items are too far, the TOF sensor will alert them and ask them to scan again.
{"components":[{"id":"____screen","createTime":1674651861762,"name":"screen","x":0,"y":0,"width":320,"height":240,"backgroundColor":"#222222","backgroundImage":"","type":"screen"},{"id":"____buttonA","createTime":1674651861762,"name":"ButtonA","buttonIndex":0,"x":35,"y":216,"width":64,"height":24,"text":"ButtonA","visibility":false,"type":"button"},{"id":"____buttonB","createTime":1674651861762,"name":"ButtonB","buttonIndex":1,"x":125,"y":216,"width":64,"height":24,"text":"ButtonB","visibility":false,"type":"button"},{"id":"____buttonC","createTime":1674651861762,"name":"ButtonC","buttonIndex":2,"x":215,"y":216,"width":64,"height":24,"text":"ButtonC","visibility":false,"type":"button"},{"id":"2BBy1rg8XYiG2^oh","createTime":1674653244946,"isCoreTwo":false,"isPaper":false,"name":"label0","x":110,"y":17,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":4},{"id":"qmjZQ$-YjKO!D7be","createTime":1674782139917,"isCoreTwo":false,"isPaper":false,"name":"label1","x":102,"y":166,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":5},{"id":"RZod^plV*sT%ALvZ","createTime":1674783182032,"isCoreTwo":false,"isPaper":false,"name":"label2","x":198,"y":44,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":6},{"id":"5*Srql6xWGrSB1za","createTime":1674980889862,"isCoreTwo":false,"isPaper":false,"name":"label3","x":165,"y":199,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":18},{"id":"-a!-yB-x*P0cT5Ft","createTime":1674981180885,"isCoreTwo":false,"isPaper":false,"name":"label4","x":198,"y":90,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":19},{"id":"YU8At8KHCGc!DssL","createTime":1674981932152,"isCoreTwo":false,"isPaper":false,"name":"label5","x":198,"y":134,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":20},{"id":"7Ug2@g9`XPc0ZM^3","createTime":1674983951244,"isCoreTwo":false,"isPaper":false,"name":"label6","x":33,"y":44,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":10},{"id":"OQ$CUnJPpU-nKY9M","createTime":1674983953024,"isCoreTwo":false,"isPaper":false,"name":"label7","x":33,"y":90,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":11},{"id":"UU2!kEa88U6saGzm","createTime":1674983955199,"isCoreTwo":false,"isPaper":false,"name":"label8","x":33,"y":134,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":12},{"id":"+2l4wd9imWx*8jYU","createTime":1675352213438,"isCoreTwo":false,"isPaper":false,"name":"label9","x":128,"y":199,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":51},{"id":"yw%ph5GrmgI7zQrC","createTime":1675354333294,"isCoreTwo":false,"isPaper":false,"name":"label10","x":19,"y":199,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":52},{"id":"%Asj^F!2TEAWuc4R","createTime":1675355946683,"isCoreTwo":false,"isPaper":false,"name":"label11","x":96,"y":90,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":53}],"type":"fire","versions":"Beta","units":[{"id":"C2*qOAfnv1^cEKn7","createTime":1675384157183,"type":"rgb","name":"rgb_1","port":"B","default":["A","B","E","Custom"],"user_port":["21","22"],"icon":"rgb.png","new_port":"B","new_default":["A","B","E","Custom"]},{"id":"0lt&%il`EH4i4Qfu","createTime":1675384157183,"type":"pir","name":"pir_1","port":"B","default":["A","B","E","Custom"],"user_port":["21","22"],"icon":"pir.png"},{"id":"_a7JaGum+lYXvO-`","createTime":1675384157183,"type":"rfid","name":"rfid_0","port":"A","default":["A","E","PAHUB","Custom"],"pb_port":[0,1,2,3,4,5],"new_pb_port":"5","user_port":["21","22"],"icon":"rfid.png","new_port":"A","new_default":["A","E","PAHUB","Custom"]},{"id":"RyBj%bLyA#$l$q8P","createTime":1675384157183,"stickNone":"stick","type":"tof","name":"tof_3","port":"A","default":["A","E","PAHUB","Custom"],"pb_port":[0,1,2,3,4,5],"new_pb_port":"0","user_port":["21","22"],"icon":"tof.png"}],"hats":[],"blockly":"<variables><variable id=\"F}:^Ke;^*mf5:f^sT.*(\">totalprice</variable><variable id=\"2;~(f4=W0=$+H0ZgZrtH\">candyprice</variable><variable id=\"a6^$s|av[yDXfz2/v{O;\">coffeeprice</variable><variable id=\"|PmK$B)p#$.6zw|wNIuv\">priceofchocolate</variable><variable id=\"|=[ZW![WN069/heA8l#J\">no.choc</variable><variable id=\";l]0G+,Tie7+SU)d-hW}\">no.coffee</variable><variable id=\"FG}H0k((iL~qiiyfR6X7\">no.candy</variable></variables><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"270\" y=\"50\"><next><block type=\"variables_set\" id=\"!5b/7}i!uq4r|;5*o.`|\"><field name=\"VAR\" id=\"F}:^Ke;^*mf5:f^sT.*(\">totalprice</field><value name=\"VALUE\"><block type=\"math_number\" id=\"08/)Z$tK/@[A,inxfOo^\"><field name=\"NUM\">0</field></block></value><next><block type=\"label_set_mode\" id=\"Ky(8t8xR=dbtui]X2.6K\"><field name=\"COMPONENT\">label8</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\".wv:C7rhoqO~S0dM5=5a\"><field name=\"COMPONENT\">label7</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"Wtw|#-[AcJqTclO!VI,O\"><field name=\"COMPONENT\">label6</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"?A1D71,mrwnGQB:kPxj+\"><field name=\"COMPONENT\">label2</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"|iza;Nt;[b7Fi]PQGG01\"><field name=\"COMPONENT\">label4</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"dz0+YG,Pr4a=o;i=5w.Y\"><field name=\"COMPONENT\">label5</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"vg;_TkrT[lnRyUevuOT`\"><field name=\"COMPONENT\">label3</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"MFC4AR*x|aS9(|}VT~)4\"><field name=\"COMPONENT\">label9</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"-E+U0Q%wKxoV_{X9^-8)\"><field name=\"COMPONENT\">label10</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"IW7[gV:A]0*edf3yxKit\"><field name=\"COMPONENT\">label11</field><field name=\"MODE\">True</field><next><block type=\"basic_on_loop\" id=\"H+gC#eDZImV7mMIJ*g8U\"><statement name=\"LOOP\"><block type=\"controls_ifelse\" id=\"yWdMxg+%9M=}SQ7JC1U5\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"2[%1%N_Z|`J]#a9HY8KE\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"unit_tof_state\" id=\"Do-5_kGy!P,Gj@M|}-IC\"><field name=\"TOF\">tof_3</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"0EboXgJ_%h1vSC#9wft-\"><field name=\"NUM\">50</field></block></value></block></value><statement name=\"DO0\"><block type=\"label_set_mode\" id=\"Dd1|@OSDr!6x8?d/}1S/\"><field name=\"COMPONENT\">label1</field><field name=\"MODE\">False</field><next><block type=\"label_set_text\" id=\"xc!kl?S6GP#PPROT.iI3\"><field name=\"COMPONENT\">label1</field><value name=\"TEXT\"><shadow type=\"text\" id=\")?Isv;|:V$2:6g[WBZ.O\"><field name=\"TEXT\">Move your item nearer</field></shadow></value></block></next></block></statement><statement name=\"ELSE\"><block type=\"label_set_mode\" id=\"^?Lm5Ka?h^Y/r)jE9]KQ\"><field name=\"COMPONENT\">label1</field><field name=\"MODE\">True</field></block></statement><next><block type=\"controls_ifelse\" id=\"Nb{^fTinE34$R3cE@f{)\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"z_(d7_`zh(T-l8mqhn%;\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"pir_read\" id=\";1Nj5[!py8YqvQ?h;iR6\"><field name=\"VARNAME\">pir_1</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"n]TWi[F9H/|5Dh(L)GsV\"><field name=\"NUM\">0</field></block></value></block></value><statement name=\"DO0\"><block type=\"rgb_unit_set_color_all\" id=\",@s.i9}/:{T-kX:wc%,@\"><field name=\"VARNAME\">rgb_1</field><field name=\"COLOR\">#ff0000</field><next><block type=\"label_set_text\" id=\"+1jlQC+~vR2YbjUtGZ05\"><field name=\"COMPONENT\">label0</field><value name=\"TEXT\"><shadow type=\"text\" id=\"$jWgcv2(o|ih(oW2@jjz\"><field name=\"TEXT\">Please scan your item</field></shadow></value></block></next></block></statement><statement name=\"ELSE\"><block type=\"rgb_unit_set_color_all\" id=\"KFPty+$f`/z0B1_?*d!?\"><field name=\"VARNAME\">rgb_1</field><field name=\"COLOR\">#33ff33</field></block></statement><next><block type=\"controls_if\" id=\"5R,t`*v36ZwiAI/wIUG(\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"+?!L;VbWt8HIh]q.;D9I\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"rfid_uid\" id=\"kmsD)M3h[-H`:[68h!+K\"><field name=\"RFID\">rfid_0</field></block></value><value name=\"B\"><block type=\"text\" id=\"oTJ+yxBP^fosHPl(U6bm\"><field name=\"TEXT\">a230e128e</field></block></value></block></value><statement name=\"DO0\"><block type=\"label_set_text\" id=\"P1y=*ErB$ha)dgA6g`m-\"><field name=\"COMPONENT\">label6</field><value name=\"TEXT\"><shadow type=\"text\" id=\"{h3`[Z-rvg/jg[%MvMs?\"><field name=\"TEXT\">Chocolate $2</field></shadow></value><next><block type=\"speaker_tone\" id=\"ZoGtqmA.,,g(unr0jUF[\"><value name=\"FREQ\"><shadow type=\"math_number\" id=\"yBTo8wOZ?O^n%p0{dbdz\"><field name=\"NUM\">300</field></shadow></value><value name=\"TIMEOUT\"><shadow type=\"math_number\" id=\"]eRwi;J9H1IiF$@![,AY\"><field name=\"NUM\">200</field></shadow></value><next><block type=\"speaker_sing\" id=\"Pwd1G5+_Di[OZhqMz)oQ\"><field name=\"TONE\">392</field><field name=\"BEAT\">1</field><next><block type=\"speaker_vol\" id=\"+K*Z`B,LENQ(0j1r{t+{\"><value name=\"VOLUME\"><shadow type=\"math_number\" id=\"phDjf(jim500{-~K7n5J\"><field name=\"NUM\">0.5</field></shadow></value></block></next></block></next></block></next></block></statement><next><block type=\"controls_if\" id=\"X=do{|K:T(hoKv$NT!j@\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"taYAsI8dDckm/6$4i2Su\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"rfid_uid\" id=\"9/Fvhlzg/43j}07~f+!2\"><field name=\"RFID\">rfid_0</field></block></value><value name=\"B\"><block type=\"text\" id=\"#QPewY8%:]l)Ix/1P@Zt\"><field name=\"TEXT\">55402ea992</field></block></value></block></value><statement name=\"DO0\"><block type=\"label_set_text\" id=\"$H$_lsp0ug-*?kKw42(d\"><field name=\"COMPONENT\">label7</field><value name=\"TEXT\"><shadow type=\"text\" id=\"=T-XBd=f#Xv{M72hn$!V\"><field name=\"TEXT\">Candy $3</field></shadow></value><next><block type=\"speaker_tone\" id=\"vd0eRiH^me!g?^ZK9!vP\"><value name=\"FREQ\"><shadow type=\"math_number\" id=\"j,EVG=@,kP{USGRxlUz0\"><field name=\"NUM\">300</field></shadow></value><value name=\"TIMEOUT\"><shadow type=\"math_number\" id=\"m%`BaDXyx8ea:N[p,DZZ\"><field name=\"NUM\">200</field></shadow></value><next><block type=\"speaker_sing\" id=\"8F$)I60b$JHhY{pt7{XK\"><field name=\"TONE\">392</field><field name=\"BEAT\">1</field><next><block type=\"speaker_vol\" id=\"Af.MF9=mnz7EY[K4IaAC\"><value name=\"VOLUME\"><shadow type=\"math_number\" id=\"=xadyh8zpuIP4qO=jO5P\"><field name=\"NUM\">0.5</field></shadow></value></block></next></block></next></block></next></block></statement><next><block type=\"controls_if\" id=\"|E:eA;6._~,0,GgxU!EN\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"=XBn+6OQHOXV8|PTfvBY\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"rfid_uid\" id=\"}m%lfNc?)+[S!M*y^P|d\"><field name=\"RFID\">rfid_0</field></block></value><value name=\"B\"><block type=\"text\" id=\"KWm8.Ut=cT$B]9/^*+E8\"><field name=\"TEXT\">17944f18d4</field></block></value></block></value><statement name=\"DO0\"><block type=\"label_set_text\" id=\"x@u5d%3ckrK+3E5x^n,3\"><field name=\"COMPONENT\">label8</field><value name=\"TEXT\"><shadow type=\"text\" id=\"A,el$Zf;6c}XCE.%S[.A\"><field name=\"TEXT\">Coffee $4</field></shadow></value><next><block type=\"speaker_tone\" id=\"Q0=++YPLzXO1B,[z9@^k\"><value name=\"FREQ\"><shadow type=\"math_number\" id=\"Y8XM`lM-ecHgu{pd:@4T\"><field name=\"NUM\">300</field></shadow></value><value name=\"TIMEOUT\"><shadow type=\"math_number\" id=\"+ump],$Z2nt`?zk/=64L\"><field name=\"NUM\">200</field></shadow></value><next><block type=\"speaker_sing\" id=\"l6A=LygJ|54!M_EisjM9\"><field name=\"TONE\">392</field><field name=\"BEAT\">1</field><next><block type=\"speaker_vol\" id=\"dNj{G*iAz7;f`s9}aHi,\"><value name=\"VOLUME\"><shadow type=\"math_number\" id=\"F63ORs[+:$_0@-.XZid%\"><field name=\"NUM\">0.5</field></shadow></value></block></next></block></next></block></next></block></statement><next><block type=\"controls_if\" id=\"#Pq`)-A``(3T$i3^b8gI\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"x|jQ?A).kfpXi$QQgsqp\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"rfid_uid\" id=\"KN~Yk!B%k^tMRkxal5b}\"><field name=\"RFID\">rfid_0</field></block></value><value name=\"B\"><block type=\"text\" id=\"~t--C5Q$:c76u8=rYgN;\"><field name=\"TEXT\">a230e128e</field></block></value></block></value><statement name=\"DO0\"><block type=\"math_change\" id=\"|GWK_vrit+KI:`Me,4Ib\"><field name=\"VAR\" id=\"|=[ZW![WN069/heA8l#J\">no.choc</field><value name=\"DELTA\"><shadow type=\"math_number\" id=\"xFu?,}QZ6KsQpiTY|q.k\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"variables_set\" id=\"k+:p}M$i|ZR2syW,-vYS\"><field name=\"VAR\" id=\"|PmK$B)p#$.6zw|wNIuv\">priceofchocolate</field><value name=\"VALUE\"><block type=\"math_arithmetic\" id=\"Ert$l@%Fp,r92^[bAPzF\"><field name=\"OP\">MULTIPLY</field><value name=\"A\"><block type=\"variables_get\" id=\"!XKAP)Jnedms$ZrThGtM\"><field name=\"VAR\" id=\"|=[ZW![WN069/heA8l#J\">no.choc</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"^T5Rp{vdo:*o}FTNQU!S\"><field name=\"NUM\">2</field></block></value></block></value></block></next></block></statement><next><block type=\"controls_if\" id=\"jN)3h^8fN:#+*SOkmQ.s\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"l)ML%ULZ:]qcpq}UQygk\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"rfid_uid\" id=\";1#_xT**;Am.u@|`H,iZ\"><field name=\"RFID\">rfid_0</field></block></value><value name=\"B\"><block type=\"text\" id=\"%mIe7}MRKHuy`~I-W:X`\"><field name=\"TEXT\">55402ea992</field></block></value></block></value><statement name=\"DO0\"><block type=\"math_change\" id=\":FSAjagkzoBS4+wzk(.B\"><field name=\"VAR\" id=\"FG}H0k((iL~qiiyfR6X7\">no.candy</field><value name=\"DELTA\"><shadow type=\"math_number\" id=\"io39r7X9itQb8Le#EZI*\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"variables_set\" id=\"Sda1-_UlZ,MZn=iR2jL3\"><field name=\"VAR\" id=\"2;~(f4=W0=$+H0ZgZrtH\">candyprice</field><value name=\"VALUE\"><block type=\"math_arithmetic\" id=\")A6/Y,-d;a=W1$Na9ZUP\"><field name=\"OP\">MULTIPLY</field><value name=\"A\"><block type=\"variables_get\" id=\"Bq!mIUKHJ;YcJRrizVwB\"><field name=\"VAR\" id=\"FG}H0k((iL~qiiyfR6X7\">no.candy</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"y2-}Ip`pN]N|JV?n~)m#\"><field name=\"NUM\">3</field></block></value></block></value></block></next></block></statement><next><block type=\"controls_if\" id=\"x5sY:~O4dpP!%;AL@lU1\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"ZR|Q@ngno6fApE]{%KI(\"><field name=\"OP\">EQ</field><value name=\"A\"><block type=\"rfid_uid\" id=\"O1I[+D.1d_px3k3Iq;UI\"><field name=\"RFID\">rfid_0</field></block></value><value name=\"B\"><block type=\"text\" id=\"x)P#s!n%*dv}zps]C/+m\"><field name=\"TEXT\">17944f18d4</field></block></value></block></value><statement name=\"DO0\"><block type=\"math_change\" id=\"|([3`-,`}4=2QJQX]HWK\"><field name=\"VAR\" id=\";l]0G+,Tie7+SU)d-hW}\">no.coffee</field><value name=\"DELTA\"><shadow type=\"math_number\" id=\"{eidp_}45|;?s7%*YE3f\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"variables_set\" id=\"_=MdDnH;+Ks=.(0iAWHX\"><field name=\"VAR\" id=\"a6^$s|av[yDXfz2/v{O;\">coffeeprice</field><value name=\"VALUE\"><block type=\"math_arithmetic\" id=\"@/P8^3Jwgv*Pb{x^t(Hb\"><field name=\"OP\">MULTIPLY</field><value name=\"A\"><block type=\"variables_get\" id=\"7oXM6SY/raNT,2};P2:,\"><field name=\"VAR\" id=\";l]0G+,Tie7+SU)d-hW}\">no.coffee</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"jB{Y}LP#{fjWL.%m*`%g\"><field name=\"NUM\">4</field></block></value></block></value></block></next></block></statement><next><block type=\"label_set_text\" id=\"7H0m)0w6Qvg98p.Kr(eM\"><field name=\"COMPONENT\">label2</field><value name=\"TEXT\"><shadow type=\"text\" id=\"D:Pz|Hc-S6h]wC(fT[I8\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"variables_get\" id=\"_{D$!6TW0kXKX$Cx$JUj\"><field name=\"VAR\" id=\"|=[ZW![WN069/heA8l#J\">no.choc</field></block></value><next><block type=\"label_set_text\" id=\"P}:EX3uIBIR){uKkf`zr\"><field name=\"COMPONENT\">label4</field><value name=\"TEXT\"><shadow type=\"text\" id=\"gee-pfpV0#]9P9JS_kab\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"variables_get\" id=\"U1L0K-|XVP7GV:WEf;|G\"><field name=\"VAR\" id=\"FG}H0k((iL~qiiyfR6X7\">no.candy</field></block></value><next><block type=\"label_set_text\" id=\"3:AH7J3IjQNe;X`-aNJ^\"><field name=\"COMPONENT\">label5</field><value name=\"TEXT\"><shadow type=\"text\" id=\"!`IUgv)q$MrI6b:9BpFS\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"variables_get\" id=\"d-C:)XUW_f9;_J75B!q/\"><field name=\"VAR\" id=\";l]0G+,Tie7+SU)d-hW}\">no.coffee</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block><block type=\"button_callback\" id=\"(C6Jg;bGRY{4jU]qXI8@\" x=\"750\" y=\"70\"><field name=\"BUTTON\">A</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"variables_set\" id=\"^2Yu89coch7OwjaU$Go,\"><field name=\"VAR\" id=\"F}:^Ke;^*mf5:f^sT.*(\">totalprice</field><value name=\"VALUE\"><block type=\"math_number\" id=\"3z-VZ9|y#taN)^6l77[r\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set\" id=\"0(b[hBxesb=M@usHTGLT\"><field name=\"VAR\" id=\"2;~(f4=W0=$+H0ZgZrtH\">candyprice</field><value name=\"VALUE\"><block type=\"math_number\" id=\"*FZ.?{X-33XI#R%Y,U2o\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set\" id=\"{3boHj^KXRA#2:?ywI}e\"><field name=\"VAR\" id=\"a6^$s|av[yDXfz2/v{O;\">coffeeprice</field><value name=\"VALUE\"><block type=\"math_number\" id=\"9rmr?kRKJP4yn|jD*W=x\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set\" id=\".vu7uj*#X+.DTBWc-kjx\"><field name=\"VAR\" id=\"|PmK$B)p#$.6zw|wNIuv\">priceofchocolate</field><value name=\"VALUE\"><block type=\"math_number\" id=\"Q:S+9Bx,N(,IJd,skwwb\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set\" id=\"LTd{bMA_MAI}H:DCn6WB\"><field name=\"VAR\" id=\"|=[ZW![WN069/heA8l#J\">no.choc</field><value name=\"VALUE\"><block type=\"math_number\" id=\"[gOq5A=(:{|I$g].xz,+\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set\" id=\"CWZgcp.0yso*qc%,aif^\"><field name=\"VAR\" id=\";l]0G+,Tie7+SU)d-hW}\">no.coffee</field><value name=\"VALUE\"><block type=\"math_number\" id=\"*s/[mvWmhZH)ZlP9q~?N\"><field name=\"NUM\">0</field></block></value><next><block type=\"variables_set\" id=\"[:bztGwl#Ivf~,i/AMpK\"><field name=\"VAR\" id=\"FG}H0k((iL~qiiyfR6X7\">no.candy</field><value name=\"VALUE\"><block type=\"math_number\" id=\".aH)wAX+SMO$M^Xe;J$e\"><field name=\"NUM\">0</field></block></value><next><block type=\"label_set_text\" id=\"[OLWAU!(/m^rZECya+;c\"><field name=\"COMPONENT\">label9</field><value name=\"TEXT\"><shadow type=\"text\" id=\"m-V^%^}X_N0{T3Fh/bIj\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"variables_get\" id=\"z@[UVu5gRDZ4GE-yr,MP\"><field name=\"VAR\" id=\"F}:^Ke;^*mf5:f^sT.*(\">totalprice</field></block></value><next><block type=\"label_set_mode\" id=\"F_Vi)z@^ASHi]=K*Yi1P\"><field name=\"COMPONENT\">label3</field><field name=\"MODE\">True</field></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type=\"button_callback\" id=\"i)1,66W+P@w+x{.O,9n!\" x=\"750\" y=\"390\"><field name=\"BUTTON\">B</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"math_change\" id=\"ko=H:n8pb~R?kQ{mDolt\"><field name=\"VAR\" id=\"F}:^Ke;^*mf5:f^sT.*(\">totalprice</field><value name=\"DELTA\"><shadow type=\"math_number\" id=\"ZJf[{CiP/JpuWyc6kY^P\"><field name=\"NUM\">1</field></shadow><block type=\"math_arithmetic_arr\" id=\"+nC*B`lU?,8JaodqLSED\"><mutation items=\"1\"></mutation><field name=\"OP\">ADD</field><field name=\"OPERATOR0\">ADD</field><value name=\"A\"><block type=\"variables_get\" id=\"|B`Wlxeom!z6.Lr?w]4e\"><field name=\"VAR\" id=\"|PmK$B)p#$.6zw|wNIuv\">priceofchocolate</field></block></value><value name=\"B\"><block type=\"variables_get\" id=\"#Q3I*TfVkwD_@319!XKK\"><field name=\"VAR\" id=\"2;~(f4=W0=$+H0ZgZrtH\">candyprice</field></block></value><value name=\"NUMBER_TO_CHECK0\"><block type=\"variables_get\" id=\"rOCi_#4K%Xk^A*J0E4Y]\"><field name=\"VAR\" id=\"a6^$s|av[yDXfz2/v{O;\">coffeeprice</field></block></value></block></value><next><block type=\"label_set_text\" id=\"CnIS?5xx!cB?eP$bcjor\"><field name=\"COMPONENT\">label10</field><value name=\"TEXT\"><shadow type=\"text\" id=\"vtrgR|72?+%Q(;C)N/zW\"><field name=\"TEXT\">Total Price</field></shadow></value><next><block type=\"label_set_text\" id=\"!dfRo,FgYsJyZfJbN]93\"><field name=\"COMPONENT\">label3</field><value name=\"TEXT\"><shadow type=\"text\" id=\"vtL9GSiI${m{QFjtCKxA\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"variables_get\" id=\"%1cXI~]nSUH$G+)^Z8ls\"><field name=\"VAR\" id=\"F}:^Ke;^*mf5:f^sT.*(\">totalprice</field></block></value></block></next></block></next></block></statement></block><block type=\"button_callback\" id=\"p#28-gklW3@.j.n.N]^?\" x=\"750\" y=\"570\"><field name=\"BUTTON\">C</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"label_set_mode\" id=\"mB.;pq,?Pv;9oAt_IRP0\"><field name=\"COMPONENT\">label0</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"%0QV^w]05Jb0iw-Ivtqm\"><field name=\"COMPONENT\">label1</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"L7t^^,?gN}.(goz5`V:x\"><field name=\"COMPONENT\">label2</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"nb.:68pa|34g:}ZpE=U2\"><field name=\"COMPONENT\">label3</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"/7~g5jvb%Zh0.%sbs$[%\"><field name=\"COMPONENT\">label4</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"sY]-)]/CAss$WW_N1g%Z\"><field name=\"COMPONENT\">label5</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"+vU%QjfVrs|b.[bg=}oC\"><field name=\"COMPONENT\">label6</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"Nh?/8xV;3S?(gG?J;:4y\"><field name=\"COMPONENT\">label7</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"vv{0.W~T4-obN6K+PVdq\"><field name=\"COMPONENT\">label8</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"){LnBNcJfDm7B3vE6;-c\"><field name=\"COMPONENT\">label9</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"wi@nOt.}UAii9!v1IC%,\"><field name=\"COMPONENT\">label10</field><field name=\"MODE\">True</field><next><block type=\"label_set_text\" id=\"L`P6s7.M2Kuh/YQgsrpM\"><field name=\"COMPONENT\">label11</field><value name=\"TEXT\"><shadow type=\"text\" id=\"zZfxoU+M#5FN_UK+RY(O\"><field name=\"TEXT\">Proceed to Payment</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block>","Blockly.Remotes":[],"Blockly.RemotePlus":[{"id":"__title","blockId":"","createTime":1675384157183,"name":"M5RemoteTitle","dragAndDrop":false,"resizable":false,"options":{"minWidth":1,"minHeight":1,"maxWidth":6,"maxHeight":10,"defaultWidth":2,"defaultHeight":1},"w":2,"h":1,"bgColor":"#0080FF","color":"#fff","fontsize":"M","label":"M5Remote","interval":3000,"code":"","event":"","dataSource":"none","ezdataToken":"","topic":"","needShadow":false,"type":"title","x":0,"y":0}],"modules":[],"cbIdList_":[],"eventCBIdList_":[]}

Payment Code

Python
Shoppers will need to scan their card for payment once they had check out their items.
{"components":[{"id":"____screen","createTime":1675354128223,"name":"screen","x":0,"y":0,"width":320,"height":240,"backgroundColor":"#000000","backgroundImage":"","type":"screen"},{"id":"____buttonA","createTime":1675354128223,"name":"ButtonA","buttonIndex":0,"x":35,"y":216,"width":64,"height":24,"text":"ButtonA","visibility":false,"type":"button"},{"id":"____buttonB","createTime":1675354128223,"name":"ButtonB","buttonIndex":1,"x":125,"y":216,"width":64,"height":24,"text":"ButtonB","visibility":false,"type":"button"},{"id":"____buttonC","createTime":1675354128223,"name":"ButtonC","buttonIndex":2,"x":215,"y":216,"width":64,"height":24,"text":"ButtonC","visibility":false,"type":"button"},{"id":"eYwGbD`6n4yS5yyv","createTime":1675354155235,"isCoreTwo":false,"isPaper":false,"name":"label0","x":25,"y":78,"color":"#ffffff","text":"Please Scan Your Card","font":"lcd.FONT_DejaVu24","rotation":0,"type":"label","layer":4},{"id":"RIziMha#_D9KX*w7","createTime":1675354232960,"isCoreTwo":false,"isPaper":false,"name":"label3","x":34,"y":107,"color":"#ffffff","text":"Payment successful","font":"lcd.FONT_DejaVu24","rotation":0,"type":"label","layer":6}],"type":"fire","versions":"Beta","units":[{"id":"YB03t&Tch2$!nhMJ","createTime":1675386403546,"type":"rfid","name":"rfid0","port":"A","default":["A","E","PAHUB","Custom"],"pb_port":[0,1,2,3,4,5],"new_pb_port":"0","user_port":["21","22"],"icon":"rfid.png"}],"hats":[],"blockly":"<block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"50\" y=\"50\"><next><block type=\"label_set_mode\" id=\"9ymioop1NX6[sH/3`eTB\"><field name=\"COMPONENT\">label3</field><field name=\"MODE\">True</field><next><block type=\"basic_on_loop\" id=\"oN,[ng|,2sH2X}F,6TU:\"><statement name=\"LOOP\"><block type=\"controls_if\" id=\"Cy!Z/2aOg=ccIak:rbXQ\"><value name=\"IF0\"><block type=\"rfid_cardOn\" id=\"!Aw%tpi_IncyLGr6F]}7\"><field name=\"RFID\">rfid0</field></block></value><statement name=\"DO0\"><block type=\"rgb_set_all\" id=\"o!AI-Jrr+bfkl8N[aL8+\"><field name=\"COLOR\">#ff0000</field><next><block type=\"label_set_mode\" id=\"3VJgu*28:unLG+=~.0:f\"><field name=\"COMPONENT\">label0</field><field name=\"MODE\">True</field><next><block type=\"speaker_tone\" id=\"1K_i=6%cGKl3lu^7AG+?\"><value name=\"FREQ\"><shadow type=\"math_number\" id=\"9xtiVRlMV#~Pp}FC[VCF\"><field name=\"NUM\">1800</field></shadow></value><value name=\"TIMEOUT\"><shadow type=\"math_number\" id=\"}3fd!QE{?M9#g3%/mpB|\"><field name=\"NUM\">200</field></shadow></value><next><block type=\"speaker_vol\" id=\"aDN#+|i^jlV{-rdTJUJ6\"><value name=\"VOLUME\"><shadow type=\"math_number\" id=\"{CwXzac:a9/Q5{$3yEy+\"><field name=\"NUM\">0.5</field></shadow></value><next><block type=\"label_set_mode\" id=\"fM1OcA=4v=jG(sA/P$v#\"><field name=\"COMPONENT\">label3</field><field name=\"MODE\">False</field><next><block type=\"rgb_set_all\" id=\"2LOot9]5NlPyb/I[rs.E\"><field name=\"COLOR\">#000000</field></block></next></block></next></block></next></block></next></block></next></block></statement></block></statement></block></next></block></next></block>","Blockly.Remotes":[],"Blockly.RemotePlus":[{"id":"__title","blockId":"","createTime":1675386403546,"name":"M5RemoteTitle","dragAndDrop":false,"resizable":false,"options":{"minWidth":1,"minHeight":1,"maxWidth":6,"maxHeight":10,"defaultWidth":2,"defaultHeight":1},"w":2,"h":1,"bgColor":"#0080FF","color":"#fff","fontsize":"M","label":"M5Remote","interval":3000,"code":"","event":"","dataSource":"none","ezdataToken":"","topic":"","needShadow":false,"type":"title","x":null,"y":null}],"modules":["rgb"],"cbIdList_":[],"eventCBIdList_":[]}

Credits

kxkx

kxkx

1 project • 2 followers
YJ Mock

YJ Mock

1 project • 2 followers
hong

hong

0 projects • 1 follower
Chin Zhi Rong

Chin Zhi Rong

0 projects • 0 followers

Comments