Chapter 3: AT Commands Reference

December 31, 2007 AT Commands Reference Manual 3-215

Example
AT+MI OC= ?
+MIOC: (00000000-11111111),(00000000-11111111)
OK
Light control example:
Client has an electronic controlled light switch. The intent is to connect this switch to the g24 (IO pin 5 - for
example) and control the light by setting the logical values of pin 5.
Example of code is as follows:
AT+MIOD=00010000,0// Set IO pin #5 to be output.
OK
AT+MIOD?// (Optional) Read the IO pin definitions to confirm correct settings.
+MIOD : 11101111 / / Pin s 1-4 a nd 6-8 are in put pi ns. Pi n 5 is o utput .
OK // At this point the module is conf igured to control the logic values of
pin 5.
AT+MIOC=00010000, 00010000 // Turn on the light by setting pin 5 to high.
AT+MIOC?// (Optional) read the pins status.
+MIOC: 00010000// Pin 5 is set to high.
OK
AT+MIOD=00010000,0, 00010000// All previous defined in one command.
OK
AT+MIOC=00010000,00000000// Turn off the light by setting pin 5 to low.
OK
AT+MIOC?// (Optional) read the pins status.
+MIOC: 00000000// Pin 5 is set to low.
OK