SiddharthPaul Vincent Reosura TubaoTam Wei Xuan (NYP)Gabriel Wong-NYPDamien Ong (NYP)
Published © GPL3+

Project Plantae Irrigation

Our project minimises manual labour, create solutions to reduce infestation of weeds/pests in crops and predicts harsh weather conditions.

IntermediateFull instructions provided12 hours295
Project Plantae Irrigation

Things used in this project

Story

Read more

Schematics

Circuit Diagram(Earth Sensor)

Circuit Diagram (ENV II)

Circuit Diagram (Light Sensor)

Block Diagram

Code

Project Earth sensor.m5f

Python
{"components":[{"id":"____screen","createTime":1674184401755,"name":"screen","x":0,"y":0,"width":320,"height":240,"backgroundColor":"#222222","backgroundImage":"","type":"screen"},{"id":"____buttonA","createTime":1674184401755,"name":"ButtonA","buttonIndex":0,"x":35,"y":216,"width":64,"height":24,"text":"ButtonA","visibility":false,"type":"button"},{"id":"____buttonB","createTime":1674184401755,"name":"ButtonB","buttonIndex":1,"x":125,"y":216,"width":64,"height":24,"text":"ButtonB","visibility":false,"type":"button"},{"id":"____buttonC","createTime":1674184401755,"name":"ButtonC","buttonIndex":2,"x":215,"y":216,"width":64,"height":24,"text":"ButtonC","visibility":false,"type":"button"},{"id":"=CdKxz=1AJ!wzZn-","createTime":1674184483056,"isCoreTwo":false,"isPaper":false,"name":"Value","x":220,"y":206,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":4},{"id":"!%MD*v7ytNycJAlR","createTime":1675249135977,"isCoreTwo":false,"name":"line0","x":2,"y":35,"x1":2,"y1":35,"x2":320,"y2":35,"width":50,"color":"#FFFFFF","lineWidth":1,"type":"line","layer":11},{"id":"yxjfCM!OZYf8+eq+","createTime":1675249383122,"isCoreTwo":false,"isPaper":false,"name":"Moisturelabel","x":16,"y":206,"color":"#8380de","text":"Moisture Level :","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":15},{"id":"U7Y8`apyThkRuk-i","createTime":1675249383122,"isCoreTwo":false,"isPaper":false,"name":"Header","x":78,"y":9,"color":"#fff5f5","text":"Moisture Sensor","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":16},{"id":"NY80MiHKxS&4X^EG","createTime":1675250102205,"isCoreTwo":false,"isPaper":false,"name":"watering","x":50,"y":50,"color":"#27c2e2","text":"Watering. Please wait","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":21},{"id":"taCWI8$e181e^yD$","createTime":1675250194159,"isCoreTwo":false,"isPaper":false,"name":"Sign","x":74,"y":50,"color":"#7cff52","text":"Moisture is Good","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":22},{"id":"S92nZ*&A&bO-w^aL","createTime":1675250309090,"isCoreTwo":false,"isPaper":false,"name":"warning","x":57,"y":51,"color":"#f11111","text":"Moisture level is dry","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":24},{"id":"4Pt7NTg4YHKVM081","createTime":1675357342820,"isCoreTwo":false,"isPaper":false,"name":"HighMosit","x":38,"y":52,"color":"#ff0000","text":"Moisture Level is too high","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":22},{"id":"a435k0xQa^lhvT@y","createTime":1675393667496,"isCoreTwo":false,"isPaper":false,"name":"minlevel","x":219,"y":162,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":20},{"id":"E6`zOX*KABZ8ulEo","createTime":1675393979403,"isCoreTwo":false,"isPaper":false,"name":"label1","x":68,"y":162,"color":"#50c990","text":"Min Level :","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":21},{"id":"HPKsLpQ%mAQ%4NAm","createTime":1675394418668,"isCoreTwo":false,"isPaper":false,"name":"ma","x":62,"y":124,"color":"#d75b5b","text":"Max Level :","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":14},{"id":"iAJowsd6!#&^JM89","createTime":1675394456048,"isCoreTwo":false,"isPaper":false,"name":"maxlevel","x":219,"y":124,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":15},{"id":"3rOUs%r%ZzRXvtnJ","createTime":1675837100883,"isCoreTwo":false,"isPaper":false,"name":"Start","x":50,"y":86,"color":"#1eb5dd","text":"Press Button C to Start","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":16,"width":null,"height":null,"radius":null}],"type":"core","versions":"Beta","units":[{"id":"1GPm-NW7`_3&HeuH","createTime":1675836886250,"type":"servo","name":"servo_0","port":"A","default":["A","B","C","E","Custom"],"user_port":["21","22"],"icon":"servo.png"},{"id":"yoUFa6h%VCmqC-gL","createTime":1675836886250,"stickType":"stick","type":"earth","name":"earth_0","port":"B","default":["B","D","Custom"],"user_port":["","22"],"icon":"earth.png"}],"hats":[],"blockly":"<variables><variable id=\"vD}Av}J_FobadE7N!(`L\">x</variable><variable id=\"Z5p-p^GVG0_)D4::tCH5\">max</variable><variable id=\"9BS93A+V-os,d}DtRYMp\">Rotation1</variable></variables><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"80\" y=\"103\"><next><block type=\"label_set_mode\" id=\"de-H/+~0z1.y{XZEx8p;\"><field name=\"COMPONENT\">Value</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"JbH2`{q3%l94{3%W6wr.\"><field name=\"COMPONENT\">watering</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"2*c3{gJ4dRof5xY%TBA(\"><field name=\"COMPONENT\">warning</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"rCwCQpx.2*XW7zT^P^E/\"><field name=\"COMPONENT\">HighMosit</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"|Ric*{6HO-d++qe-K,))\"><field name=\"COMPONENT\">Sign</field><field name=\"MODE\">True</field><next><block type=\"servo_unit_write_us\" id=\"`Xd,5*,r7894HAjaWJZN\"><field name=\"VARNAME\">servo_0</field><value name=\"TIME\"><shadow type=\"math_number\" id=\"856P)IpAi9QV7/-Jje?S\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"variables_set\" id=\"VUa=]HxC}w1~o~wxnvsf\"><field name=\"VAR\" id=\"vD}Av}J_FobadE7N!(`L\">x</field><value name=\"VALUE\"><block type=\"math_number\" id=\"pG6NhAphgSDC,3|RnWk?\"><field name=\"NUM\">200</field></block></value><next><block type=\"variables_set\" id=\"N47WPBGMreLEA!U}bJH{\"><field name=\"VAR\" id=\"Z5p-p^GVG0_)D4::tCH5\">max</field><value name=\"VALUE\"><block type=\"math_number\" id=\"{~e[$pC_vC{:|Ii4YH7.\"><field name=\"NUM\">500</field></block></value><next><block type=\"basic_on_loop\" id=\"I7:2/Ph?$?yn^Od]Phs^\"><statement name=\"LOOP\"><block type=\"label_set_text\" id=\"O}L^4||/YG^@T^)Y}sj1\"><field name=\"COMPONENT\">maxlevel</field><value name=\"TEXT\"><shadow type=\"text\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"variables_get\" id=\"[?/CE~HwIhvT]e:Gyea,\"><field name=\"VAR\" id=\"Z5p-p^GVG0_)D4::tCH5\">max</field></block></value><next><block type=\"label_set_text\" id=\"7CyU:P6WK+AgX*u/P#X=\"><field name=\"COMPONENT\">minlevel</field><value name=\"TEXT\"><shadow type=\"text\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"variables_get\" id=\"y:P2r^Tu5io3M@wJ!qwm\"><field name=\"VAR\" id=\"vD}Av}J_FobadE7N!(`L\">x</field></block></value></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block><block type=\"button_callback\" id=\"w@^2^V8,]LL?qZ`~]?rM\" x=\"450\" y=\"90\"><field name=\"BUTTON\">A</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"math_change\" id=\"U-(s{c{,%3QD=6C%#IN]\"><field name=\"VAR\" id=\"vD}Av}J_FobadE7N!(`L\">x</field><value name=\"DELTA\"><shadow type=\"math_number\" id=\"I35[|]mE@8ut+90;Y8}!\"><field name=\"NUM\">10</field></shadow></value></block></statement></block><block type=\"button_callback\" id=\"(TB/R?^{x`yJTePVzdbZ\" x=\"490\" y=\"190\"><field name=\"BUTTON\">A</field><field name=\"EVENT\">wasDoublePress</field><statement name=\"FUNC\"><block type=\"math_change\" id=\"tKVw]%/-r/%9VG2eT=ne\"><field name=\"VAR\" id=\"vD}Av}J_FobadE7N!(`L\">x</field><value name=\"DELTA\"><shadow type=\"math_number\" id=\"AJnI::yqZ=Wc[VWC)uBn\"><field name=\"NUM\">-10</field></shadow></value></block></statement></block><block type=\"button_callback\" id=\"5dD6Fk09_$dRj=p{jH8h\" x=\"510\" y=\"290\"><field name=\"BUTTON\">B</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"math_change\" id=\"O+KJFp%YhDfb7tEluu;d\"><field name=\"VAR\" id=\"Z5p-p^GVG0_)D4::tCH5\">max</field><value name=\"DELTA\"><shadow type=\"math_number\" id=\"%Q:+`O-U4s%k2X/80~1i\"><field name=\"NUM\">10</field></shadow></value></block></statement></block><block type=\"button_callback\" id=\"@Qo+02e+dGz=iNgL:WBP\" x=\"530\" y=\"390\"><field name=\"BUTTON\">B</field><field name=\"EVENT\">wasDoublePress</field><statement name=\"FUNC\"><block type=\"math_change\" id=\"dwr88OK!L+@m)d-8zTQ2\"><field name=\"VAR\" id=\"Z5p-p^GVG0_)D4::tCH5\">max</field><value name=\"DELTA\"><shadow type=\"math_number\" id=\"J{j%{i{XDGVC3#f9+:sa\"><field name=\"NUM\">-10</field></shadow></value></block></statement></block><block type=\"button_callback\" id=\"cx8-kE:.6$NA`GqO(`%,\" x=\"70\" y=\"490\"><field name=\"BUTTON\">C</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"label_set_mode\" id=\"4]WgIMBR{OE|8.1h%!W;\"><field name=\"COMPONENT\">Start</field><field name=\"MODE\">True</field><next><block type=\"basic_on_loop\" id=\"PlnOg^Ea1bFE5JpH`n`5\"><statement name=\"LOOP\"><block type=\"label_set_text\" id=\"Q-cO[A~:_AG-]tw4GYm*\"><field name=\"COMPONENT\">Value</field><value name=\"TEXT\"><shadow type=\"text\" id=\"tU`SUe3dpJ$1@EWd?jZr\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"earth_a_read\" id=\"7#w#E5zqkBRT`}+I-x{~\"><field name=\"VARNAME\">earth_0</field></block></value><next><block type=\"variables_set\" id=\"g7vVOsA#1tBWWu-CZS#/\"><field name=\"VAR\" id=\"9BS93A+V-os,d}DtRYMp\">Rotation1</field><value name=\"VALUE\"><block type=\"math_number\" id=\"|tbA=a!Q(w;VyG@Wq[KY\"><field name=\"NUM\">0</field></block></value><next><block type=\"label_set_mode\" id=\"{Z~X]$?]nRz6^qWLEi`4\"><field name=\"COMPONENT\">Sign</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"`DwEhX:++SI],,+SgiOE\"><field name=\"COMPONENT\">warning</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"6mF(4xg0:X6L,0pEX|$O\"><field name=\"COMPONENT\">watering</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"-3QuAF*F?(D;jY9I,/T?\"><field name=\"COMPONENT\">HighMosit</field><field name=\"MODE\">True</field><next><block type=\"controls_if\" id=\"xDcd|7~}%OAM!oLM;dqA\"><mutation elseif=\"1\" else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"5D}{T|Xa0^6n1G~HtWns\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"earth_a_read\" id=\"6ZE#;MeBN4RA3hs!OxLK\"><field name=\"VARNAME\">earth_0</field></block></value><value name=\"B\"><block type=\"variables_get\" id=\"q4p(pwi)o1uKj:+Sy=+O\"><field name=\"VAR\" id=\"vD}Av}J_FobadE7N!(`L\">x</field></block></value></block></value><statement name=\"DO0\"><block type=\"rgb_set_all\" id=\"rN:[]#Cz#AH`~s7./+]j\"><field name=\"COLOR\">#ff0000</field><next><block type=\"label_set_mode\" id=\"NebclEtI=,.fW+xDH8yw\"><field name=\"COMPONENT\">Sign</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"OUvQHmA|ph/m}@YSJs1`\"><field name=\"COMPONENT\">watering</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"w?/a9Bdm}_D/8~G=/G0(\"><field name=\"COMPONENT\">warning</field><field name=\"MODE\">False</field><next><block type=\"timer_delay\" id=\"gSJUx|vA4E6SlN82ptb;\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"Pl+xUx}H39S-d#mE9VV|\"><field name=\"NUM\">2</field></shadow></value><next><block type=\"label_set_mode\" id=\"nWUo,(HVk;fC*NCBI!V1\"><field name=\"COMPONENT\">warning</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"cqUta8}uL}RZ^b/Q[AZ{\"><field name=\"COMPONENT\">watering</field><field name=\"MODE\">False</field><next><block type=\"servo_unit_write_angle\" id=\"2yIKzaGq:qEg(qbhI?Q:\"><field name=\"VARNAME\">servo_0</field><value name=\"ANGLE\"><shadow type=\"math_number\" id=\"eantrXgxU7?#M;f0TwTS\"><field name=\"NUM\">0</field></shadow><block type=\"variables_get\" id=\"aBvJI$UdOsaDw{XU+C+O\"><field name=\"VAR\" id=\"9BS93A+V-os,d}DtRYMp\">Rotation1</field></block></value><next><block type=\"timer_delay\" id=\"vTLyMh|T+7+XWb(tQF`L\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"dsHL$vu.D*pEMt~~B|L^\"><field name=\"NUM\">5</field></shadow></value><next><block type=\"label_set_mode\" id=\"vco]%E|9ev^,hE@#asD6\"><field name=\"COMPONENT\">watering</field><field name=\"MODE\">True</field><next><block type=\"servo_unit_write_angle\" id=\"vEleLSI2W8P-vV0ZADE:\"><field name=\"VARNAME\">servo_0</field><value name=\"ANGLE\"><shadow type=\"math_number\" id=\"wmO[y0_7(i8N`4axfpXA\"><field name=\"NUM\">180</field></shadow></value><next><block type=\"timer_delay\" id=\"[8l/fl@{1yk+Yxmd7v{)\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"83yKJ$(iwaE[)U)C.$N]\"><field name=\"NUM\">2</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><value name=\"IF1\"><block type=\"logic_compare\" id=\"bvvN;0?Ni$W*$B7*j)J_\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"earth_a_read\" id=\"2z4@xs^txU6Mw98Z=0ab\"><field name=\"VARNAME\">earth_0</field></block></value><value name=\"B\"><block type=\"variables_get\" id=\"SY9!s9MNE~R.Gi-SxQEu\"><field name=\"VAR\" id=\"Z5p-p^GVG0_)D4::tCH5\">max</field></block></value></block></value><statement name=\"DO1\"><block type=\"rgb_set_all\" id=\"0zHAGYB)8GIyIu+1AW(.\"><field name=\"COLOR\">#ff0000</field><next><block type=\"label_set_mode\" id=\";YvJv-PykJy7md,k(|%J\"><field name=\"COMPONENT\">HighMosit</field><field name=\"MODE\">False</field><next><block type=\"servo_unit_write_angle\" id=\"tono!vu}$h?P~hRB5[Si\"><field name=\"VARNAME\">servo_0</field><value name=\"ANGLE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"variables_get\" id=\"PCwAqH|~?~5rj.1UK)WW\"><field name=\"VAR\" id=\"9BS93A+V-os,d}DtRYMp\">Rotation1</field></block></value><next><block type=\"timer_delay\" id=\"xPR50oMEc:ik;GX{5[gT\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\".vm41kV?hc])/Kr5lZ(F\"><field name=\"NUM\">5</field></shadow></value><next><block type=\"servo_unit_write_angle\" id=\"cZojC6UnW?$RiFYrX,p%\"><field name=\"VARNAME\">servo_0</field><value name=\"ANGLE\"><shadow type=\"math_number\" id=\"Vbm{c`!;X_@!-ww^crER\"><field name=\"NUM\">90</field></shadow></value><next><block type=\"timer_delay\" id=\"CEJ|;aw$DN(ut=I!I-)q\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"of.9RC=?w#kefI$_7t+5\"><field name=\"NUM\">2</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></statement><statement name=\"ELSE\"><block type=\"rgb_set_all\" id=\"N:*/3l2bGi)C3$6tfs$_\"><field name=\"COLOR\">#66ff99</field><next><block type=\"label_set_mode\" id=\"wQL+WbSJ:*!+xX2k:B_m\"><field name=\"COMPONENT\">watering</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"Bu{IXZ#0LIKp|n9t77q:\"><field name=\"COMPONENT\">warning</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"1=WE$NZ[!-*{1hpF{8!}\"><field name=\"COMPONENT\">Sign</field><field name=\"MODE\">False</field><next><block type=\"servo_unit_write_angle\" id=\"q/!/iS7w}1lttxf0VDM=\"><field name=\"VARNAME\">servo_0</field><value name=\"ANGLE\"><shadow type=\"math_number\" id=\"w=e=!N:u,(`.kgM$@qkc\"><field name=\"NUM\">90</field></shadow></value><next><block type=\"timer_delay\" id=\"J3NxW7)GZp}T!m-DndY1\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"MvQpZJJ,O2Zz~YQi4rfb\"><field name=\"NUM\">2</field></shadow></value></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></statement></block></next></block></statement></block>","Blockly.Remotes":[],"Blockly.RemotePlus":[{"id":"__title","blockId":"","createTime":1675836886250,"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":["rgb"],"cbIdList_":[],"eventCBIdList_":[]}

Project ENV.m5f

Python
{"components":[{"id":"____screen","createTime":1674793168744,"name":"screen","x":0,"y":0,"width":320,"height":240,"backgroundColor":"#222222","backgroundImage":"","type":"screen"},{"id":"____buttonA","createTime":1674793168744,"name":"ButtonA","buttonIndex":0,"x":35,"y":216,"width":64,"height":24,"text":"ButtonA","visibility":false,"type":"button"},{"id":"____buttonB","createTime":1674793168744,"name":"ButtonB","buttonIndex":1,"x":125,"y":216,"width":64,"height":24,"text":"ButtonB","visibility":false,"type":"button"},{"id":"____buttonC","createTime":1674793168744,"name":"ButtonC","buttonIndex":2,"x":215,"y":216,"width":64,"height":24,"text":"ButtonC","visibility":false,"type":"button"},{"id":"nS`seOGhKJw=h+M2","createTime":1674793214098,"isCoreTwo":false,"isPaper":false,"name":"HumidityValue","x":246,"y":163,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":5},{"id":"Gbde&MO`bZQa+3#h","createTime":1674793215932,"isCoreTwo":false,"isPaper":false,"name":"TemperatureValue","x":245,"y":204,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":6},{"id":"zKG89_axm=U6bT0r","createTime":1675314392235,"isCoreTwo":false,"isPaper":false,"name":"Humidityheder","x":54,"y":163,"color":"#0bc1ff","text":"Humidity Level :","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":49},{"id":"D!p1jyF!S$xt4S4=","createTime":1675314496405,"isCoreTwo":false,"isPaper":false,"name":"TemperatureHeader","x":18,"y":199,"color":"#f3f000","text":"Temperature Level :","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":51},{"id":"qzDmYyuYGuctMMW1","createTime":1675314592736,"isCoreTwo":false,"name":"line0","x":1,"y":48,"x1":1,"y1":48,"x2":320,"y2":48,"width":50,"color":"#FFFFFF","lineWidth":1,"type":"line","layer":52},{"id":"v-9YE2b&^WyGBKzv","createTime":1675314605137,"isCoreTwo":false,"isPaper":false,"name":"Header","x":59,"y":22,"color":"#FFFFFF","text":"Humidity , Pressure, Temperature","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":53},{"id":"!EfTSmwp5dirbX@f","createTime":1675837870082,"isCoreTwo":false,"isPaper":false,"name":"Guide","x":39,"y":65,"color":"#dd7979","text":"Press Button A to activate Pesticide","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":52},{"id":"UAM2*MSL!=McH%b%","createTime":1675837870082,"isCoreTwo":false,"isPaper":false,"name":"label0","x":37,"y":93,"color":"#d6ff31","text":"Press Button B for Temperature ","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":53},{"id":"g7qQ5bIs8b285n1v","createTime":1675837870082,"isCoreTwo":false,"isPaper":false,"name":"Guide2","x":37,"y":123,"color":"#31eeff","text":"Press Button C for Humidity","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":54}],"type":"core","versions":"Beta","units":[{"id":"Z6A&XUK^Hw2#TE0b","createTime":1675920904621,"hidden":false,"type":"env2","name":"env2_0","port":"A","default":["A","E","PAHUB","Custom"],"pb_port":[0,1,2,3,4,5],"new_pb_port":"0","user_port":["21","22"],"icon":"env2.png"},{"id":"+FyI!Mm!&zE@5An7","createTime":1675920904621,"type":"servo","name":"servo_0","port":"B","default":["A","B","C","E","Custom"],"user_port":["21","22"],"icon":"servo.png","new_port":"B","new_default":["A","B","C","E","Custom"]}],"hats":[],"blockly":"<block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"-190\" y=\"-230\"><next><block type=\"label_set_mode\" id=\"1vxT5^78Uq|EZ_|7f:o~\"><field name=\"COMPONENT\">HumidityValue</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"/J1D~C,iIODxu(/v^(rd\"><field name=\"COMPONENT\">TemperatureValue</field><field name=\"MODE\">True</field></block></next></block></next></block><block type=\"button_callback\" id=\"Vacw$?dk|3!V~f[.S2s!\" x=\"-350\" y=\"10\"><field name=\"BUTTON\">A</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"servo_unit_write_angle\" id=\"@a]iqnk9%7tNX2Z=[nGL\"><field name=\"VARNAME\">servo_0</field><value name=\"ANGLE\"><shadow type=\"math_number\" id=\"J,930eUo6v[hf~OQFAxZ\"><field name=\"NUM\">90</field></shadow></value><next><block type=\"timer_delay\" id=\"e8e[vN0x;mTAy1+lKdgd\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"/$Et#W$MN3~G[zQ7vm/4\"><field name=\"NUM\">3</field></shadow></value><next><block type=\"servo_unit_write_angle\" id=\"Pf_/f?2_;)$#EXvmv|$i\"><field name=\"VARNAME\">servo_0</field><value name=\"ANGLE\"><shadow type=\"math_number\" id=\"Jjbs3#s0P)tQbLOO/?0i\"><field name=\"NUM\">0</field></shadow></value></block></next></block></next></block></statement></block><block type=\"button_callback\" id=\"w+Db)I.XD0emr=RtM3?j\" x=\"150\" y=\"10\"><field name=\"BUTTON\">C</field><field name=\"EVENT\">wasDoublePress</field><statement name=\"FUNC\"><block type=\"servo_unit_write_angle\" id=\"_~O/T-S{Leh(L_M|cpMo\"><field name=\"VARNAME\">servo_0</field><value name=\"ANGLE\"><shadow type=\"math_number\" id=\"iRvj0vAR5/d.}6d5qmm^\"><field name=\"NUM\">90</field></shadow></value></block></statement></block><block type=\"button_callback\" id=\":z1EhhyafcKUItxqC+oL\" x=\"410\" y=\"150\"><field name=\"BUTTON\">C</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"servo_unit_write_angle\" id=\"X^!?$tbLQZ%,cA4Cayz@\"><field name=\"VARNAME\">servo_0</field><value name=\"ANGLE\"><shadow type=\"math_number\" id=\"Yinjt/E6)xMRV7_stne;\"><field name=\"NUM\">0</field></shadow></value><next><block type=\"label_set_mode\" id=\"EmXV0trb3Izuz`@WCnMC\"><field name=\"COMPONENT\">HumidityValue</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"14_H^w3g.i?tsAxp[.jl\"><field name=\"COMPONENT\">TemperatureValue</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"CX9B!dwi@CtmDKcPfwE!\"><field name=\"COMPONENT\">HumidityValue</field><field name=\"MODE\">False</field><next><block type=\"label_set_text\" id=\"Eo^n5IOOqHUn)H|RVuI(\"><field name=\"COMPONENT\">HumidityValue</field><value name=\"TEXT\"><shadow type=\"text\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"dht12_get_humidity\" id=\"Q{i7^25fYu`3JI~~??R5\"><field name=\"VARNAME\">env2_0</field></block></value><next><block type=\"controls_if\" id=\"Pl]:eZ5$G4DU^q,aa$.i\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"M0*Yw3J0wN!2,@;CTQZB\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"dht12_get_humidity\" id=\"l+z=HmjI;EHE/-X=5pad\"><field name=\"VARNAME\">env2_0</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"tF~|{xLU7cVc^A%0-mwx\"><field name=\"NUM\">80</field></block></value></block></value><statement name=\"DO0\"><block type=\"rgb_set_all\" id=\"c=GIgVDNX]*Ru;^KVHDO\"><field name=\"COLOR\">#ff0000</field><next><block type=\"label_set_color\" id=\"}|4NN@;EIfDvmxl_V6*~\"><field name=\"COMPONENT\">HumidityValue</field><field name=\"COLOR\">#ff0000</field><next><block type=\"speaker_tone\" id=\"m)b#kf@n6x.P3!5!^xP3\"><value name=\"FREQ\"><shadow type=\"math_number\" id=\"Eig(#rM}dI3Zxyy)V_*j\"><field name=\"NUM\">1800</field></shadow></value><value name=\"TIMEOUT\"><shadow type=\"math_number\" id=\"*B((!p!*Tl%sD1~4Y}61\"><field name=\"NUM\">200</field></shadow></value><next><block type=\"timer_delay\" id=\"If{#nzc(9AN-QnYs@#(,\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\",cr|).EuK4kbv.Q|/-!B\"><field name=\"NUM\">5</field></shadow></value></block></next></block></next></block></next></block></statement><statement name=\"ELSE\"><block type=\"label_set_color\" id=\"LU8ENfN,f^(}pmS+6lt^\"><field name=\"COMPONENT\">HumidityValue</field><field name=\"COLOR\">#33cc00</field><next><block type=\"rgb_set_all\" id=\"!^]B~b5l8TwKMwitewgv\"><field name=\"COLOR\">#33cc00</field></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type=\"button_callback\" id=\"$D!YM4(_%vTdq:!K~^ki\" x=\"-230\" y=\"250\"><field name=\"BUTTON\">B</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"label_set_mode\" id=\"PoZ98)s!qe@H06x(AfV-\"><field name=\"COMPONENT\">HumidityValue</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"X*7}aVlP|Dg7I~|eJ?n{\"><field name=\"COMPONENT\">TemperatureValue</field><field name=\"MODE\">False</field><next><block type=\"label_set_mode\" id=\"T%sT,*0HdN9DR`x%JhED\"><field name=\"COMPONENT\">HumidityValue</field><field name=\"MODE\">True</field><next><block type=\"label_set_text\" id=\"S%1@m?uvtS4is/~bDJ=Q\"><field name=\"COMPONENT\">TemperatureValue</field><value name=\"TEXT\"><shadow type=\"text\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"dht12_get_temperature\" id=\"zqPBT`uJPK2pctnVD*F9\"><field name=\"VARNAME\">env2_0</field></block></value><next><block type=\"controls_if\" id=\"h[Db*CnDd(+HwEhI8=Al\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"6:5qJKm?KbRlOW_rA^~4\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"dht12_get_temperature\" id=\"2wE97fgqKcvc:y,nYwO)\"><field name=\"VARNAME\">env2_0</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"G-rz^6eO/KIs%Rr5Bq-F\"><field name=\"NUM\">30</field></block></value></block></value><statement name=\"DO0\"><block type=\"rgb_set_all\" id=\"aokVLn@WyNky6%nsXw@3\"><field name=\"COLOR\">#ff0000</field><next><block type=\"label_set_color\" id=\"Zr}Hfx7}IO;xjuP`#]km\"><field name=\"COMPONENT\">TemperatureValue</field><field name=\"COLOR\">#ff0000</field><next><block type=\"speaker_tone\" id=\"v#^LQmNUi37`y^Wb{@Fw\"><value name=\"FREQ\"><shadow type=\"math_number\" id=\"Cj${J0UXBv;HLq!X)r)e\"><field name=\"NUM\">1500</field></shadow></value><value name=\"TIMEOUT\"><shadow type=\"math_number\" id=\"ONY-y~ffGIUsiy7^Mc6Y\"><field name=\"NUM\">200</field></shadow></value><next><block type=\"timer_delay\" id=\";-5:bVMIX01$.9RPxeyS\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"1V8~/A`!^p%cjMFj/s(D\"><field name=\"NUM\">5</field></shadow></value></block></next></block></next></block></next></block></statement><statement name=\"ELSE\"><block type=\"rgb_set_all\" id=\"elLP}k|VH`z~PH0@0gvE\"><field name=\"COLOR\">#33cc00</field><next><block type=\"label_set_color\" id=\"%nWr9P8OI#4W]ID4y)B^\"><field name=\"COMPONENT\">TemperatureValue</field><field name=\"COLOR\">#33cc00</field></block></next></block></statement></block></next></block></next></block></next></block></next></block></statement></block>","Blockly.Remotes":[],"Blockly.RemotePlus":[{"id":"__title","blockId":"","createTime":1675920904621,"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":["servo","servo2","rgb"],"cbIdList_":[],"eventCBIdList_":[]}

Project light.m5f

Python
{"components":[{"id":"____screen","createTime":1674788983675,"name":"screen","x":0,"y":0,"width":320,"height":240,"backgroundColor":"#222222","backgroundImage":"","type":"screen"},{"id":"____buttonA","createTime":1674788983675,"name":"ButtonA","buttonIndex":0,"x":35,"y":216,"width":64,"height":24,"text":"ButtonA","visibility":false,"type":"button"},{"id":"____buttonB","createTime":1674788983675,"name":"ButtonB","buttonIndex":1,"x":125,"y":216,"width":64,"height":24,"text":"ButtonB","visibility":false,"type":"button"},{"id":"____buttonC","createTime":1674788983675,"name":"ButtonC","buttonIndex":2,"x":215,"y":216,"width":64,"height":24,"text":"ButtonC","visibility":false,"type":"button"},{"id":"bFDPi0R%BSDaIob5","createTime":1674789028677,"isCoreTwo":false,"isPaper":false,"name":"Value","x":206,"y":207,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":10},{"id":"%Lke@mq&6=t`ioKi","createTime":1674789028677,"isCoreTwo":false,"isPaper":false,"name":"Valueid","x":31,"y":207,"color":"#eeff07","text":"Intensity Level:","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":55},{"id":"Mlz+2qmn`$Hf120@","createTime":1674789028677,"isCoreTwo":false,"isPaper":false,"name":"Header","x":57,"y":12,"color":"#eeff07","text":"Light Intensity Level","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":57},{"id":"1$&Y`qoZu8Uayc-u","createTime":1675254083958,"isCoreTwo":false,"name":"line0","x":5,"y":46,"x1":5,"y1":46,"x2":320,"y2":46,"width":50,"color":"#FFFFFF","lineWidth":1,"type":"line","layer":58},{"id":"8L!ek88whlsJ-uN8","createTime":1675254271280,"isCoreTwo":false,"isCoreInk":false,"isPaper":false,"name":"Warningimg","x":136,"y":96,"imagePath":"error.jpg","visibility":true,"imageInvert":false,"imageThreshold":128,"type":"image","layer":60},{"id":"X5ODE$V2PbUPu+h@","createTime":1675257635458,"isCoreTwo":false,"isPaper":false,"name":"Goo","x":78,"y":175,"color":"#19e33e","text":"Intensity Level is normal","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":64},{"id":"nx5&JD$7lIdv@aQ2","createTime":1675257674386,"isCoreTwo":false,"isPaper":false,"name":"Warning","x":68,"y":175,"color":"#ff0505","text":"Intensity level is dangerous","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":65},{"id":"^l%PTt@lS4aR%2pk","createTime":1675257711130,"isCoreTwo":false,"isPaper":false,"name":"Shade","x":108,"y":175,"color":"#70a5dc","text":"Raising Shelter","font":"lcd.FONT_Default","rotation":0,"type":"label","layer":66}],"type":"core","versions":"Beta","units":[{"id":"$4*oVek&Ys5pZN%O","createTime":1675920179412,"type":"servo","name":"servo_6","port":"A","default":["A","B","C","E","Custom"],"user_port":["21","22"],"icon":"servo.png"},{"id":"N43o!UyQ&z2uX2xI","createTime":1675920179412,"stickType":"stick","type":"light","name":"light_3","port":"B","default":["A","B","C","D","Custom"],"user_port":["21","22"],"icon":"light.png"}],"hats":[],"blockly":"<variables><variable id=\"9BS93A+V-os,d}DtRYMp\">Rotation1</variable></variables><block type=\"servo_init\" id=\"Nl~2C`,W,mH69iN`]$,2\" disabled=\"true\" x=\"-10\" y=\"-10\"><field name=\"VARNAME\">servo6</field><value name=\"PIN\"><shadow type=\"math_number\" id=\"UMRj?/@}UbnAWfGScd8^\" disabled=\"true\"><field name=\"NUM\">21</field></shadow></value><value name=\"FREQ\"><shadow type=\"math_number\" id=\"+p|+p.on:m7N!e6QZPf/\" disabled=\"true\"><field name=\"NUM\">50</field></shadow></value><value name=\"MIN_US\"><shadow type=\"math_number\" id=\"(G^g?PtUjR*S7P;IcwP_\" disabled=\"true\"><field name=\"NUM\">500</field></shadow></value><value name=\"MAX_US\"><shadow type=\"math_number\" id=\"I9ULIsN4BwA[[!fAz.~V\" disabled=\"true\"><field name=\"NUM\">2500</field></shadow></value><value name=\"ANGLE\"><shadow type=\"math_number\" id=\"k(cx@O;#o+|u(qhbq-W6\" disabled=\"true\"><field name=\"NUM\">180</field></shadow></value></block><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"50\" y=\"50\"><next><block type=\"basic_on_loop\" id=\"^hGW|)0qTyeXelJw]vfQ\"><statement name=\"LOOP\"><block type=\"label_set_text\" id=\"H.V7c!2%ZeNyNgtyJp/7\"><field name=\"COMPONENT\">Value</field><value name=\"TEXT\"><shadow type=\"text\" id=\"^t|Y_5Q];)GBgNv)[J8l\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"light_a_read\" id=\"p:FPJ8Uk,4pWgFKDp9gR\"><field name=\"VARNAME\">light_3</field></block></value><next><block type=\"variables_set\" id=\"n4Vf)0U:B;ebycVy74p_\"><field name=\"VAR\" id=\"9BS93A+V-os,d}DtRYMp\">Rotation1</field><value name=\"VALUE\"><block type=\"math_number\" id=\"n=W:4-}Z%yx)4[9g.4Q(\"><field name=\"NUM\">90</field></block></value><next><block type=\"controls_if\" id=\"To-;cq2F:0OjZ*#!p/;.\"><mutation elseif=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"9Z6UZEa!.-shBVd[~Z^W\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"light_a_read\" id=\"c].()n1J?x.Hf`T/?#3?\"><field name=\"VARNAME\">light_3</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"7u|cKquJ=0Q/fX@0uZn:\"><field name=\"NUM\">300</field></block></value></block></value><statement name=\"DO0\"><block type=\"rgb_set_all\" id=\"gT:8E5OZo(7p.uzn,,u+\"><field name=\"COLOR\">#ff0000</field><next><block type=\"label_set_color\" id=\"R_%Jw/xT.3y#k:CyJL#t\"><field name=\"COMPONENT\">Value</field><field name=\"COLOR\">#ff0000</field><next><block type=\"image_show\" id=\"M[C1E{)*RIiA}vqO=slf\"><field name=\"COMPONENT\">Warningimg</field><next><block type=\"label_set_mode\" id=\"N4FpSlzAa4X[HS2;Q?I9\"><field name=\"COMPONENT\">Goo</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"ki}Wwm?y;C/jOw6E3yW{\"><field name=\"COMPONENT\">Shade</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"*eaBE1Qjr*tw(uQvN=f:\"><field name=\"COMPONENT\">Warning</field><field name=\"MODE\">False</field><next><block type=\"timer_delay\" id=\"M%?8ss`UU+u}inwlQ:Iz\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"^cs6ykNo*H!5HP~nx$sA\"><field name=\"NUM\">2</field></shadow></value><next><block type=\"label_set_mode\" id=\"_!#+!1o[`5il[m,Uk!j%\"><field name=\"COMPONENT\">Warning</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"}X|ib)L-zhx_Eko*,^+3\"><field name=\"COMPONENT\">Shade</field><field name=\"MODE\">False</field><next><block type=\"image_hide\" id=\"E3yyL5,bO=GteEptZMs|\"><field name=\"COMPONENT\">Warningimg</field><next><block type=\"servo_unit_write_angle\" id=\"We]1x@KRfY!W[uvzKS%j\"><field name=\"VARNAME\">servo_6</field><value name=\"ANGLE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"variables_get\" id=\"_]*;wE$d9iK{/{T%n#J9\"><field name=\"VAR\" id=\"9BS93A+V-os,d}DtRYMp\">Rotation1</field></block></value><next><block type=\"timer_delay\" id=\"0Qe%wBO=-q)jcO]p:nQi\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"J{/k#t;Q#HwC)[_BHC#/\"><field name=\"NUM\">5</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><value name=\"IF1\"><block type=\"logic_compare\" id=\"qpkm}~6B9RWmA;z2=n5v\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"light_a_read\" id=\"0}nJPd@oCS}youW!~;~g\"><field name=\"VARNAME\">light_3</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"7TPA3QUn/wEVM17A#gmu\"><field name=\"NUM\">300</field></block></value></block></value><statement name=\"DO1\"><block type=\"label_set_mode\" id=\".RCrDbMun6T2RYf)f,BH\"><field name=\"COMPONENT\">Warning</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"RK@KH}5B,PdeOae;lz[]\"><field name=\"COMPONENT\">Shade</field><field name=\"MODE\">True</field><next><block type=\"label_set_mode\" id=\"!4rwTg{aAi(;Du~4_DM.\"><field name=\"COMPONENT\">Goo</field><field name=\"MODE\">False</field><next><block type=\"image_hide\" id=\"j`AeAAW*:G!qX2,-lSV~\"><field name=\"COMPONENT\">Warningimg</field><next><block type=\"servo_unit_write_angle\" id=\"[3aK#,eGT$wWYG-m)cDx\"><field name=\"VARNAME\">servo_6</field><value name=\"ANGLE\"><shadow type=\"math_number\" id=\";+rg`*s`k|~;H#cGYeRa\"><field name=\"NUM\">0</field></shadow></value><next><block type=\"rgb_set_all\" id=\"=o#u|_ab(U04*WWuimMa\"><field name=\"COLOR\">#33ff33</field><next><block type=\"label_set_color\" id=\"W}Uk93M9J`]3*iCK_atV\"><field name=\"COMPONENT\">Value</field><field name=\"COLOR\">#33ff33</field><next><block type=\"timer_delay\" id=\"vd]jT]7dGiee;[/Ur4n!\"><value name=\"DELAY\"><shadow type=\"math_number\" id=\"{EIY+:/F9u_@:.d(6iB}\"><field name=\"NUM\">5</field></shadow></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></next></block></next></block></statement></block></next></block>","Blockly.Remotes":[],"Blockly.RemotePlus":[{"id":"__title","blockId":"","createTime":1675920179412,"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":["rgb"],"cbIdList_":[],"eventCBIdList_":[]}

Credits

Siddharth
1 project • 0 followers
Contact
Paul Vincent Reosura Tubao
1 project • 0 followers
Contact
Tam Wei Xuan (NYP)
1 project • 0 followers
Contact
Gabriel Wong-NYP
1 project • 0 followers
Contact
Damien Ong (NYP)
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.