<root>
<document scada='0' schema='102' license='1,18672762,J3DEDZ' title='MQTT Data Source (ESP32)' description='A simple template showing how to poll a sensor and then pass the data to a MQTT broker.
Based on the ESP32 hardware.' fcversion='590592' target='ESP.ESP32.TTGO_T_Display' >
	<config data='' clkspd='240000000' simspd='1' usewdt='1' constif='0' commport='7' SSH_IP='01652BBCDF86326BE42143EBD62A0FCD' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<traces />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='1' />
			<data name='ClockPin' value='6' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='7' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='1' />
			<data name='CalculatedCommsDelay' value='1' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='c453d8eb-b418-4677-b056-7a915da7f8fe' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='Misc' category2='' category3='' bIs2dOnly='0' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<gdiopts FullContainer='1' FullTransparency='1' ShowGdi='1' ShowOpengl='1' />
		<component class_type='root' codename='panel' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' comp2dType='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='IC_Trans_Delay' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Lower_Byte_Temp' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='count' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='test' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Lower_Byte_Hum' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='int_ok' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Topic_ID' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Ack' type='b1' description='Acknowledged cmd' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Display_Temp' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Publish_String_Hum' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='HumReg' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Temp_Payload' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Upper_Byte_Hum' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Hum_Float' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='HumRegLower' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Hum_Payload' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Delay' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Temperature' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='5' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Direct_Temp_Reading' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Direct_Hum_Reading' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='TempReg' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='convert_result' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='IoT_Connected' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Connected' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Upper_Byte_Temp' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Humidity' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='5' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Read_Delay' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FloatTemp' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Display_Hum' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Publish_String_Temp' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Print_clear_delay' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FloatHum' type='f32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0.0' setinit='0.0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='publish' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='Return 0 for success' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Publish_String_Temp = Display_Temp + &quot; MQ &quot;' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='IoTMadeEasy1' macro='PublishString' >
							<argument exp='0' />
							<argument exp='Publish_String_Temp' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Publish_String_Hum = Display_Hum + &quot; MQ &quot;' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='IoTMadeEasy1' macro='PublishString' >
							<argument exp='1' />
							<argument exp='Publish_String_Hum' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Convert_Bytes' description='' statediag='0' >
						<return name='Return' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='lowerbyte' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='upperbyte' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='*************************
Converting Bytes to UINT
*************************' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='TypeConversions1' macro='SetByte' >
							<argument exp='0' />
							<argument exp='.lowerbyte' />
						</command>
						<command class_type='comment' title='' comment='lower byte' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='TypeConversions1' macro='SetByte' >
							<argument exp='1' />
							<argument exp='.upperbyte' />
						</command>
						<command class_type='comment' title='' comment='upper byte' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='TypeConversions1' macro='GetInt' >
							<return exp='.Return' />
							<argument exp='0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Calculate_Temp' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Hum Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='TempReg = TempReg &amp; 0xFFFC //  0b1111111111111100' />
							<exp exp='FloatTemp = TempReg / 65536.0' />
							<exp exp='FloatTemp = FloatTemp * 175.72' />
							<exp exp='FloatTemp = FloatTemp - 46.85' />
							<exp exp='Temperature = FloatToString$ (FloatTemp)' />
							<exp exp='Display_Temp = Temperature + &quot; Deg C&quot;' />
						</command>
						<command class_type='comment' title='' comment='To set the lower 2 or 4 bits to 0 you can just do some masking, looks like shifting may also divide down the data.

TempReg = TempReg &amp; 0xFFF0     1111111111110000 ?
HumReg = HumReg &amp; 0xFFFC   1111111111111100 ?
Then for the calc maybe do something like this.

FloatTemp = TempReg / 65536.0
FloatTemp = FloatTemp * 175.72
FloatTemp = FloatTemp - 46.85

FloatHum = HumReg / 65536.0
FloatTemp = FloatTemp * 125.0
FloatTemp = FloatTemp - 6.0

