2011年12月12日 星期一
2011年7月21日 星期四
Touch My heart
1.準備一個NXT可使用之愛心圖檔
2.程式
Robolab
NXT-G
NXC
task main()
{
SetSensor(S1,SENSOR_TOUCH);
while(true)
{
if(Sensor(S1) == 1)
{
GraphicOut(0,0,heart.ric);
}
else
{
ResetScreen();
}
}
}
2.程式
Robolab
NXT-G
NXC
task main()
{
SetSensor(S1,SENSOR_TOUCH);
while(true)
{
if(Sensor(S1) == 1)
{
GraphicOut(0,0,heart.ric);
}
else
{
ResetScreen();
}
}
}
Hello World! (Display "Hello World" on NXT)
如何在NXT的螢幕上顯示文字?
Robolab
NXT-G
NXC
語法
TextOut(int x,int y,string str,unsigned long options)
int x:文字 x 座標 ( 0 ~ 100 )
int y:文字 y 座標 ( 0 ~ 64 )
string str :想顯示的文字
unsigned long options :顯示模式
範例
持續顯示「Hello World!」在左上角,直到程式關閉。
task main()
{
while(true)
{
TextOut(0,0,"Hello World!");
}
}
Robolab
NXT-G
NXC
語法
TextOut(int x,int y,string str,unsigned long options)
int x:文字 x 座標 ( 0 ~ 100 )
int y:文字 y 座標 ( 0 ~ 64 )
string str :想顯示的文字
unsigned long options :顯示模式
範例
持續顯示「Hello World!」在左上角,直到程式關閉。
task main()
{
while(true)
{
TextOut(0,0,"Hello World!");
}
}
訂閱:
文章 (Atom)