-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSE-demo.nxc
47 lines (41 loc) · 1.65 KB
/
SE-demo.nxc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/************************************************************************/
/* */
/* Program Name: SE-demo.nxc */
/* ============================= */
/* */
/* Copyright (c) 2008 by mindsensors.com */
/* Email: info (<at>) mindsensors (<dot>) com */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; version 3 of the License. */
/* Read the license at: http://www.gnu.org/licenses/gpl.txt */
/* */
/************************************************************************/
/*
* When Who Comments
* 04/20/09 Deepak Patil Initial authoring.
*/
#include "SE-lib.nxc"
task main()
{
int ob;
string msg, x;
while (true)
{
SetSensorLowspeed(S4);
NumOut(0, LCD_LINE1, SensorUS(S4), false);
SumoEyes_SetLongRange(S3);
ob = SumoEyes_DetectObstacleZone(S3);
msg = "long: ";
x = SE_OBZoneToString(ob);
msg = StrReplace(msg, 6, x);
TextOut(0, LCD_LINE2, msg, false);
SumoEyes_SetShortRange(S3);
ob = SumoEyes_DetectObstacleZone(S3);
msg = "Short: ";
x = SE_OBZoneToString(ob);
msg = StrReplace(msg, 6, x);
TextOut(0, LCD_LINE3, msg, false);
}
}