Tuesday, October 13, 2009

Arduino 168 3.3 ttl serial

I've been trying to get my rbbb to communicate with my router which outputs 3.3 volt serial. In all reality I only need receive to work. However connecting it directly did not work. I went through the trouble of bulding a level shifte using a mosfet I bought at radioshack. I carefully put it together and used my parallax oscilloscope to look at the waves. It was dead on. I then tried connecting it to the arduino and it worked. I then soldered up a cable so that it would connect in place of the ftdi cable and it did not work. Something happens to the serial signal from input to rx input, As oppose to connecting a tx line directly to a pin. I have to check and see what is going on.

Ugh, found out what the problem was. On the RBBB the tx label actually stands for the tx label on the connector not the chip. So I probably could connect directly with 3.3v ttl without an issue. I will have to check this.

Thursday, October 8, 2009

i2c

i2c-core
i2c-dev
i2c-algo

i2c-gpio-custom
i2c-gpio

Wednesday, September 16, 2009

Remote Desktop Error 1702 getting session names. Error [1702]: The binding handle is invalid.

I have it working now, if you can't get Remote Desktop working. AKA it was working before and it suddenly stopped, an update may have gotten you. After some googling and a bit of fiddling I brought up the cmd prompt and got the Error[1702] error when typing qwinsta. The problem ended up being that somehow my Terminal Services were disabled.

I fixed it by going to control panel -> Administrative Tools -> Services

Scroll down to terminal services right click, go to properties and set to automatic, then right click and click start service. This may work for you, it did for me.

Wednesday, September 9, 2009

controlling pins on Openwr Kamikaze

Just for those people, (reminder to myself), looking for a way to easily control LEDs and other lights on a OpenWRT router running Kamikaze. Login to the router and install kmod-gpio-dev


$>opkg install kmod-gpio-dev
$>cd /proc/diag
$>cd leds
$>echo 0 > power


This should cause your power light to start blinking. You can send 0 or 1 to any of these LEDs listed in LEDs.

kmod-leds-gpio is not available

I was trying to compile the package kmod-leds-gpio in Kamikaze but it didn't show up. It seems that there is an issue with the latest version of default kernel_config for that module, in order to get it to work type


$>make kernel_menuconfig


Then go to

[*] LED support -->
[M] LED support for GPIO connected Pins

OpenWRT Kamikaze compile single package

I found the solution to this on this site
openwrt building

You have to type the following to compile a package without compiling the entire build tree


$> make package/i2c-gpio-custom/{clean,compile,install} V=99 DEVELOPER=1


This is from the top directory of Kamikaze.

Wednesday, April 15, 2009

AVB TOP Shot Pegasus

This turns out to be a great joystick, and I got it for only $5 at geeks.com They no longer seem to carry it, but its not hard to find., and its a fairly comfortable joystick. Well, its great because it also has force feedback.

No current windows driver, but it works in linux, and actually works with the iforce module, I tested it in ubuntu 8.10 and it worked.

Correction, you can get the current windows drivers from AVB
http://www.avbusa.com/driver/ffxp.exe

Just follow the directions at
http://scaryreasoner.wordpress.com/2008/07/18/getting-the-xbox-controller-to-work-with-linux-including-rumble-effect/

download the source code he refers to.

Type in ls /dev/input while the joystick is plugged in and then after disconnecting it. Figure out which event disappears. Use that event when calling

fftest /dev/input/event7

type numbers 1-5 for effects.

Friday, January 30, 2009

Interact V3 steering wheel analog digital mode

I wasn't able to find the manual to the InterAct V3 steering wheel for PlayStation. I'm doing some research with it. To change it from Analog Mode to Digital mode you have to hold the set button until it beeps and then press square for digital or O for Analog mode.

Wednesday, January 28, 2009

Eagle resistor clarification

I found this on

http://www.instructables.com/id/ENUTEALRUXEQHO8Y6O/

The general purpose fixed resistor devices are called either R-US (if you like the US zigzag line type
of schematics symbol) or R-EU (if you prefer the European simple rectangle.] The package options
are numerous, but make sense after you realize that there's a common format: "WWLL/SS" where WW is the body width, LL is the body length, and SS is the hole spacing, all in truncated millimeters. A typical 1/4W
resistor measures about 2.5mm in diameter and 7mm long; hole spacing depends on how you bend the
leads. So R-US_0207/10 is a 1/4W resistor with 10mm (actually 4*2.54, or 10.16mm, since we want to
stay close to a 0.1 inch (2.54mm) grid.) R-US_0207/2V is the same resistor mounted vertically with 2.54mm lead spacing. 1/8W resistors are similarly designated "R-US_0204/SS"

As I'm learning EAGLE

Sunday, January 4, 2009

iRobot C Sharp Create interface

I've found this great interface for the iRobot Create.
Here is the link

CreateOI interface


I've spent tonight extending the interface by adding a command that was left out that allows the iRobot Create to have each of its wheels controlled independently instead of dealing with having to figure out the weird arch system.

So first download the code from sourceforge, it will unzip into a folder named CreateOI, with CreateOI_Examples, iRobot, Kevin_Logging, and Visualizer as subfolders.
In order to add a command to the irobot.dll interface we need to go down a few levels to iRobot\iRobot folder

Now open irobot.csproj in Visual Studio.

The dll is broken down very hierarchically and is meant to work for both the roomba and the irobot create. In order to add my DirectDrive function I went to the Types.cs
under the CreateOI folder and added
public const byte DriveDirect = 145;
after
public const byte Pause_Resume_Stream = 145;

Then under Create.cs under Chasis folder

I added my DriveDirect function which is as following

///
/// This command lets you control the forward and backward
/// motion of Create’s drive wheels independently. It takes
/// four data bytes, which are interpreted as two 16-bit signed
/// values using two’s complement. The first two bytes specify
/// the velocity of the right wheel in millimeters per second
/// (mm/s), with the high byte sent first. The next two bytes
/// specify the velocity of the left wheel, in the same format.
/// A positive velocity makes that wheel drive forward, while a
/// negative velocity makes it drive backward.
/// • Serial sequence: [145] [Right velocity high byte]
/// [Right velocity low byte] [Left velocity high byte]
/// [Left velocity low byte]
/// • Available in modes: Safe or Full
/// • Changes mode to: No Change
/// • Drive Direct data byte 1: Right wheel velocity
/// (-500 – 500 mm/s)
/// • Drive Direct data byte 1: Left wheel velocity
/// (-500 – 500 mm/s)
///

///
///
///
public bool DriveDirect(Int16 leftVelocity, Int16 rightVelocity)
{
this.ErrorText = "";

bool bSafe = this.Mode == OI_Mode.Safe;
bool bFull = this.Mode == OI_Mode.Full;
bool bError = (!bSafe) & (!bFull);

//Push back at the user
if (bError)
{
throw new RoombaException("Roomba must be in Safe or Full mode before running Calling the Drive Function: ");
}

//Sample from the SCI Spec:
//Serial sequence: [145] [Right velocity high byte][Right velocity low byte] [Left velocity high byte][Left velocity low byte]


//divide up leftVelocity & rightVelocity into 2 bytes each
byte leftVelocityHi = (byte)( leftVelocity >> 8);
byte leftVelocityLo = (byte)( leftVelocity & 255);

byte rightVelocityHi = (byte)(rightVelocity >> 8);
byte rightVelocityLo = (byte)(rightVelocity & 255);

bool bSuccess = false;

List lSend = new List();
lSend.Add(CreateOI.OpCode.DriveDirect);
lSend.Add(rightVelocityHi);
lSend.Add(rightVelocityLo);
lSend.Add(leftVelocityHi);
lSend.Add(leftVelocityLo);

string sDebugSend = "[" + lSend[0].ToString() + "][" + lSend[1].ToString() + "][" + lSend[2].ToString() + "][" + lSend[3].ToString() + "][" + lSend[4].ToString() + "]";

try
{
Log.This("Drive Action: " + sDebugSend, c_sCommonChassis, this.Log_OICommands);

this.IO.RtsEnable = false;
this.IO.Write(lSend.ToArray(), 0, lSend.Count);
//this.Macro.SetAction("DRIVE\t" + sDebugSend);

this.p_leftVelocity = leftVelocity;
this.p_rightVelocity = rightVelocity;
//this.p_rRadius = rAngle; //may need to add equivalent for this class

bSuccess = true;
Log.This("Drive Action Success " + bSuccess.ToString() + " leftVelocity: " + this.p_leftVelocity.ToString() + " rightVelocity: " + this.p_rightVelocity.ToString(), c_sCommonChassis, this.Log_OICommands);
}
catch (Exception ex)
{
Log.This("Drive Action Fail: " + ex.Message, c_sCommonChassis, this.Log_OICommands);
}

return bSuccess;
}


Then save all changes and goto the iRobot project descriptor at the very top of the Solution Explorer, right click it and click rebuild. The iRobot.dll will be located in
CreateOI\CreateOI\iRobot\iRobot\bin\Release

add this .dll under References in solution explorer for whatever project you may have and it will allow you to use the DirectDrive function I implemented