uint16_t value = (highByte &lt;&lt; 8) | lowByte ;' textarea='152,-40,152,-40' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Read_Temperature' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='HTU21DSensorTemp' />
						<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Convert_Bytes' >
							<return exp='TempReg' />
							<argument exp='Lower_Byte_Temp' />
							<argument exp='Upper_Byte_Temp' />
						</command>
						<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Calculate_Temp' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Read_Humidity' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='HTU21DSensorHum' />
						<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Convert_Bytes' >
							<return exp='HumReg' />
							<argument exp='Lower_Byte_Hum' />
							<argument exp='Upper_Byte_Hum' />
						</command>
						<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Calculate_Humidity' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Get_MQTT_Data' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='IoTMadeEasy1' macro='Read' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='IoTMadeEasy1' macro='GetTopicID' >
							<return exp='Topic_ID' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Topic_ID = 0' swap='0' >
							<flowline >
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='IoTMadeEasy1' macro='GetPayloadString' >
									<argument exp='Temp_Payload' />
									<argument exp='20' />
								</command>
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='gLCD_ST7789V1' macro='Print' >
									<argument exp='Temp_Payload' />
									<argument exp='0' />
									<argument exp='73' />
									<argument exp='1' />
									<argument exp='0' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='IoTMadeEasy1' macro='Read' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='IoTMadeEasy1' macro='GetTopicID' >
							<return exp='Topic_ID' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Topic_ID = 1' swap='0' >
							<flowline >
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='IoTMadeEasy1' macro='GetPayloadString' >
									<argument exp='Hum_Payload' />
									<argument exp='20' />
								</command>
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='gLCD_ST7789V1' macro='Print' >
									<argument exp='Hum_Payload' />
									<argument exp='0' />
									<argument exp='35' />
									<argument exp='1' />
									<argument exp='0' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Print' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='x_pos' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='y_pos' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='String_to_print' type='T8*' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='gLCD_ST7789V1' macro='Print' >
							<argument exp='.String_to_print' />
							<argument exp='.x_pos' />
							<argument exp='.y_pos' />
							<argument exp='1' />
							<argument exp='0' />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Print_clear_delay' type='2' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='gLCD_ST7789V1' macro='ClearDisplay' />
					</flowline>
				</macro>
				<macro >
					<flowline name='HTU21DSensorTemp' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='Write_Address' type='s16' description='Write address no extra 1  &quot;10000000&quot; = 80 in hex' isconst='1' isHidden='0' isinit='1' usrinit='128' setinit='0x80' />
						<local name='Read_Temp' type='s16' description='Start Temp read E3 HOLD MASTER F3 NO HOLD' isconst='1' isHidden='0' isinit='1' usrinit='227' setinit='0xE3' />
						<local name='Read_Address' type='s16' description='Read data from the address extra 1 added &quot;10000001&quot; = 81 hex' isconst='1' isHidden='0' isinit='1' usrinit='129' setinit='0x81' />
						<command class_type='comment' title='' comment='Main Basic overview of a I2C Read transaction

1) Start transaction
2) Send device address with read/write bit = 0
3) Send internal EEPROM address MSB
4) Send internal EEPROM address LSB
5) Send a restart command
6) Send device address with read/write bit = 1
5) Read n data bytes from the memory
6) Stop transaction' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='comment' title='' comment='Main Basic overview of a I2c Write transaction

1) Start transaction
2) Send device address with read/write bit = 0
3) Send internal EEPROM address MSB
4) Send internal EEPROM address LSB
5) Send n data bytes to be written
6) Stop transaction' textarea='36,200,36,200' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='comment' title='' comment='Generic Read Transaction

A generic read transaction to a memory device might look something like this: 

Start 

Send External Device Address Byte (Write mode) 

Send Internal Address Byte 

Restart 

Send External Device Address Byte (Read mode) 

Read Data Byte 

