hiram
New Member
Posts: 7
|
Post by hiram on Mar 27, 2015 10:02:04 GMT -8
Hello everyone, I try to connect Gameduino 2 with and the reader RFID-RC522 to Arduino UNO, i use the library MFRC522, My code is... #include <SPI.h> #include <MFRC522.h> #include <EEPROM.h> #include <GD2.h> #define RST_PIN 7 // #define SS_PIN 6 // #define GPU_PIN 8 // Gameduino GPU MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance void setup() { Serial.begin(9600); // Initialize serial communications with the PC SPI.begin(); // Init SPI bus pinMode(SS_PIN, OUTPUT); // off SS_PIN reader digitalWrite(SS_PIN, HIGH); pinMode(GPU_PIN, OUTPUT); // on GPU_PIN GD digitalWrite(GPU_PIN, LOW); // Initialize GD2 GD.begin(0); GD.__end(); // Initialize Reader Serial.println("Init Reader"); mfrc522.PCD_Init(); // Init MFRC522 GD.resume(); } void loop(){ GD.ClearColorRGB(0x103000); GD.Clear(); GD.cmd_text(240, 136, 31, OPT_CENTER, "Test"); GD.swap(); GD.__end(); // Look for new cards if ( ! mfrc522.PICC_IsNewCardPresent()) { return; } // Select one of the cards if ( ! mfrc522.PICC_ReadCardSerial()) { return; } // Dump debug info about the card; PICC_HaltA() is automatically called mfrc522.PICC_DumpToSerial(&(mfrc522.uid)); GD.resume(); } With this code can reading the card and dump info into Serial, but the screen don't showing nothing, please help me to connect this devices at the same time. You can find the code in this link. Regards from México.
|
|
|
Post by jamesbowman on Mar 27, 2015 16:04:19 GMT -8
This code looks totally fine. So this is puzzling.
Couple of suggestions:
(1) call "GD.finish()" after "GD.swap()"
(2) make sure there is no microSD card in the slot. It may be interfering with the other SPI devices.
|
|
hiram
New Member
Posts: 7
|
Post by hiram on Mar 28, 2015 7:47:33 GMT -8
Yes the code is fine, my problem is in the power supply, use a voltage with a one regulator of 5V, when apply external voltage the screen turn black or sometimes white. Now apply voltage the circuit with usb cable and all is ok, i search more information about how to connect gameduino with external supply.
Thank you for your reply and your suggestions.
|
|