YAPI.FreeAPI();}}}12.4. Control of the module partEach module can be controlled in a similar manner, you can find below a simple sample programdisplaying the main parameters of the module and enabling you to activate the localization beacon.using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{class Program{static void usage(){string execname = System.AppDomain.CurrentDomain.FriendlyName;Console.WriteLine("Usage:");Console.WriteLine(execname + " or logical name> [ON/OFF]");System.Threading.Thread.Sleep(2500);Environment.Exit(0);}static void Main(string[] args){YModule m;string errmsg = "";if (YAPI.RegisterHub("usb", ref errmsg) != YAPI.SUCCESS) {Console.WriteLine("RegisterHub error: " + errmsg);Environment.Exit(0);}if (args.Length < 1) usage();m = YModule.FindModule(args[0]); // use serial or logical nameif (m.isOnline()) {if (args.Length >= 2) {if (args[1].ToUpper() == "ON") {m.set_beacon(YModule.BEACON_ON);}if (args[1].ToUpper() == "OFF") {m.set_beacon(YModule.BEACON_OFF);}}Console.WriteLine("serial: " + m.get_serialNumber());Console.WriteLine("logical name: " + m.get_logicalName());Console.WriteLine("luminosity: " + m.get_luminosity().ToString());Console.Write("beacon: ");if (m.get_beacon() == YModule.BEACON_ON)Console.WriteLine("ON");elseConsole.WriteLine("OFF");Console.WriteLine("upTime: " + (m.get_upTime() / 1000 ).ToString() + " sec");Console.WriteLine("USB current: " + m.get_usbCurrent().ToString() + " mA");Console.WriteLine("Logs:\r\n" + m.get_lastLogs());} else {Console.WriteLine(args[0] + " not connected (check identification and USB cable)");}YAPI.FreeAPI();}}}12. Using Yocto-GPS with C#82 www.yoctopuce.com