Get Adobe Flash player
English Arabic French German Italian Portuguese Russian Spanish

Did you know?

In 1800 Count Alassandro Volta made the "voltaic pile", a battery. His experiments,along with Luigi Galvani, applying electricity to frogs legs and making them jump when touched by an electric wire prompted Mary Wollstonecraft Shelley to write FRANKENSTEIN in 1818.

Help us stay online:

small donate

CaptureThis is tutorial explains how to use Docklight RS232 terminal to change Arduino variables with AT style commands (including full source code of the example).

Special features of Docklight adjustable Sending sequences with wildcards are also used.

Once you make your Microcontroller project, you will almost always want to have communication to change some of your project variables.
In this tutorial we are presenting very effective way to define different commands styled as standard modem AT commands.

Code is explained in details line by line and is C based so it can be used with any AVR compiler or PIC, dsPIC, MSP..

Once you incorporate this technique in you projects it will be a lot easier to maintain your code and add additional commands to your custom communication protocol.



Here is full source code, or you can download it from -->>THIS LINK<<--


void setup() {
  // put your setup code here, to run once:
char  incommingBuffer[30];
unsigned int  incommingBufferIndex = 0;
const char commandsArray[][20] = {
unsigned int parameterArray[4];
enum {
void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available())
    incommingBuffer[incommingBufferIndex] =;
    if (incommingBuffer[incommingBufferIndex] == '\n')
      Serial.print("String recieved is: ");
      Serial.print("Length of incoming string is: ");
      for (int k = 0; k < COMMANDS_INDEX_MAX; k++)
        if (strstr(incommingBuffer, commandsArray[k]))
          Serial.print ("Command found is: ");
          Serial.print (commandsArray[k]);
          Serial.print(" Parameter value is:");
          Serial.println(strstr(incommingBuffer, commandsArray[k]) + strlen(commandsArray[k]));
          parameterArray[k] = atoi(strstr(incommingBuffer, commandsArray[k]) + strlen(commandsArray[k]));
      char  tmparray[200];
      sprintf(tmparray, "Current values are  PARAMETER:%d  MINUTE::%d  HOUR:%d  FREQUENCY:%d\n", parameterArray[PARAMETER_INDEX], parameterArray[MINUTE_INDEX], parameterArray[HOUR_INDEX], parameterArray[FREQUENCY_INDEX]);
      memset(incommingBuffer, 0, sizeof(incommingBuffer));
      incommingBufferIndex = 0;