Official Sparky Thread - Sparky Jr USB

Soooo…

I got everything almost all wired up. I downloaded arduino, but I’m sure I’m not doing something correctly. How do you access the configuring program? I saved the .ccp, .pde and .h file, plugged up the programmer to sparky jr, got some blinky lights and some error messages. Almost positive I missed something or don’t have the drivers in correctly, but i’t’s doing something. SCreenshots tomorrow. Have some unfortunate wiring I need to fix first…

nice, nice and one of art’s tek cases ftw…must be devs project your are working on…did you drill the madcatz pcb in order to mount it to the pcb holder? thas a great idea i might have to do that as well…thanx for posting these pics, since i plan on getting a tek case as well…gives me good visual indicators of how stuff will fit in there and space available :slight_smile:

hey there
can you give a little more insight into the error. is it a script error or an uploading error.

first thing you should do before uploading in the arduino IDE is under the tools menu
under board -> you should choose the one with atmega328
second is under the serial port, it should be something like port 4 or 5
lastly, if you are still having issues, the arduino ide download comes with FTDI drivers for vitrual com ports

let me know, more than willing to help as long as i get all the info

hey there
can you give a little more insight into the error. is it a script error or an uploading error.

first thing you should do before uploading in the arduino IDE is under the tools menu
under board -> you should choose the one with atmega328
second is under the serial port, it should be something like port 4 or 5
lastly, if you are still having issues, the arduino ide download comes with FTDI drivers for vitrual com ports

let me know, more than willing to help as long as i get all the info

Yep, I drilled 3 holes in the pcb holder to mount it with 4-40 screws. Used a countersink bit to make sure the screw heads don’t touch the board. I’d use flathead screws if I had a choice. There are a total of 4 boards in there. The MC C and Sparky Jr are up top, the MasterStrike and 360 fightpad on the bottom. I can unsnap the entire holder to access the Masterstrike (not much needs to be accessed for the 360 board once piggybacked). Just make sure you figure out what you need to access and what direction the PCBs will face once mounted inside the case. Took a while to sort that out, and I still need to go back and rewire a few things

I think it may be a script error I was getting. I downloaded the virtual com ports and think I had it running thru COM4, not the serial port. I selected one of the boards with the ATMEGA328, but can’t remember which now. It was late and the misses needed some tending to, so I didn’t get a chance to dig into it. That and I have a wiring issue to address (don’t even want to talk about it). I’ll try again this evening and post up my screenshots of what’s going on.

sounds good. keep me posted.
if it is a script error, try to compile (the play arrow) before upload.
it will automagically try to highlight the line row with the error.

Will do. I know I hit the play button and the arc eyes did it’s light show thing, but I did see some error message in red at the bottom. Didn’t notice if anything was highlited though (but didn’t look either). Since I couldn’t figure out the configurator (sp?) I made the changes by hand like you did in your video. I also used the stock lighting setup that was on the page. However, that wiring issue I was having probably prevented me from testing to see if it sent anything down (again, don’t want to talk about it just yet…)

So, the computer recognises the programmer and some signal was sent to Sparky. So something is working. Just not sure what is and what isn’t.

OK… went to tools. Set it for Arduinio pro 5v w. atmege328 (also tried the duelaminove w/328). Control panel shows an FTDI device on COM3. Opened up sparke.pde. Lights cycle. When I hit the run button, I get this:

