Pages

Thursday, March 25, 2010

Receive Library tutorial

as i promised: the two libraries for the pulsernet and a tutorial of how to use it.

-------RECIEVING

The library for the recieving of values which have been sended by the pulsernet can be found here.

to use it, first extrude the .rar in your arduino/libraries folder.
Start your arduino and import the library. This can be done in the menu: sketch / import library
If you extracted your library in the right folder, it should say: PulsernetRecieve.
If you click that the library is imported.


Then create an instance of the receive class by creating a code like:
Receive /name/ ( /number of receiving pin/ );
for instance:

Receive mailbox(7);

I am receiving the values on pin nr 7 and i call the receiver mailbox from now on.

then cal your normal voids, and an integer to set the value to.

int value;

void setup()
{
}

void loop()
{

now in this loop you only need to set the received value to your integer.

value = mailbox.Value();
}

now every time a value will be recieved, the value of your integer will change to that value.

-------SENDING

The library for the sending of values over the pulsernet can be found here.

to use it, first extrude the .rar in your arduino/libraries folder.
Start your arduino and import the library. This can be done by opening the menu: sketch / import library. If you extracted the library properly it should say PulsernetSend. If you click that the library is included.

Then create an instance of the send class by creating a code
Send
/name/
(
/number of receiving pin/
);
for instance:

Send mailman(13);

I am receiving the values on pin nr 13 and i call the sender mailman from now on.
then cal your normal voids.

void setup()
{
}

void loop()
{

now in this loop all you need to do is send the value you want to send with your sender:

mailman.Sender(15);

}

we are now sending the value 15 to the other arduino with the pulsernet. Of course you can also insert a variable instead of a real value.

---------------

if there are any questions or problems with these libraries, send me an email or just ask


No comments:

Post a Comment