Instructables

Connecting two OOBoards together using I2C

Step 3: Program the slave

Now that the physical connections are there, you will need to program the slave microcontroller. I added some code below that should get you started.

Dim SLAVE As New oDDELinkDim LED As New oDIO1Sub Main()	'set our I2C address to 2 (note, this must match the remote	'address we set in the master code)	ooPIC.Node = 2		'setup an LED	LED.IOLine = 5 	LED.Direction = cvOutput    	'now, link the output of our DDELink object to   	'the LED, and turn it on...now automagically, the LED will blink	SLAVE.Output.Link(LED)	SLAVE.Operate = cvTrueEnd Sub
 
Remove these adsRemove these ads by Signing Up