Spy Gear®

  • Home
  • The Gear
    • New Gear
    • Popular Gear
    • View All Spy Gear
    • Spy Gear International
    • Spy Gear Video
  • App HQ
    • Download TRAKR Apps
    • Build TRAKR Apps
    • Share TRAKR Apps
  • Forum
  • Help
    • TRAKR Setup
    • Capture Cam Setup
    • TRAKR Troubleshooting
    • TRAKR Apps Help
    • FAQ: TRAKR & Website
    • Spy Gear Products
    • Parents & Privacy
    • Contact Us

Agents: Sign in

Create Account |  Forgot Password?

Has anyone tried to control a device using the TRAKR's usb?

Discussions about Apps created by users, including general coding, the TRAKR API, and compiling.
Post a reply
89 posts • Page 9 of 9 • 1 ... 5, 6, 7, 8, 9

Re: Has anyone tried to control a device using the TRAKR's u

Postby stampede » Sun Jun 12, 2011 1:15 pm

I just noticed the WriteByUSB folder in the trakr package.
I put ConProg.bin in the Apps folder.
Ran it from the remote, I lose communication with the Trakr.
fiddled with SPI/USB. ticked off the trakr (no red button until I removed power for a while).

Anyone else play with these guys?
stampede
 
Posts: 45
Joined: Wed Jun 01, 2011 7:21 pm
Top

Re: Has anyone tried to control a device using the TRAKR's u

Postby krash » Mon Jun 13, 2011 6:14 pm

stampede wrote:I just noticed the WriteByUSB folder in the trakr package.
I put ConProg.bin in the Apps folder.
Ran it from the remote, I lose communication with the Trakr.
fiddled with SPI/USB. ticked off the trakr (no red button until I removed power for a while).

Anyone else play with these guys?


I've never noticed the WriteByUSB folder. I'll see if I can find the folder and look through some of the code.

Were there any comments in ConProg.c program that indicate what the app is supposed to do?

The SPI/USB switches are mainly used for firmware upgrades. As far as I can tell they haven't been used for anything else--at least no one has found any use for these switches.
Cheers,

Krash


“Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men.” –John Emerich Edward Dalberg Acton
User avatar
krash
 
Posts: 160
Joined: Sun Oct 10, 2010 6:56 am
  • Website
Top

Re: Has anyone tried to control a device using the TRAKR's u

Postby krash » Mon Jun 13, 2011 6:49 pm

I checked the writebyusb folder. there are no .c files in the folder. I suppose one could copy the .bin files to the apps folder one at a time and run each one to see if they do anything though it might just be that you'll have to keep resetting the TRAKR, lol. I can't tell yet if there is software that is supposed to run on the PC that communicates through the usb/spi port, but I only had a few minutes to look while I was on break. May check later.
Cheers,

Krash


“Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men.” –John Emerich Edward Dalberg Acton
User avatar
krash
 
Posts: 160
Joined: Sun Oct 10, 2010 6:56 am
  • Website
Top

Re: Has anyone tried to control a device using the TRAKR's u

Postby trakr001 » Tue Sep 20, 2011 1:50 am

krash wrote:
rorschachuk wrote:Firstly, I doubt the two separate lines in Start to initialise output mode on GPC0 and GPC1 will work, I think you'd need to do both in one line as per my example, otherwise only the second one would work. Secondly, if you're checking two buttons, you shouldn't be switching OFF the pin you're not switching ON in the two if checks, because that'll stop you being able to press A and B together to switch on both simultaneously. As written, you'd be switching off both pins immediately after setting one or other (but not both) on.

Code: Select all
#include "svt.h"               //include Official API
#include "JAPI.h"              //include "Secret sauce" API

#define GPC0 (1<<0)            //bitmask for pin GPC0 = 00000001
#define GPC1 (1<<1)            //bitmask for pin GPC1 = 00000010
#define GPC2 (1<<2)            //bitmask for pin GPC2 = 00000100
#define GPC3 (1<<3)            //bitmask for pin GPC3 = 00001000
#define GPC4 (1<<4)            //bitmask for pin GPC4 = 00010000
#define GPC5 (1<<5)            //bitmask for pin GPC5 = 00100000
#define GPC6 (1<<6)            //bitmask for pin GPC6 = 01000000
#define GPC7 (1<<7)            //bitmask for pin GPC7 = 10000000

int keystate;                  //define "keystate" as integer

