Home
RECOMMENDED FOR YOU:
SMS Gateway software
Ozeki brings you outstanding
SMS Gateway technology. Use our SMS Server products on Windows,Linux, or Android

C# SMS API
Developers can use our C# SMS API to send SMS from C#.Net. The C# SMS API comes with full source code

PHP SMS API
The ozeki PHP SMS gateway software can be used to send SMS from PHP and to receive SMS usig PHP on your website

SMPP SMS Gateway
SMS service providers use our SMPP gateway solution, that offers a high performance SMPP server and SMPP client gateway with amazing routing capabilities

Course 10 / Lecture 3:

Receive messages from your robot and handle events

In this lecture you will learn how to subscribe for events coming from a robot sensor, and how to handle them in your C#.Net robot control app. You will also learn how to display robot events on the user interface of your app.

Task #1:

Create a page for displaying sensor values!

The following video shows you how to create a new page (the name of the page: Page_ButtonIndicator) with two OzGPC_Image components. One of them will be a hidden image.

Task #2:

Create an event for receiveing messages!

From the following video you can learn how to create a new EventHandler, and raise it if there is a new message from the lego robot. You also need to override the In method to raise the previously created event.

Task #3:

Subscribe for the message received event!

In the constructor of the Page_ButtonIndicator class you need to subscribe for the OnMessageReceived event. In this lecture we are testing a touch sensor. If we press it, the OnMessageReceived event occurs with on value. If it is not pressed, the off value is coming from the sensor.

Task #4:

Test your system!

It is not enough to subscribe for this event, you also need to subscribe the events of the Touch Sensor. After you have subscribed to it, build and test the app.

Task #5:

Unsubscribe!

The following example demonstrates how to override the Dispose class. It is very important to release the resources used by your application. This Dispose method clean ups all class based object and unsubscribe from different events.

More information


Next