Sparky:36: error: stray ‘#’ in program
Sparky:36: error: stray ‘#’ in program
Sparky:37: error: stray ‘#’ in program
Sparky.cpp:42:13: error: invalid digit “9” in octal constant
Sparky:37: error: stray ‘#’ in program
Sparky.cpp:42:21: error: invalid suffix “FF00” on integer constant
Sparky:38: error: stray ‘#’ in program
Sparky.cpp:43:13: error: invalid digit “9” in octal constant
Sparky:38: error: stray ‘#’ in program
Sparky.cpp:43:21: error: invalid suffix “FF” on integer constant
Sparky:39: error: stray ‘#’ in program
Sparky:39: error: stray ‘#’ in program
Sparky:40: error: stray ‘#’ in program
Sparky:40: error: stray ‘#’ in program
Sparky:41: error: stray ‘#’ in program
Sparky.cpp:46:13: error: invalid digit “9” in octal constant
Sparky:41: error: stray ‘#’ in program
Sparky.cpp:46:21: error: invalid suffix “FFFF” on integer constant
Sparky:42: error: stray ‘#’ in program
Sparky:42: error: stray ‘#’ in program
Sparky:43: error: stray ‘#’ in program
Sparky:43: error: stray ‘#’ in program
Sparky:44: error: stray ‘#’ in program
Sparky:44: error: stray ‘#’ in program
Sparky:190: error: stray ‘#’ in program
Sparky:197: error: stray ‘#’ in program
Sparky:198: error: stray ‘#’ in program
Sparky:266: error: stray ‘#’ in program
Sparky:266: error: stray ‘#’ in program
Sparky:296: error: stray ‘#’ in program
Sparky:314: error: stray ‘#’ in program
Sparky:314: error: stray ‘#’ in program
Sparky:315: error: stray ‘#’ in program
Sparky:315: error: stray ‘#’ in program
Sparky:321: error: stray ‘#’ in program
Sparky:323: error: stray ‘#’ in program
Sparky:323: error: stray ‘#’ in program
Sparky:324: error: stray ‘#’ in program
Sparky:324: error: stray ‘#’ in program
Sparky:324: error: stray ‘#’ in program
Sparky:324: error: stray ‘#’ in program
Sparky:343: error: stray ‘#’ in program
Sparky:431: error: stray ‘#’ in program
Sparky:431: error: stray ‘#’ in program
Sparky:448: error: stray ‘#’ in program
Sparky:467: error: stray ‘#’ in program
Sparky:468: error: stray ‘#’ in program
Sparky:468: error: stray ‘#’ in program
Sparky:469: error: stray ‘#’ in program
Sparky:469: error: stray ‘#’ in program
Sparky:545: error: stray ‘#’ in program
Sparky:546: error: stray ‘#’ in program
Sparky.cpp:551:15: error: invalid suffix “FF00” on integer constant
Sparky:547: error: stray ‘#’ in program
Sparky.cpp:552:15: error: invalid suffix “FF” on integer constant
Sparky:548: error: stray ‘#’ in program
Sparky:549: error: stray ‘#’ in program
Sparky:550: error: stray ‘#’ in program
Sparky.cpp:555:15: error: invalid suffix “FFFF” on integer constant
Sparky:551: error: stray ‘#’ in program
Sparky:552: error: stray ‘#’ in program
Sparky:2: error: variable or field ‘serialEvent’ declared void
Sparky:2: error: expected `)’ before 'port’
Sparky:3: error: ‘import’ does not name a type
Sparky:4: error: ‘Serial’ does not name a type
Sparky:10: error: ‘Sparky’ does not name a type
Sparky:18: error: expected unqualified-id before ‘[’ token

Can you mention what you changed in the files.
Also, are you using the most recent ones from here

you should have 4 files in a directory called Sparky.
check the following

  1. your sketch must be in a folder named Sparky
  2. you should have 4 files
    Sparky.pde
    SparkyClass.h
    SparkyClass.pde
    SparkyConfig.h

seems from the above you may have a file missing

I’ll check to see if there were 3 files or 4 in the folder. Can’t remember now. I tried it two ways, once making the changes to the colors, and once opening a new window running the program as coded with no changes.

when you open the PDE it should automagically open the other 3 files associated with it

It did open other files, but I think it was only 3, not 4. I’ll make sure the Sparky folder has all 4 tonight and try again.

I did get most of my wiring problem sorted out. Still one or two things I need to do to get it right. Need to chcek something on the masterstrike and the MCC

Hmm… Got all 4 files in Sparky folder. Still got this:

snipppp

Hey spenz
Upon further inspection there are no files it references called Sparky.cpp in arduino folder. Not sure what that is about

2 things I can think of is a missing bootloader on the chip ( try burning a new one from the tools menu)
Or the second being that you are attempting to run the processing files in the arduino IDE. The only reason I am guessing at this is seeing the error on the serialEvent line. This is part of the arduino/firmata library for processing IDE

I have been unable to reproduce this error.
Shoot me an email

Okay, i have confirmed that the only way one would get those errors was using the wrong IDE for the wrong files.

In this instance it was Processing Sparky.pde was opened and attempted to compile in Arduino IDE

FYI. for those not familiar with Processing. It’s whats used to build the interface portion of Sparky Jr. (See first page)
Also, Processing is free to download Download \ Processing.org which is different but similar to Arduino IDE Arduino - Software

To all following this, please note your results should be different from mine. I always have these issues, half becaise my computer hates drivers, half because of me! I’ll report once I have good news.

shit happens to the best of us man, but hopefully now thats resolved and you may continue on. im anxious to see how your project turns out :slight_smile:

Well, the good news is the programmer seems to work! With the correct files it uploaded the sketch to Sparky. The bad news is it doesn’t look like the LEDs correspond with what the program says is supposed to light. I need to redo the RGB chain tomorrow so I’ll double check everything again and reload.

Getting closer…

inside Sparky.pde



/*
  SELECT YOUR BOARD & VERSION
  @version -  leave this as 1 (official release) unless you are not using
              Sparky Junior
  --------------------------------------------
  0 = Sparky
  1 = Sparky Junior
  2 = Sparky Shield
  3 = Sparky Sanguino
  4 = Dual Strike
  5 = 32teeth Sparky
  6 = Sparky Jr w/ PWM wire hack
*/
**const int board = 1;**
const int revision = 0;


@Spenzalii
make sure you set your board to the appropriate version. this will most likely remedy the LED mismatch, unless it’s a wiring thing.

don’t worry about const int revision, thats for something different

manually changing your color schema
open SparkyConfig.h
only edit below where it says DEFINE YOUR PATTERN and use plain english color names



/*
DEFINE YOUR PATTERN
See the color map above
Use the english word for your color selection
--------------------------------------------
available colors
============================================
red, green, blue, purple, cyan, yellow, white
--------------------------------------------
*/
int pattern[12] = {
	**purple**,// 1x punch
	**cyan**,// 2x punch (ex with punch buttons SFIV & SSFIV)
	**blue**,// 3x punch (ultra with punch buttons SFIV & SSFIV)
	**white**,// 4x punch
	**purple**,// 1x kick
	**cyan**,// 2x kick (ex with kick buttons SFIV & SSFIV)
	**blue**,// 3x kick (ultra with kick buttons SFIV & SSFIV)
	**white**,// 4x kick
	**yellow**,// P1 + K1 (throw SFIV & SSFIV)
	**red**,// P2 + K2 (focus SFIV & SSFIV)
	**green**,// P3 + K3 (taunt SFIV & SSFIV)
	**white**// P4 + K4
};


alternatively if you are using SVN client

  1. create a new repository for Sparky - READ ONLY PUBLIC SVN
  2. then check out a working copy to somewhere on your machine
  3. browse to your local repository
  4. open Processing Files -> Sparky -> Sparky.pde using Processing IDE
  5. hit Run once the Processing IDE opens and you will be running the configurator
  6. change your colors
  7. once happy with your edits click ‘Save Config File’ (this will create the SparkyConfig.h file in the Arduino folder)
  8. Got back to Arduino IDE and open Arduino Files -> Sparky -> Sparky.pde using Arduino IDE
  9. Upload to board

I’ll have a good look at this as soon as I finish up the new harness