This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jaraco.nxt import * | |
from jaraco.nxt.messages import * | |
conn = Connection('/dev/tty.NXT-DevB') | |
cmd = SetOutputState( | |
i, | |
motor_on=True, | |
set_power=motorpower, | |
run_state=RunState.running, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sdl2 | |
sdl2.SDL_Init(sdl2.SDL_INIT_JOYSTICK) | |
joystick = sdl2.SDL_JoystickOpen(0) | |
while True: | |
sdl2.SDL_PumpEvents() | |
#depending on the gamepad this gives you a value between -32768 and +32768 | |
#or between 0 and 32768 | |
joy_x = sdl2.SDL_JoystickGetAxis(joystick, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo easy_install pip | |
pip install numpy | |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
brew tap homebrew/science | |
brew install opencv | |
pip install jaraco.nxt | |
hg clone https://bitbucket.org/antonvh/robot-sumo robot-sumo | |
cd robot-sumo/blob_recog | |
python blob_recognition.py |
NewerOlder