void Start() {
    //Set output mode for pins GPC0 and GPC1
    JAPI_SetIoOutputMode(GPC0+GPC1);
}
bool Run() {
    keystate=GetRemoteKeys();      //TRAKR remote control key pressed
                                   //assign to keystate
    if (keystate > 0) {              //if keystate is greater than 0
       if(keyState&KEY_INPUT1)  {   //Button A pressed (motor forward)
            JAPI_SetIoHigh(GPC0);     //Set GPC0 pin high (3.3v)
        } else {
            JAPI_SetIoLow(GPC0);  //Switch off pin GPC0
        }
       if(keyState&KEY_INPUT2)  {   //Button B pressed (motor reverse)
            JAPI_SetIoHigh(GPC1);     //Set GPC1 pin high (3.3v)
        } else {
            JAPI_SetIoLow(GPC1);  //Switch off pin GPC1
        }
       if(keystate & KEY_HOME) {    //if Home button pressed
         return false;             //this will end the loop
        }
    }
    return true;                   //loop will repeat until false
}

void End() {                    //Program end - switch off both pins
    JAPI_SetIoLow(GPC0+GPC1);
}

Try this?

RorschachUK

"Secondly, if you're checking two buttons, you shouldn't be switching OFF the pin you're not switching ON in the two if checks, because that'll stop you being able to press A and B together to switch on both simultaneously."

If you are connecting the motor directly to the pins, if both pins go high, I think this would result in "braking" the motor (stopping it not ruining it). This is fine. However if you connect to an H-bridge circuit or IC, if both pins go high at the same time, this may burn out the circuit or IC.

Is there another way to ensure that both pins will not go high at the same time (A and B pressed at the same time and frying the circuit) yet ensure that the motor will remain in forward motion as long as button A is pressed yet stop when released? OR the motor will remain in reverse motion as long as button B is pressed yet stop when released?

When I compile this, it doesn't work. It comes up with error 9. Whatever that is. I'm trying to put a BB gun on my TRAKR, but I need this code snippet, or a code snippet, that will serve as a switch with GPC0 and GPC1 as a switch for a tesla coil. I need an app that will allow this when a button is pushed: Image do you think you could post an app for this and send me the link to it, then tell me how to wire it?
"I don't mind flying, but what you're doing is suicide!"
―Obi-Wan to Anakin Skywalker
trakr001
 
Posts: 128
Joined: Fri Dec 24, 2010 6:08 pm
Top

Re: Has anyone tried to control a device using the TRAKR's u

Postby cpt_hans » Tue Sep 20, 2011 4:52 pm

Trakr001,
I'll cook up a wiring diagram for you. Krash's code will work great for what you want to do. I'll re-post his code here when I post the wiring diagram.

-CPT_Hans
User avatar
cpt_hans
 
Posts: 332
Joined: Sun Dec 26, 2010 1:58 pm
Location: Missouri
Top

Re: Has anyone tried to control a device using the TRAKR's u

Postby trakr001 » Tue Sep 20, 2011 5:02 pm

Thanks, I'll keep watching. What are you trying to control?
"I don't mind flying, but what you're doing is suicide!"
―Obi-Wan to Anakin Skywalker
trakr001
 
Posts: 128
Joined: Fri Dec 24, 2010 6:08 pm
Top

Re: Has anyone tried to control a device using the TRAKR's u

Postby opretive calmac » Wed Oct 05, 2011 12:41 pm

whats the radar on the trakr
opretive calmac
 
Posts: 2
Joined: Wed Sep 14, 2011 10:53 am
Top

Re: Has anyone tried to control a device using the TRAKR's u

Postby lion xl » Thu Feb 09, 2012 12:28 pm

All who are interested in hacking the trakr USB port, here is a tutorial on using USB with the AVR chipset (ATTiny). although the code would more than likely have to be re-written, at least some of the concepts covered would form a basis for getting started....

http://codeandlife.com/2012/01/22/avr-attiny-usb-tutorial-part-1/
User avatar
lion xl
 
Posts: 74
Joined: Sat Dec 25, 2010 11:07 am
Top

Re: Has anyone tried to control a device using the TRAKR's u

Postby cpt_hans » Thu Feb 09, 2012 8:10 pm

That's good stuff! It was pretty straightforward hardware stuff (my forte) until part 3. It's going to take me a while to digest all of that code. C programming isn't my strong point.

I don't know what would be required to 'port' this tutorial to the Trakr. NUSB.h in the Internals folder has a lot of USB stuff. I'll do some comparisons to see if there's any commonality, or other useful info we can glean.

Perhaps RorschachUK would have some insights.

-CPT_Hans
User avatar
cpt_hans
 
Posts: 332
Joined: Sun Dec 26, 2010 1:58 pm
Location: Missouri
Top

Previous

Post a reply
89 posts • Page 9 of 9 • 1 ... 5, 6, 7, 8, 9

Return to User-Created Apps

Who is online

Users browsing this forum: No registered users

Share
Missions
Modulator


  • Board index
  • The team • Delete all board cookies • All times are UTC - 8 hours [ DST ]

Spin Master logo A Spin Master website - Copyright ©2013 - All Rights Reserved.

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group