Stop 
' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='TransmitByte' >
							<return exp='Ack' />
							<argument exp='.Write_Address' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='TransmitByte' >
							<argument exp='.Read_Temp' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='Stop' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='TransmitByte' >
							<return exp='Ack' />
							<argument exp='.Write_Address' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='TransmitByte' >
							<return exp='Ack' />
							<argument exp='.Read_Temp' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='Restart' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='TransmitByte' >
							<return exp='Ack' />
							<argument exp='.Read_Address' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='ReceiveByte' >
							<return exp='Upper_Byte_Temp' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='ReceiveByte' >
							<return exp='Lower_Byte_Temp' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='Delay = 100' />
							<exp exp='Read_Delay = 200' />
							<exp exp='Print_clear_delay = 1' />
							<exp exp='IC_Trans_Delay = 10' />
						</command>
						<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='20' type='1' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='Initialise' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='gLCD_ST7789V1' macro='Initialise' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='gLCD_ST7789V1' macro='SetDisplayOrientation' >
							<argument exp='3' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='gLCD_ST7789V1' macro='SetFontScaler' >
							<argument exp='2' />
							<argument exp='2' />
						</command>
						<command class_type='loop' title='Loop' disable='1' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' type='0' exp='1' >
							<flowline >
								<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='3' type='2' />
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='HTU21DSensorTemp' />
							</flowline>
						</command>
						<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
							<argument exp='0' />
							<argument exp='0' />
							<argument exp='&quot;Starting&quot;' />
						</command>
						<command class_type='comment' title='' comment='loop here to test sensor readings' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='call' title='Call Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='WLAN_ESP32' macro='Initialise' >
							<return exp='int_ok' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='int_ok' swap='0' >
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='&quot;ESP32 init ok&quot;' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='&quot;ESP32 init fail&quot;' />
								</command>
							</flowline>
						</command>
						<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Delay' type='1' />
						<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
							<argument exp='0' />
							<argument exp='0' />
							<argument exp='&quot;Connect Radioroom.net&quot;' />
						</command>
						<command class_type='call' title='Edit to match your network settings' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='WLAN_ESP32' macro='ConnectToSSID' >
							<return exp='Connected' />
							<argument exp='&quot;Radioroom.net&quot;' />
							<argument exp='&quot;Pallaslyndale2323&quot;' />
							<argument exp='20' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Connected' swap='0' >
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='&quot;Connected Wifi&quot;' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='&quot;Wifi Connect fail&quot;' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='&quot;Trying Alt Connection&quot;' />
								</command>
								<command class_type='call' title='Edit to match your network settings' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='WLAN_ESP32' macro='ConnectToSSID' >
									<return exp='Connected' />
									<argument exp='&quot;Radioroom-hub.net&quot;' />
									<argument exp='&quot;Pallaslyndale2323&quot;' />
									<argument exp='20' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Connected' swap='0' >
									<flowline >
										<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
											<argument exp='0' />
											<argument exp='0' />
											<argument exp='&quot;Wifi Connected&quot;' />
										</command>
									</flowline>
									<flowline >
										<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
											<argument exp='0' />
											<argument exp='0' />
											<argument exp='&quot;Alt failed as well&quot;' />
										</command>
										<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
											<argument exp='0' />
											<argument exp='0' />
											<argument exp='&quot;No internet&quot;' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Delay' type='1' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='NetworkComms1' macro='Initialise' />
						<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Delay' type='1' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='IoTMadeEasy1' macro='Initialise' />
						<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Delay' type='1' />
						<command class_type='loop' title='Loop' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' type='0' exp='IoT_Connected = 0' >
							<flowline >
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='IoTMadeEasy1' macro='Connect' >
									<return exp='IoT_Connected' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='IoT_Connected' swap='0' >
									<flowline >
										<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
											<argument exp='0' />
											<argument exp='0' />
											<argument exp='&quot;IoT connected&quot;' />
										</command>
									</flowline>
									<flowline >
										<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
											<argument exp='0' />
											<argument exp='0' />
											<argument exp='&quot;IoT not connected&quot;' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
									<exp exp='count = count + 1' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='count = 10' swap='0' >
									<flowline >
										<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
											<argument exp='0' />
											<argument exp='0' />
											<argument exp='&quot;10 trys exceeded&quot;' />
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
											<exp exp='count = 0' />
										</command>
										<command class_type='goto' title='Goto Connection Point' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' labelid='0' labelname='' />
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
						<command class_type='label' title='Declare Connection Point' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' labelid='0' labelname='A' />
						<command class_type='loop' title='Loop' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' type='0' exp='1' >
							<flowline >
								<command class_type='delay' title='Delay' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='1' type='2' />
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Read_Temperature' />
								<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
									<exp exp='Direct_Temp_Reading = Display_Temp + &quot; LC &quot;' />
								</command>
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='gLCD_ST7789V1' macro='Print' >
									<argument exp='Direct_Temp_Reading' />
									<argument exp='0' />
									<argument exp='108' />
									<argument exp='1' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Read_Humidity' />
								<command class_type='calculation' title='Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
									<exp exp='Direct_Hum_Reading = Display_Hum + &quot; LC   &quot;' />
								</command>
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='gLCD_ST7789V1' macro='Print' >
									<argument exp='Direct_Hum_Reading' />
									<argument exp='0' />
									<argument exp='0' />
									<argument exp='1' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='publish' />
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Get_MQTT_Data' />
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='IoTMadeEasy1' macro='Ping' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Calculate_Humidity' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Hum Calculation' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='HumReg = HumReg &amp; 0xFFFC //  0b1111111111111100' />
							<exp exp='FloatHum = HumReg / 65536.0' />
							<exp exp='FloatHum = FloatHum * 125.0' />
							<exp exp='FloatHum = FloatHum - 6.0' />
							<exp exp='Humidity = FloatToString$ (FloatHum)' />
							<exp exp='Display_Hum = Humidity + &quot; % Hum&quot;' />
						</command>
						<command class_type='comment' title='' comment='To set the lower 2 or 4 bits to 0 you can just do some masking, looks like shifting may also divide down the data.

