|
Post by powersoft on Jul 21, 2015 10:15:34 GMT -8
Hi James,
Thanks for this. I will for sure let you know my findings. When I use the arduino insteadof the Due could I still use this lib, or should I change it to the version for the arduino?
With kindly regards,
Jan
|
|
|
Post by jamesbowman on Jul 21, 2015 10:43:18 GMT -8
Well, the only difference between the two distributions is that on Arduino each example has to start with:
#include <EEPROM.h> but on Due this is not needed.
Apart from that the libraries are identical. So if you bear this in mind then yes, it is possible to use just one library.
|
|
|
Post by powersoft on Jul 23, 2015 10:12:07 GMT -8
Thanks, have tested it now, and works great. Now I could start with programming my Planetarium. When ready show on the forum my work.
Cheers,
Jan
|
|
|
Post by jamesbowman on Jul 23, 2015 11:12:55 GMT -8
Awesome - thanks, looking forward to seeing it.
|
|
|
Post by tftlcdcyg on Nov 8, 2015 10:50:14 GMT -8
Sorry for my newbie question, but: What is the correct wiring between the arduino Due board and the gameduino 2?
|
|
|
Post by jamesbowman on Nov 8, 2015 16:55:40 GMT -8
Good question!
The current Gameduino 2 Due library needs no hookup wires; just plug the Gameduino 2 into the Due.
More detail: The Gameduino 2 Due library uses software SPI (that is, direct control over the SPI pins) so that it can use the traditional location for the SPI pins.
|
|
|
Post by chrischris on Apr 8, 2016 12:21:42 GMT -8
So I gave this a shot and it worked well, images seemed a little slower and jnr example was a bit sluggish, so in the GD2.H file I found where James has the Software SPI and I added in a Due compatible digitalReadFast snippet and it brought speed back to what I was used to, cant wait to try the real spi on Due and soon the Zero(SamD21).
#if defined(__DUE__) #define MOSI 11 #define MISO 12 #define SCK 13 // B.27
inline int digitalReadDirect(int pin){ return !!(g_APinDescription[pin].pPort -> PIO_PDSR & g_APinDescription[pin].ulPin); }
class ASPI_t { public: void begin(void) { pinMode(MOSI, OUTPUT); pinMode(MISO, INPUT); pinMode(SCK, OUTPUT); digitalWrite(SCK, 0);
// PIOB->PIO_PER = PIO_PB27; // PIOB->PIO_CODR = PIO_PB27; // PIOB->PIO_PUDR = PIO_PB27; } byte transfer(byte x ) { byte r = 0; for (byte i = 8; i; i--) { if (x & 0x80) PIOD->PIO_SODR = PIO_PD7; else PIOD->PIO_CODR = PIO_PD7; // digitalWrite(MOSI, (x >> 7) & 1); x <<= 1; // digitalWrite(SCK, 1); PIOB->PIO_SODR = PIO_PB27; r <<= 1; r |= digitalReadDirect(MISO); // digitalWrite(SCK, 0); PIOB->PIO_CODR = PIO_PB27; } return r; } };
|
|
|
Post by chrischris on Apr 12, 2016 12:33:25 GMT -8
Gameduino2! Running on Arduino Zer0! Took a few attempts last night and finally nailed it. Moving our sketches was a little tougher because the lack of support found for dtostrf and the Zer0. Now to dig a little deeper into speeding it up, looking to get all the speed possible throught spi and sd card. So far none of the changes i make in GD2.h to spi seem to make any difference in image loading time.
|
|
|
Post by powersoft on May 24, 2018 3:56:32 GMT -8
Can Gameduino3 run with the DUE?
|
|
|
Post by jamesbowman on May 24, 2018 5:52:33 GMT -8
Yes, it runs with Due out of the box, no changes required.
|
|
|
Post by powersoft on Jul 29, 2018 6:58:04 GMT -8
I have tested this but I'm not shure about your answer. Have make a simple sketch with 7 buttons. Every button has his own tag. The Due is not reacting on pressing the buttons. Same program is running on arduno uno without any complaints.
Include my program. Please can you take a look?
With kindly regards,
Jan
#include <SPI.h> #include <GD2.h> #include "GD3Colours.h" // Universum library for colours
unsigned long actual_unixtime=1532862520;
void setup() { GD.begin(0); Serial.begin(115200); }
void loop() { GD.ClearColorRGB(WHITE); GD.Clear(); GD.ColorRGB(BLUE); /*draw unix time*/ char buf[15] = {0}; // one extra byte for null sprintf(buf, "%lu", actual_unixtime); GD.cmd_text(240,50,31,OPT_CENTER,buf); /*convert unix to date & time*/ int timezone=0; bool daylightsaving=false; int jaar,maand,dag,uur,minuut; double seconde; invjday (ConvertUnix2JD(actual_unixtime), timezone, daylightsaving,jaar,maand,dag,uur,minuut,seconde); char timebuf[25]={0}; sprintf(timebuf,"%04d-%02d-%02d %02d:%02d:%02d",jaar,maand,dag,uur,minuut,int(seconde)); GD.cmd_text(240,90,27,OPT_CENTER,timebuf); Serial.println(timebuf); /* draw buttons*/ GD.ColorRGB(WHITE); GD.Tag(1); //-1 GD.cmd_button( 50,200,50,25,27,OPT_CENTER,"-1"); GD.Tag(2); //-10 GD.cmd_button(105,200,50,25,27,OPT_CENTER,"-10"); GD.Tag(3); //-100 GD.cmd_button(160,200,50,25,27,OPT_CENTER,"-100");
GD.Tag(4); //+1 GD.cmd_button(250,200,50,25,27,OPT_CENTER,"+1"); GD.Tag(5); //+10 GD.cmd_button(305,200,50,25,27,OPT_CENTER,"+10"); GD.Tag(6); //+100 GD.cmd_button(360,200,50,25,27,OPT_CENTER,"+100");
GD.Tag(7); //quit GD.cmd_button(410,240,60,25,27,OPT_CENTER,"QUIT"); GD.swap(); GD.get_inputs(); if (GD.inputs.tag == 1) actual_unixtime -= 1; if (GD.inputs.tag == 2) actual_unixtime -= 10; if (GD.inputs.tag == 3) actual_unixtime -= 100; if (GD.inputs.tag == 4) actual_unixtime += 1; if (GD.inputs.tag == 5) actual_unixtime += 10; if (GD.inputs.tag == 6) actual_unixtime += 100; }
|
|
|
Post by powersoft on Jul 29, 2018 9:21:32 GMT -8
Found the problem. Have a faulty GD3 board used. Cant read well the tough screen input. Have test it with an other GD3 board on the DUE and it works perfect.
|
|