123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|427|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Off Topic -> Spinal's Nunchuck GameBoy

Fri, 30 Sep 2016, 03:44
spinal
Well, that was fun...

-=-=-
Check out my excellent homepage!
Fri, 30 Sep 2016, 03:44
Jayenkai
Oooh!
Fri, 30 Sep 2016, 04:02
spinal
There's a touch screen on there too, and an SD slot.
All useless so far and the arduino nano is way too slow to do a real game, it's like programming an old 8-bit again, it takes a couple of seconds to draw a full 230x240 screen.

The game is from here - https://vilaca.eu/handheld-arduino-color-console/

With a few teaks as it didn't work with my screen, nor was it expecting a nunchuck.

-=-=-
Check out my excellent homepage!
Fri, 30 Sep 2016, 04:03
Jayenkai
Maybe time for an RPi!?
Fri, 30 Sep 2016, 12:50
spinal
ARGH!!!!!!!!!!!!!!!!



-=-=-
Check out my excellent homepage!
Sat, 01 Oct 2016, 02:49
spinal
I don't suppose someone can explain to me what the hell c++ expect me to do here...





It very much IS declared!!!

-=-=-
Check out my excellent homepage!
Sat, 01 Oct 2016, 03:00
Jayenkai
The "..in this scope" bit suggests that joystick isn't accessing the variables of the main file.
Did c++ do all that "Public/Private" stuff? I honestly can't remember which language is which anymore!!

Try setting the "Wii" stuff to Public, and see if that fixes it.

-=-=-
''Load, Next List!''
Sat, 01 Oct 2016, 03:21
spinal
nope.
Sat, 01 Oct 2016, 03:29
spinal
Current avenue...

joystick.cpp


joystick.cpp is included in a couple of other files, however surely that "WiiClassicControl Wii;" is doupble protected with the #ifndef's so surely can NEVER be defined more than once, but I still get...


One of the reasons I HATE the 'very portable' C based languages.

-=-=-
Check out my excellent homepage!
Mon, 03 Oct 2016, 04:30
shroom_monk
As a general rule, if you're including files in C / C++, you should only include header (.h, .hpp) files. When you compile your program, the compiler will compile every .c / .cpp file separately, then link them all together to create the final executable. So if one your files includes another .cpp file, you have defined the contents of that .cpp file twice - once in the original version, and once in the file you included it into.

|edit| To clarify slightly, the cause of your 'not in scope' error is that Wii is in scope in the code snippet you have posted, so that compiles just fine. However, when the compiler then compiles joystick.cpp, Wii hasn't been defined in that file! Hence the error. |edit|

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Tue, 04 Oct 2016, 10:19
spinal
i static'd the variable, fixed it right up.
just needs some sort of plastic boxy tning now.

-=-=-
Check out my excellent homepage!
Wed, 05 Oct 2016, 02:12
shroom_monk
I mean, that will technically make it work. Though I'd still be inclined to caution that including those CPP files will come back to bite you again later!

(renaming them to .hpp would have solved it without the static)

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Wed, 05 Oct 2016, 03:39
Jayenkai
*hugs Monkey*
Sat, 08 Oct 2016, 08:39
spinal
Right, currently got working -

tft screen
touch screen
wii classic controller

can I hell get the sd card to work! I managed to find a forum post some place where a couple of people were attempting to get screen+touch+sd working on this device, but their code links are dead, so I check the guys git hub where he posted them, they were deleted for being 'old' ... !!

Why would you do that?!!

-=-=-
Check out my excellent homepage!
Sun, 09 Oct 2016, 06:34
spinal
Just going to drop this here before I loose it...



Note - I can get the sd card to work if the tft screen is configured wrong, that is, not working. Might have to look into interrupts or something to switch off the tft when reading the card or something.

-=-=-
Check out my excellent homepage!
Sun, 09 Oct 2016, 07:38
rockford
That was my thinking - there's perhaps not enough power - CPU and electricity, to run the screen AND the SD card reader a the same time.