|
Post by mindrage on Apr 28, 2014 7:41:57 GMT -8
I have the following devices: Udoo Quad (Full Due compability) ( Wifi build in ) Arduino Mega ADK R3 (ATmega2560) Arduino Uno R3 And i have these items: ITead Studio 2.8" TFT Touch Shield (The screen which wont stack with wifi shield) Arduino Wifi Shield (Official Arduino Wifi Shield) I was thinking of buying Gameduino2 Screen as it just blows everything in functionality for a screen. I've heard also that people prefer to use Adafruit screen due to its compability with SPI. The problem is that i really need Wifi and the only ways i can do without doing to much with hardware change is: *Udoo with only Gameduino2 as the wifi is accessible though a serial port from the Linux part of Gameduino. *Arduino Uno or Arduino Mega ADK with stacking the screen on the wifi shield. (which is what in not completely sure i can do, please tell me if anyone has done this before) *Using the Arduino Mega ADK with Jumpers (Breakout cables) to place the Screen at the side of wifi shield due to the amount of pins free on the Mega, (Though i dont know if any pins are required which the Wifi shield is taking up.) So some summing up on questions (only one is neccessary to awnser): *Can i stack the Gameduino2 on an Arduino Wifi Shield? If not is there a way to go around it? *Can i use the Gameduino2 on Due with any current Library? *Can i easily configure the pins of the gameduino shield in the gd liberary? Are they compatible with stacking the Wifi Shield? References to ease things: Wifi Shield: arduino.cc/en/Main/ArduinoWiFiShieldArduino Mega ADK R3: arduino.cc/en/Main/ArduinoBoardMegaADK?from=Main.ArduinoBoardADKUdoo Quad (Arduino Due): udoo.org/download/files/pinout/Udoo_pinout_diagram.pdfI really appretiate the help, i've been stuck with this for multiple weeks and i really would love to make this screen work. Anything would work, i just want to make it work one way or the other.
|
|
|
Post by jamesbowman on Apr 28, 2014 8:09:57 GMT -8
Yes, Gameduino 2 is compatible with the Wifi Shield. They can share the SPI bus; GD2 uses pins 8 and 9 for SPI enable, and the Wifi Shield uses pin 10. So all should be good.
Due support is problematic because of the Due's lack of EEPROM.
|
|
|
Post by mindrage on Apr 28, 2014 9:08:51 GMT -8
Yes, but the Wifi shield uses Pin 4 as well for SD-Card SS, and 7 for handshake , would that affect it somehow?
|
|
|
Post by jamesbowman on Apr 28, 2014 11:26:47 GMT -8
|
|
|
Post by mindrage on Apr 28, 2014 12:38:28 GMT -8
great!, thanks for the quick response! I hope this project gets more attention, it really is a great piece of hardware.
|
|
|
Post by coco2725 on May 15, 2014 4:52:15 GMT -8
Hello i am trying to stack :
- arduino R3 UNO - Arduino Wifi Shield // SS pin 10 for wifi and SS pin 4 for SD-CARD - Gameduino2
But it doesn't work
And separately it's all ok
Could someone help me ?
|
|
|
Post by jamesbowman on May 15, 2014 5:25:18 GMT -8
When they are all in the same stack, do the Gameduino samples still run? How about the Wifi?
Does the Gameduino 2's backlight come on at startup?
How are you powering the stack?
|
|
|
Post by coco2725 on May 15, 2014 5:51:10 GMT -8
the wifi sample work but the gameduino 2 backlight come on and blink one time and nothing more happen.
The stack is powered by the usb of the arduino Uno.
If i stack only the wifi and next stack wifi + gameduino2 - wifi work -gameduino2 dont work
If i stack only the gameduino2 and next stack wifi + gameduino2 -wifi dont work - gameduino2 dont work
|
|
|
Post by mindrage on May 15, 2014 6:16:28 GMT -8
When they are all in the same stack, do the Gameduino samples still run? How about the Wifi? Does the Gameduino 2's backlight come on at startup? How are you powering the stack? I've tried the same setup as Coco, I've tried everything basically. The problem is the SPI communication. The Wifi Library does not really work directly in the SPI communication. I can give you some analysis: This is my console output for project: Test 1:
Without modifying SS Pins: Then with modifications: The modifications made are these: pinMode(PIN_DISPLAY_GS, OUTPUT);
pinMode(PIN_DISPLAY_SD, OUTPUT);
pinMode(PIN_SS, OUTPUT);
pinMode(PIN_WIFI, OUTPUT);
pinMode(PIN_WIFI_SD, OUTPUT);
digitalWrite(PIN_DISPLAY_GS, HIGH);
digitalWrite(PIN_DISPLAY_SD, HIGH);
digitalWrite(PIN_SS, HIGH);
digitalWrite(PIN_WIFI, HIGH);
digitalWrite(PIN_WIFI_SD, HIGH); Hardware results: None, No backlight nothing. Also GD.begin() becomes an infinite loop.
Test 2, without a Wifi Shield at all (not connected to board), same location of pins, then disabling Network module. Here the code works completely correct, and it works fully as well. I do not do any kind of pin update here either. But a note. I had to unplug the power and power it again for it to work after changing pins. I also tested the same code with Uno, the same results occured.
|
|
|
Post by coco2725 on May 15, 2014 6:26:18 GMT -8
Ok thank you very much.
First wich program do you use to see the console like this ??
If I understand it should not stack the wifi?
|
|
|
Post by mindrage on May 15, 2014 6:36:04 GMT -8
It should work, its just that there is a common problem with SPI communication (Pin 11-13) on Uno and 50-52 on Mega ADK.
All devices share the same paths electrically. And you need the so called Chip Select pins to know which device to send to. This makes a problem where multiple devices can be on at the same time, recieving signals from diffrent devices. Basically. You Wifi Library only wants to speak with the Wifi Shield, but because the pins are not set right, it can communicate with Both the display and the wifishield at the same time, which doesnt really work. The same thing can be done if the GD Library talks to both the wifi shield and Display. The display might work, then the wifi can work.
Bascially the pins you need to check on Uno are 10, 4, 8, 9. Be aware that 10 is also slaveselect for the device. Which is strange. The wifi shield works well without worrying about 10 for SS. I know that i read somewhere that the SS pin can be programatically on the UNO. Maybe the WiFi library changes the SS to some of the pins related to the Screen?
|
|
|
Post by coco2725 on May 15, 2014 6:55:15 GMT -8
I think i have found why... the arduino and the wifi-shield use the same SS pin.
As you said i muss change the SS pin. I will try that
|
|
|
Post by coco2725 on May 16, 2014 0:03:21 GMT -8
I have found....i think the library forget to put the SS of Gameduino to HIGH when he has finish is job;
This code work :
#include <EEPROM.h> #include <SPI.h> #include <WiFi.h> #include <GD2.h>
char ssid[] = "your_ssid"; // your network SSID (name) char pass[] = "your_pass"; // your network password int status = WL_IDLE_STATUS; // the Wifi radio's status
int PIN_DISPLAY_GS = 8; int PIN_DISPLAY_SD = 9; int PIN_WIFI = 10; int PIN_WIFI_SD = 4; int state_GS; int state_GS_SD; int state_WIFI; int state_WIFI_SD; void setup() { Serial.begin(9600); pinMode(PIN_DISPLAY_GS, OUTPUT); pinMode(PIN_DISPLAY_SD, OUTPUT); //pinMode(PIN_SS, OUTPUT); pinMode(PIN_WIFI, OUTPUT); pinMode(PIN_WIFI_SD, OUTPUT); digitalWrite(PIN_DISPLAY_GS, HIGH); digitalWrite(PIN_DISPLAY_SD, HIGH); //digitalWrite(PIN_SS, HIGH); digitalWrite(PIN_WIFI, HIGH); digitalWrite(PIN_WIFI_SD, HIGH); GD.begin(8); state_GS = digitalReadOutputPin(PIN_DISPLAY_GS); state_GS_SD = digitalReadOutputPin(PIN_DISPLAY_SD); state_WIFI = digitalReadOutputPin(PIN_WIFI); state_WIFI_SD = digitalReadOutputPin(PIN_WIFI_SD); Serial.println("Après initialisation Ecran"); Serial.println(" SS DISPLAY 8 " ); Serial.println(state_GS); Serial.println(" SS DISPLAY SD 9" ); Serial.println(state_GS_SD); Serial.println(" PIN:WIFI 10 " ); Serial.println(state_WIFI); Serial.println("PIN SD WIFI 4 " ); Serial.println(state_WIFI_SD); digitalWrite(PIN_DISPLAY_GS, HIGH); digitalWrite(PIN_WIFI, LOW); Serial.println("Après select WIFI"); state_GS = digitalReadOutputPin(PIN_DISPLAY_GS); state_GS_SD = digitalReadOutputPin(PIN_DISPLAY_SD); state_WIFI = digitalReadOutputPin(PIN_WIFI); state_WIFI_SD = digitalReadOutputPin(PIN_WIFI_SD); Serial.println(" SS DISPLAY 8 " ); Serial.println(state_GS); Serial.println(" SS DISPLAY SD 9" ); Serial.println(state_GS_SD); Serial.println(" PIN:WIFI 10 " ); Serial.println(state_WIFI); Serial.println("PIN SD WIFI 4 " ); Serial.println(state_WIFI_SD); /* pinMode(Master, OUTPUT); pinMode(SSWiFi, OUTPUT); pinMode(8, OUTPUT); */ /* digitalWrite(Master, LOW); digitalWrite(SSWiFi, HIGH); digitalWrite(9,HIGH);
pinMode(Master,OUTPUT); pinMode(Master,LOW); */
/* while(!Serial) { ; }
if(WiFi.status() == WL_NO_SHIELD) { Serial.println("Pas de carte Wifi"); while(true); } */
// attempt to connect to Wifi network:
while ( status != WL_CONNECTED) { Serial.print("Attempting to connect to WPA SSID: "); Serial.println(ssid); // Connect to WPA/WPA2 network: status = WiFi.begin(ssid, pass);
// wait 10 seconds for connection: delay(10000); }
Serial.print("You're connected to the network"); printCurrentNet(); printWifiData(); GD.begin(8); digitalWrite(8, HIGH); }
void loop() {
GD.Clear(); GD.Begin(LINES);
for (int i = 0; i < 100; i++) { GD.PointSize(GD.random(16 * 50)); GD.ColorRGB(GD.random(256), GD.random(256), GD.random(256)); GD.ColorA(GD.random(256)); GD.Vertex2ii(GD.random(480), GD.random(272)); } GD.swap(); state_GS = digitalReadOutputPin(PIN_DISPLAY_GS); state_GS_SD = digitalReadOutputPin(PIN_DISPLAY_SD); state_WIFI = digitalReadOutputPin(PIN_WIFI); state_WIFI_SD = digitalReadOutputPin(PIN_WIFI_SD); Serial.println(" SS DISPLAY 8 " ); Serial.println(state_GS); Serial.println(" SS DISPLAY SD 9" ); Serial.println(state_GS_SD); Serial.println(" PIN:WIFI 10 " ); Serial.println(state_WIFI); Serial.println("PIN SD WIFI 4 " ); Serial.println(state_WIFI_SD); delay(5000); }
void printWifiData() { // print your WiFi shield's IP address: IPAddress ip = WiFi.localIP(); Serial.print("IP Address: "); Serial.println(ip); Serial.println(ip); // print your MAC address: byte mac[6]; WiFi.macAddress(mac); Serial.print("MAC address: "); Serial.print(mac[5],HEX); Serial.print(":"); Serial.print(mac[4],HEX); Serial.print(":"); Serial.print(mac[3],HEX); Serial.print(":"); Serial.print(mac[2],HEX); Serial.print(":"); Serial.print(mac[1],HEX); Serial.print(":"); Serial.println(mac[0],HEX);
}
void printCurrentNet() { // print the SSID of the network you're attached to: Serial.print("SSID: "); Serial.println(WiFi.SSID());
// print the MAC address of the router you're attached to: byte bssid[6]; WiFi.BSSID(bssid); Serial.print("BSSID: "); Serial.print(bssid[5],HEX); Serial.print(":"); Serial.print(bssid[4],HEX); Serial.print(":"); Serial.print(bssid[3],HEX); Serial.print(":"); Serial.print(bssid[2],HEX); Serial.print(":"); Serial.print(bssid[1],HEX); Serial.print(":"); Serial.println(bssid[0],HEX);
// print the received signal strength: long rssi = WiFi.RSSI(); Serial.print("signal strength (RSSI):"); Serial.println(rssi);
// print the encryption type: byte encryption = WiFi.encryptionType(); Serial.print("Encryption Type:"); Serial.println(encryption,HEX); Serial.println(); }
int digitalReadOutputPin(uint8_t pin) { uint8_t bit = digitalPinToBitMask(pin); uint8_t port = digitalPinToPort(pin); if (port == NOT_A_PIN) return LOW;
return (*portOutputRegister(port) & bit) ? HIGH : LOW;
|
|
|
Post by wiilwaal on Jan 10, 2017 16:18:30 GMT -8
does multiplayer work?
|
|