Stap 3: Programma de slaaf
Nu dat de fysieke verbindingen er zijn, moet u de slave-microcontroller te programmeren. Ik heb toegevoegd sommige code hieronder die u begonnen moet krijgen.
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