TempReg = TempReg &amp; 0xFFF0     1111111111110000 ?
HumReg = HumReg &amp; 0xFFFC   1111111111111100 ?
Then for the calc maybe do something like this.

FloatTemp = TempReg / 65536.0
FloatTemp = FloatTemp * 175.72
FloatTemp = FloatTemp - 46.85

FloatHum = HumReg / 65536.0
FloatTemp = FloatTemp * 125.0
FloatTemp = FloatTemp - 6.0

uint16_t value = (highByte &lt;&lt; 8) | lowByte ;' textarea='152,-40,152,-40' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
					</flowline>
				</macro>
				<macro >
					<flowline name='HTU21DSensorHum' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='Write_Address' type='s16' description='Write address no extra 1  &quot;10000000&quot; = 80 in hex' isconst='1' isHidden='0' isinit='1' usrinit='128' setinit='0x80' />
						<local name='Read_Hum' type='s16' description='Start humidity read E5 HOLD MASTER F5 NO HOLD' isconst='1' isHidden='0' isinit='1' usrinit='229' setinit='0xE5' />
						<local name='Read_Address' type='s16' description='Read data from the address extra 1 added &quot;10000001&quot; = 81 hex' isconst='1' isHidden='0' isinit='1' usrinit='129' setinit='0x81' />
						<command class_type='comment' title='' comment='Main Basic overview of a I2C Read transaction

1) Start transaction
2) Send device address with read/write bit = 0
3) Send internal EEPROM address MSB
4) Send internal EEPROM address LSB
5) Send a restart command
6) Send device address with read/write bit = 1
5) Read n data bytes from the memory
6) Stop transaction' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='comment' title='' comment='Main Basic overview of a I2c Write transaction

1) Start transaction
2) Send device address with read/write bit = 0
3) Send internal EEPROM address MSB
4) Send internal EEPROM address LSB
5) Send n data bytes to be written
6) Stop transaction' textarea='36,200,36,200' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='comment' title='' comment='Generic Read Transaction

A generic read transaction to a memory device might look something like this: 

Start 

Send External Device Address Byte (Write mode) 

Send Internal Address Byte 

Restart 

Send External Device Address Byte (Read mode) 

Read Data Byte 

