Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
half dollarAnwaruddin MohammedJeremyAngTIMBAKER2343
Published

M5Stack heal

Encourage user to drink water

BeginnerProtip274
M5Stack heal

Things used in this project

Story

Read more

Schematics

circuit_daigram_DPKKBcPUOS.jpeg

Code

project.m5f

Python
{"components":[{"id":"____screen","createTime":1705455970496,"name":"screen","x":0,"y":0,"width":320,"height":240,"backgroundColor":"#222222","backgroundImage":"","type":"screen"},{"id":"____buttonA","createTime":1705455970497,"name":"ButtonA","buttonIndex":0,"x":35,"y":216,"width":64,"height":24,"text":"ButtonA","visibility":false,"type":"button"},{"id":"____buttonB","createTime":1705455970497,"name":"ButtonB","buttonIndex":1,"x":125,"y":216,"width":64,"height":24,"text":"ButtonB","visibility":false,"type":"button"},{"id":"____buttonC","createTime":1705455970497,"name":"ButtonC","buttonIndex":2,"x":215,"y":216,"width":64,"height":24,"text":"ButtonC","visibility":false,"type":"button"},{"id":"YdL*^uu&W`zC-1nD","createTime":1705456980181,"isCoreTwo":false,"isPaper":false,"name":"label0","x":219,"y":46,"color":"#FFFFFF","text":"temp","font":"lcd.FONT_DejaVu24","rotation":0,"type":"label","layer":4},{"id":"kYHHnoQ#mxdjW#XG","createTime":1705457485518,"isCoreTwo":false,"isPaper":false,"name":"label2","x":219,"y":107,"color":"#ffffff","text":"Text","font":"lcd.FONT_DejaVu24","rotation":0,"type":"label","layer":6},{"id":"eX+Ax`okrS-`^b_Z","createTime":1705458803268,"isCoreTwo":false,"isPaper":false,"name":"label3","x":14,"y":46,"color":"#00ff2a","text":"Temperature:","font":"lcd.FONT_DejaVu24","rotation":0,"type":"label","layer":7},{"id":"8_cK=XfpuEg67CyY","createTime":1705459103403,"isCoreTwo":false,"isPaper":false,"name":"label5","x":37,"y":159,"color":"#ff0000","text":"Drink water","font":"lcd.FONT_DejaVu40","rotation":0,"type":"label","layer":9},{"id":"OhDmf+qz=I+PtgU-","createTime":1706059888902,"isCoreTwo":false,"isPaper":false,"name":"label6","x":68,"y":107,"color":"#0009ff","text":"Weather:","font":"lcd.FONT_DejaVu24","rotation":0,"type":"label","layer":11}],"type":"core","versions":"Beta","units":[{"id":"#33jzsi^i2Lj9cSC","createTime":1706662881736,"stickNone":"stick","type":"tof","name":"tof_0","port":"PAHUB","default":["A","E","PAHUB","Custom"],"pb_port":[0,1,2,3,4,5],"new_pb_port":"0","user_port":["21","22"],"icon":"tof.png"},{"id":"ga4cy63OUJ4QpQnO","createTime":1706662881736,"hidden":false,"type":"env2","name":"env2_0","port":"PAHUB","default":["A","E","PAHUB","Custom"],"pb_port":[0,1,2,3,4,5],"new_pb_port":"5","user_port":["21","22"],"icon":"env2.png","new_port":"PAHUB","new_default":["A","E","PAHUB","Custom"]},{"id":"^XiUgMuB6rc=AZT#","createTime":1706662881736,"type":"pahub","name":"pahub_0","port":"A","default":["A","E","Custom"],"user_port":["21","22"],"icon":"pa_hub.png"}],"hats":[],"blockly":"<variables><variable id=\"Tc|dtvca8=aH`o5jFJ0t\">temp</variable><variable id=\"RG(WAE]nfgP/-+4-,lbM\">distance</variable></variables><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"-10\" y=\"30\"><next><block type=\"label_set_mode\" id=\"KWmk?dfWp,YFhs..EwnH\"><field name=\"COMPONENT\">label5</field><field name=\"MODE\">True</field><next><block type=\"basic_on_loop\" id=\"Lp9}L6UPcmEd=fv23ZE}\"><statement name=\"LOOP\"><block type=\"variables_set\" id=\"gF?V6BTMlqrII,8~)$S7\"><field name=\"VAR\" id=\"Tc|dtvca8=aH`o5jFJ0t\">temp</field><value name=\"VALUE\"><block type=\"dht12_get_temperature\" id=\"I43v@j;c=~Nb`]=,/}2/\"><field name=\"VARNAME\">env2_0</field></block></value><next><block type=\"variables_set\" id=\"1UWI~7.MDkC_e~9?ZA?~\"><field name=\"VAR\" id=\"RG(WAE]nfgP/-+4-,lbM\">distance</field><value name=\"VALUE\"><block type=\"convent_int\" id=\"[10=VylW1Ui+L3`FN#V|\"><value name=\"VALUE\"><block type=\"math_arithmetic\" id=\":q5nu46gegfTO|%TNNoy\"><field name=\"OP\">DIVIDE</field><value name=\"A\"><block type=\"unit_tof_state\" id=\"Lm:/-4|SzZbapYla}/@p\"><field name=\"TOF\">tof_0</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"(R%F!O=mS$JW(Q17i-93\"><field name=\"NUM\">10</field></block></value></block></value></block></value><next><block type=\"label_set_text\" id=\"7h1IW(@qYGmOuvzj}vUh\"><field name=\"COMPONENT\">label0</field><value name=\"TEXT\"><shadow type=\"text\" id=\")~Ymw;hwSlh$]AkJNnu^\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"variables_get\" id=\"RPj@evVlU=lii80n#[rs\"><field name=\"VAR\" id=\"Tc|dtvca8=aH`o5jFJ0t\">temp</field></block></value><next><block type=\"controls_if\" id=\"8Po*)j_X_F+;,bu`lC=J\"><mutation elseif=\"1\" else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"j]$(=e]nB^WOeDkuH7wi\"><field name=\"OP\">GTE</field><value name=\"A\"><block type=\"variables_get\" id=\"%2{wpVK(~P6@;*pux0WJ\"><field name=\"VAR\" id=\"Tc|dtvca8=aH`o5jFJ0t\">temp</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"XEm7t#Wp7rEYW9f2GhA3\"><field name=\"NUM\">40</field></block></value></block></value><statement name=\"DO0\"><block type=\"label_set_text\" id=\".zgs2^q`#vMkCw@V}wld\"><field name=\"COMPONENT\">label2</field><value name=\"TEXT\"><shadow type=\"text\" id=\"bhv^s+7)GjB*MbQM+|Rw\"><field name=\"TEXT\">hot</field></shadow></value><next><block type=\"controls_if\" id=\"#[X`qS!Sd9P4_APJy#-1\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"QZ:LC-)j[ttQN|!7AvF)\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"variables_get\" id=\"wzV8e8#m_s*4GVfG,Bq;\"><field name=\"VAR\" id=\"RG(WAE]nfgP/-+4-,lbM\">distance</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"/2l%7S=L]A$+.)1YcpH7\"><field name=\"NUM\">20</field></block></value></block></value><statement name=\"DO0\"><block type=\"rgb_set_all\" id=\"07RX1,pohbgfR~-yk_fv\"><field name=\"COLOR\">#ff0000</field><next><block type=\"label_set_mode\" id=\"nIAJVGB9CDv]SzwmXSPU\"><field name=\"COMPONENT\">label5</field><field name=\"MODE\">False</field><next><block type=\"label_set_text\" id=\"kFW2T[1:DNhAcx]BK@Kf\"><field name=\"COMPONENT\">label5</field><value name=\"TEXT\"><shadow type=\"text\" id=\"q#%,Muo2Nild[fgU_/!G\"><field name=\"TEXT\">drink warm or cold water</field></shadow></value></block></next></block></next></block></statement><statement name=\"ELSE\"><block type=\"rgb_set_all\" id=\"8kbt*hQ[r/4kLCd{ddK_\"><field name=\"COLOR\">#000000</field><next><block type=\"label_set_mode\" id=\"kezdJ+RnVnB-yi2Sz0`(\"><field name=\"COMPONENT\">label5</field><field name=\"MODE\">True</field></block></next></block></statement></block></next></block></statement><value name=\"IF1\"><block type=\"logic_compare\" id=\"x`;2%FVtZ*5,0c5(zs9w\"><field name=\"OP\">LTE</field><value name=\"A\"><block type=\"variables_get\" id=\"apRomR;r:kR9@M9:OXMc\"><field name=\"VAR\" id=\"Tc|dtvca8=aH`o5jFJ0t\">temp</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"o!_?dqa-.2H+SYNB7X|/\"><field name=\"NUM\">20</field></block></value></block></value><statement name=\"DO1\"><block type=\"label_set_text\" id=\"`VY_BOnpy83QT.]_o)f;\"><field name=\"COMPONENT\">label2</field><value name=\"TEXT\"><shadow type=\"text\" id=\"C0k_1,tg;B1M3@RZ;0Hx\"><field name=\"TEXT\">cold</field></shadow></value><next><block type=\"controls_if\" id=\"xdzw@adgJ[FG73,}i|6s\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"`RB_K8tX.N{`ISF0xE}e\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"variables_get\" id=\"-|=|Z1scwY6^UxegD.j,\"><field name=\"VAR\" id=\"RG(WAE]nfgP/-+4-,lbM\">distance</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"Yk%-r?$*2WL6uEz2rw6l\"><field name=\"NUM\">20</field></block></value></block></value><statement name=\"DO0\"><block type=\"rgb_set_all\" id=\"|#-OovW)Q`;a2Ak?al-F\"><field name=\"COLOR\">#ff0000</field><next><block type=\"label_set_mode\" id=\"j|u}GYe;|$@ld_-Aw;(]\"><field name=\"COMPONENT\">label5</field><field name=\"MODE\">False</field><next><block type=\"label_set_text\" id=\"@knQ7Obh~!p@t..kTZ*(\"><field name=\"COMPONENT\">label5</field><value name=\"TEXT\"><shadow type=\"text\" id=\"1~^jy1C{G)MlkOw*h-(e\"><field name=\"TEXT\">drink warm or hot water</field></shadow></value></block></next></block></next></block></statement><statement name=\"ELSE\"><block type=\"rgb_set_all\" id=\"NSlB^q/W)`+CBKpxzLe6\"><field name=\"COLOR\">#000000</field><next><block type=\"label_set_mode\" id=\"Ht]kN?Kvdue}2*o]ICKU\"><field name=\"COMPONENT\">label5</field><field name=\"MODE\">True</field></block></next></block></statement></block></next></block></statement><statement name=\"ELSE\"><block type=\"label_set_mode\" id=\"3Yyp4Wv{*R9g$U*0qW[q\"><field name=\"COMPONENT\">label5</field><field name=\"MODE\">True</field><next><block type=\"label_set_text\" id=\"w/j!m:.U1Kva,FciQ@~{\"><field name=\"COMPONENT\">label2</field><value name=\"TEXT\"><shadow type=\"text\" id=\"?_)Qt`U;V;x2OF-kxld2\"><field name=\"TEXT\">warm</field></shadow></value></block></next></block></statement></block></next></block></next></block></next></block></statement></block></next></block></next></block>","Blockly.Remotes":[],"Blockly.RemotePlus":[{"id":"__title","blockId":"","createTime":1706662881736,"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

half dollar

half dollar

1 project • 0 followers
Anwaruddin Mohammed

Anwaruddin Mohammed

1 project • 0 followers
JeremyAng

JeremyAng

0 projects • 0 followers
TIMBAKER2343

TIMBAKER2343

0 projects • 0 followers

Comments