Saturday, October 29, 2011

std::vector LNK2022

I was getting this error when trying to use a std::vector in visual c++ the solution ended up being to use the Multi-Threaded Debug DLL (/MDd) options under Properties -> C/C++ -> Code Generation.

Saturday, December 18, 2010

OpenNI python Windows 7 64 bit

While I'm waiting for my membership approval, I wanted to post this out there since I lost a bit of time trying to get it to work. If you are trying out OpenNI and are trying to run Redist.py without success. My problem ended up being that on Windows 7 64 bit, Programs are installled in a different location on the registry. In order to rectify this, run a search and replace on Redist.py and search for this:
r"SOFTWARE\

and replace with this:
r"SOFTWARE\Wow6432Node\

Monday, March 29, 2010

git stash

git stash is really neat for working with different branches. Lets same I'm in one developer branch in the middle of something and I want to switch branches to save something. Well rather than having to make a temporary branch so I don't lose my work and I can use git stash.

If we make a change to a file and then try to change branches we get this

santiago@santiago-desktop:~/arduino-0016/hardware/libraries/USB_Host_Shield$ git checkout master
error: You have local changes to 'Max_LCD.cpp'; cannot switch branches.

So what we do is run git stash, which tucks things away onto a local stack

santiago@santiago-desktop:~/arduino-0016/hardware/libraries/USB_Host_Shield$ git stash
Saved working directory and index state "WIP on dev: 0209cfa... changed MAX3421E to Max3421e for case sensitive compilers"
HEAD is now at 0209cfa changed MAX3421E to Max3421e for case sensitive compilers
(To restore them type "git stash apply")

santiago@santiago-desktop:~/arduino-0016/hardware/libraries/USB_Host_Shield$ git checkout master
Switched to branch "master"
//inspect changes, now I need to switch back

santiago@santiago-desktop:~/arduino-0016/hardware/libraries/USB_Host_Shield$ git checkout dev
Switched to branch "dev"

santiago@santiago-desktop:~/arduino-0016/hardware/libraries/USB_Host_Shield$ git stash pop
# On branch dev
# Changed but not updated:
# (use "git add ..." to update what will be committed)
#
# modified: Max_LCD.cpp
#
# Untracked files:
# (use "git add ..." to include in what will be committed)
#
# Max3421e.o
# Max_LCD.cpp~
# Max_LCD.o
# Usb.h~
# Usb.o
no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (da0cd6de12e2128986ffdfe053f0c81cb5b264b3)

This makes a complicated situation much easier!

git simple upload branch

So I just got involved using git for the USB host shield. Really neat arduino project. Well its hosted on github, and while git seems awesome in its capabilities, it makes it more difficult to get started. I'm suppose to work in the dev branch, and I set up my ssh keys according to the website. And I have read/write priveleges, but it still took me an hour and a half to figure out how to download the branch, make a change and upload to the dev branch. Here is how you do it.


git clone git@github.com:felis/USB_Host_Shield.git
git checkout --track -b dev origin/dev
git commit -a
git push origin dev

So you clone the remote directory to your own, then you checkout the branch and give it a local name, in this case dev. Then you make commits, which are local. Then you push your commits to the server. the origin keyword keeps the url of where you got the branch, or something like that. You can also list the branches and find out which one you're on using git branch -a

Monday, March 22, 2010

Arduino Liquid Crystal initialization issues

I have been having some nasty issues with Liquid Crystal. Typical, starts up fine after a few reboots. Finally tracked down the issue. Need to increase delay after a clear signal has been sent from 2000 microseconds to 16000 microseconds. There is probably a middle ground somewhere as 16000 is a long time to send a clear command, however it fixes it for the moment.

Thursday, January 14, 2010

Mouse working in OPENWRT

In order to get the mouse to work in OpenWRT, you need to have all the proper USB modules loaded. I have covered this in the past in showing how to get the Pegasus joystick to work. After everything is loaded, if you have done it right, if you plug in the mouse into the router and check dmesg the mouse should show up, but it will not be registered under /dev/mouse0. In order to get that part to work you have to go under make kernel_menuconfig and go to
Device Drivers
->input device support
[M] Mouse

remake the kernel make all V=99

After that is done the kernel module is found under
Kamikaze/trunk/build_dir/linux-brcm47xx/linux-2.6.30.8/drivers/input/mousedev.ko

just scp that over to root@OpenWrt:/lib/modules/2.6.30.8

yours may vary slightly if you have a newer kernel

Then go to

root@OpenWrt:/etc/modules.d

then
vi 72-mouse

and insert by pressing i, type
mousedev

then exit and save by typing :wq! (basic vi)

then reboot the router and try plugging in a mouse

then test it by using

cat /dev/mouse0

I left the mouse stuck in and it didn't work so I unplugged it and replugged it and it worked just fine. I can look into this issue in the future.