'*********************************************************** '** ** '** SRF08 Demonstration Software for the PICAXE-28x ** '** ** '** Copyright 2003 - Devantech Ltd ** '** Commercial use of this software is prohibited ** '** Private and educational use only is permitted ** '** ** '** Written by Gerald Coe - May 2003 ** '** ** '*********************************************************** main: i2cslave $E0,i2cfast,i2cbyte ' Define i2c slave address for the SRF08 loop: writei2c 0,(81) ' Send Ranging command to get range in cm pause 100 ' Wait for ranging to complete readi2c 0,(b0) ' Read SRF08 Software Revision readi2c 1,(b2) ' Read the Light Sensor readi2c 2,(b5, b4) ' Read the Range debug w0 ' Display Software Revision debug w1 ' Display Light Sensor Value debug w2 ' Display Range, Note b5-b4 are w2 high-low bytes goto loop