SerialComm - A serial communication library

Hi

I'm working on a serial communication library and would like to share my work.

This library helps to exchange data between arduino boards over serial interface, or an arduino board and a Python application (Python module provided).

You can :

  • Send integer or char arrays :
s.sendMessage( 2 , false, "iiisss", an_integerA, an_integerB, an_integerC, a_stringA, a_stringB, a_stringC );
  • Get the data from the received message :
s.getData( "iiisss" , &an_integerA, &an_integerB, &an_integerC, &a_stringA, &a_stringB, &a_stringC );
  • Send back an acknowledgment containing requested data :
s.sendAck( "i" , 5 );

The Python module provides the same methods.

There are also some arduino shortcuts :

  • Execute a remote digitalRead on the remote board :
int  rDigitalRead( uint8_t pin );
  • Execute a remote analogRead on the remote board :
int  rAnalogRead( uint8_t pin );
  • Execute a remote analogWrite on the remote board :
void rAnalogWrite( uint8_t pin , int value);
  • Execute a remote digitalWrite on the remote board :
void rDigitalWrite( uint8_t pin , int value);

The GitHub page :

David.

Thanks for sharing.

You may be interested in this Python - Arduino demo and in Serial Input Basics

...R