Stop 
' textarea='12,0,12,0' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='TransmitByte' >
							<return exp='Ack' />
							<argument exp='.Write_Address' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Ack' swap='1' >
							<flowline >
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='TransmitByte' >
									<argument exp='.Read_Hum' />
								</command>
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='Stop' />
							</flowline>
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
									<argument exp='0' />
									<argument exp='75' />
									<argument exp='&quot;No Ack Hum 1&quot;' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='Start' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='TransmitByte' >
							<return exp='Ack' />
							<argument exp='.Write_Address' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Ack' swap='1' >
							<flowline >
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='TransmitByte' >
									<return exp='Ack' />
									<argument exp='.Read_Hum' />
								</command>
							</flowline>
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
									<argument exp='0' />
									<argument exp='75' />
									<argument exp='&quot;No Ack Hum 2&quot;' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Decision' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='Ack' swap='1' >
							<flowline >
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='Restart' />
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='TransmitByte' >
									<return exp='Ack' />
									<argument exp='.Read_Address' />
								</command>
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='ReceiveByte' >
									<return exp='Upper_Byte_hum' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='ReceiveByte' >
									<return exp='Lower_Byte_Hum' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='I2C_Master1' macro='Stop' />
							</flowline>
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Print' >
									<argument exp='0' />
									<argument exp='75' />
									<argument exp='&quot;No Ack Hum 3&quot;' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='91049bf5-2436-42dc-947a-c30c86463d98' vmin='5' vmaj='1' codename='NetworkComms1' x='260' y='260' z='0' xsz='4.20168' ysz='4.20168' zsz='4.20168' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Component' data='WLAN_ESP32' />
					<value target='TCPIP_Channel' data='000' />
					<value target='RemapIndex' data='22' />
					<value target='Status' data='Supported' />
					<value target='Sim' data='0' />
					<value target='SimControl' data='000' />
					<value target='NetworkInterface' data='004' />
					<value target='IPAddress' data='192.168.0.153' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='f0f54e46-0848-4930-9bb6-eff9a34ed229' vmin='4' vmaj='2' codename='WLAN_ESP32' x='608.6' y='300.3' z='0' xsz='105.042' ysz='105.042' zsz='105.042' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='1' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='Verbose' data='0' />
					<value target='RemapIndex' data='22' />
					<value target='TCP_Base1::interface' data='4' />
					<value target='TCP_Base1::ConsoleData' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='2740a93b-32a9-48d1-8fc3-089d13b50bb5' vmin='0' vmaj='1' codename='IoTMadeEasy1' x='-130' y='300' z='0' xsz='116.279' ysz='116.279' zsz='116.279' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='HOST' data='192.168.0.111' />
					<value target='PORT' data='1883' />
					<value target='CLIENT' data='Flowcode_IoT_Source' />
					<value target='TIMEOUT' data='1000' />
					<value target='ReadTimeout' data='50' />
					<value target='KEEP_ALIVE' data='60' />
					<value target='NETWORK_COMPONENT' data='NetworkComms1' />
					<value target='AUTHENTICATION' data='001' />
					<value target='NAME' data='Flowcode' />
					<value target='PASSWORD' data='Flowcode' />
					<value target='NumTopics' data='002' />
					<value target='Topic0' data='ESP32/Temperature' />
					<value target='TopicType0' data='002' />
					<value target='Topic1' data='ESP32/Humidity' />
					<value target='TopicType1' data='002' />
					<value target='Topic2' data='Manufacturer/Series/Data2' />
					<value target='TopicType2' data='000' />
					<value target='Topic3' data='Manufacturer/Series/Data3' />
					<value target='TopicType3' data='000' />
					<value target='Topic4' data='Manufacturer/Series/Data4' />
					<value target='TopicType4' data='000' />
					<value target='Topic5' data='Manufacturer/Series/Data5' />
					<value target='TopicType5' data='000' />
					<value target='Topic6' data='Manufacturer/Series/Data6' />
					<value target='TopicType6' data='000' />
					<value target='Topic7' data='Manufacturer/Series/Data7' />
					<value target='TopicType7' data='000' />
					<value target='Topic8' data='Manufacturer/Series/Data8' />
					<value target='TopicType8' data='000' />
					<value target='Topic9' data='Manufacturer/Series/Data9' />
					<value target='TopicType9' data='000' />
					<value target='Topic10' data='Manufacturer/Series/Data10' />
					<value target='TopicType10' data='000' />
					<value target='Topic11' data='Manufacturer/Series/Data11' />
					<value target='TopicType11' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='4e30b15e-2507-4583-995d-b2056e04a286' vmin='6' vmaj='1' codename='gLCD_ST7789V1' x='390' y='-620' z='0' xsz='13.3181' ysz='13.3181' zsz='13.3181' xang='0' yang='0' zang='-90' xquat='0' yquat='0' zquat='0.707107' wquat='-0.707107' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pixel_width' data='135' />
					<value target='pixel_height' data='240' />
					<value target='XOffset' data='52' />
					<value target='YOffset' data='40' />
					<value target='monochrome' data='0' />
					<value target='foreground_colour' data='16777047' />
					<value target='background_colour' data='0' />
					<value target='InvColours' data='1' />
					<value target='colour_bit_depth' data='16' />
					<value target='red_bit_depth' data='5' />
					<value target='green_bit_depth' data='6' />
					<value target='blue_bit_depth' data='5' />
					<value target='FGCOL' data='24543' />
					<value target='BGCOL' data='0' />
					<value target='data_pin' data='$PORTA.19' />
					<value target='clock_pin' data='$PORTA.18' />
					<value target='UseCS' data='1' />
					<value target='ToggleCS' data='1' />
					<value target='chip_sel_pin' data='$PORTA.5' />
					<value target='UseReset' data='1' />
					<value target='ResetPin' data='$PORTA.23' />
					<value target='UseBacklight' data='1' />
					<value target='BacklightPin' data='$PORTA.4' />
					<value target='UseDC' data='1' />
					<value target='DCPin' data='$PORTA.16' />
					<value target='Base_GLCD::FontCount' data='002' />
					<value target='Base_GLCD::gLCD_Font1::Font' data='005' />
					<value target='Base_GLCD::gLCD_Font1::FontSpace' data='001' />
					<value target='Base_GLCD::gLCD_Font1::SpaceWidth' data='004' />
					<value target='Base_GLCD::gLCD_Font2::Font' data='009' />
					<value target='Base_GLCD::gLCD_Font2::FontSpace' data='001' />
					<value target='Base_GLCD::gLCD_Font2::SpaceWidth' data='004' />
					<value target='Base_GLCD::gLCD_Font3::Font' data='002' />
					<value target='Base_GLCD::gLCD_Font3::FontSpace' data='001' />
					<value target='Base_GLCD::gLCD_Font3::SpaceWidth' data='004' />
					<value target='Base_GLCD::gLCD_Font4::Font' data='015' />
					<value target='Base_GLCD::gLCD_Font4::FontSpace' data='001' />
					<value target='Base_GLCD::gLCD_Font4::SpaceWidth' data='004' />
					<value target='DisplayMethod' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='24219805-113d-4b12-b6bd-e1b0b0c33981' vmin='4' vmaj='1' codename='I2C_Master1' x='20' y='780' z='0' xsz='157.563' ysz='157.563' zsz='157.563' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='cal_i2c::CHANNEL' data='000' />
					<value target='cal_i2c::BAUD_LIST' data='003' />
					<value target='cal_i2c::BAUD' data='1000000' />
					<value target='cal_i2c::StopDel' data='0' />
					<value target='cal_i2c::SRC' data='000' />
					<value target='cal_i2c::SMB' data='000' />
					<value target='cal_i2c::ClockStretching' data='0' />
					<value target='cal_i2c::SDA' data='$PORTA.21' />
					<value target='cal_i2c::SDAPins' data='002' />
					<value target='cal_i2c::SCL' data='$PORTA.22' />
					<value target='cal_i2c::SCLPins' data='010' />
					<value target='label' data='I2C Master' />
					<value target='cal_i2c::ScopeTraces' data='0' />
					<value target='cal_i2c::ConsoleData' data='1' />
					<value target='cal_i2c::Injector' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='6508c7be-063a-4f9f-bae5-4a41cf977a86' vmin='0' vmaj='1' codename='TypeConversions1' x='0' y='0' z='0' xsz='174.419' ysz='174.419' zsz='174.419' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='GenCode' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='2105930' img='' style='0' />
		<camera xe='231.973' ye='0' ze='1205.76' xt='231.973' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='206' dy='600' zoom='20.6724' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='0' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0.544496' ye='34.362' ze='351.764' xt='0.544496' yt='34.362' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKAMAAK0CAAA' zoom='75' scrollx='0' scrolly='3187' flags='0' />
		<view type='0' name='Print' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKAMAAK0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='HTU21DSensorHum' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKAMAAK0CAAA' zoom='75' scrollx='0' scrolly='114' flags='0' />
		<view type='0' name='Calculate_Humidity' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKAMAAK0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='HTU21DSensorTemp' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKAMAAK0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Read_Humidity' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKAMAAK0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Read_Temperature' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKAMAAK0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Calculate_Temp' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKAMAAK0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='publish' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKAMAAK0CAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Get_MQTT_Data' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAKAMAAK0CAAA' zoom='75' scrollx='0' scrolly='330' flags='0' />
	</layout>
</document>
</root>
