📄 i2cex2.usc
字号:
// This example writes 256 from 24c01/24c16
Program WriteI2CEx;
var d: byte;
i: integer;
begin
ShowHexEdit;
SetSizeHexEdit( 256 );
PowerOn;
ConfigI2C( 10, 10000 );//clock=10us,write=10ms
for i := 0 to 255 do
begin
StartI2C;
d := 10;
if WriteByteAI2C( $a0 ) = false then //control byte
AddMsgDebug( 'Control Byte Error'+ intToStr(i) )
else if WriteByteAI2C( i ) = false then //address
AddMsgDebug( 'Address Error')
else begin
StartI2C;
if WriteByteAI2C( $a1 ) = false then //control byte
AddMsgDebug( 'Control Byte Error'+ intToStr(i) )
else if ReadByteI2C( d ) = false then //data
AddMsgDebug( 'Data Error');
end;
StopI2C;
SetByteHexEdit( i, d );
end;
PowerOff;
RefreshHexEdit;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -