#!/usr/bin/env python
#
 
import nxt
import sys
import tty, termios
import nxt.locator
from nxt.sensor import *
from nxt.motor import *
 
brick = nxt.locator.find_one_brick()
left = nxt.Motor(brick, PORT_B)
right = nxt.Motor(brick, PORT_C)
both = nxt.SynchronizedMotors(left, right, 0)
leftboth = nxt.SynchronizedMotors(left, right, 100)
rightboth = nxt.SynchronizedMotors(right, left, 100)
 
def getch():
    fd = sys.stdin.fileno()
    old_settings = termios.tcgetattr(fd)
    try:
        tty.setraw(fd)
        ch = sys.stdin.read(1)
    finally:
        termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
    return ch
 
ch = ' '
print "Ready"
while ch != 'q':
    ch = getch()
 
    if ch == 'w':
        print "Forwards"
        both.turn(100, 360, False)
    elif ch == 's':
        print "Backwards"
        both.turn(-100, 360, False)
    elif ch == 'a':
        print "Left"
        leftboth.turn(100, 90, False)
    elif ch == 'd':
        print "Right"
        rightboth.turn(100, 90, False)
 
print "Finished"

by 아발로온v 2015.05.04 16:19

<htmL>
<head>

<title>HoHo Dot Com</title></head>
 

<body><center>
<table border=3 cellpadding=15 width=600>
<tr>
<th colspan=3>
<h2>HoHo's Raspberry Pi Website</h2>
<p align=left style='font:12'>
<tr>
<h2>
<tr>
<th>경 제 분 야<th>산 업 분 야<th>I T 분 야
<tr>
<th colspan=3><h3>오늘의 날씨</h3> ( 동영상 or 사진표시 )
<tr>
<th colspan=3>가입하기 ( 가입시 더많은 정보제공 )
<br>[     ]     [     ]
<br>[     ]     [     ]
<br>[     ]     [     ]
<tr>
<th colspan=3>광고 1 ( 사진 )          광고 2 ( 글 )
</table>
</body>
</htmL>

by 아발로온v 2015.03.25 01:13
by 아발로온v 2015.03.18 13:49
| 1 2 3 4 5 6 |