Goos_E Posted February 14, 2015 Report Share Posted February 14, 2015 Greetings, I want to say to you Jack Gasset what a great peace of work the Papillio Duo is. But now my question. How do I get the PS2 keyboard to function with my computing shield and the zpuino. I can see that it must work wit SPI, but how do i do that? Goos Eijer Quote Link to comment Share on other sites More sharing options...
alvieboy Posted February 15, 2015 Report Share Posted February 15, 2015 Hi Goos, I'll speak to Jack regarding this issue, because I have integrated a PS/2 controller in other designs. It does not use SPI at all. Quote Link to comment Share on other sites More sharing options...
Goos_E Posted February 15, 2015 Author Report Share Posted February 15, 2015 Hi Alvieboy, I am sorry that was the SD-card, but how do I use a keyboard. I am not a beginner in programming but a beginner in things like keyboards and SD cards. I was busy with Tinybasic and tried to work it with VGA and a Keyboard as input. I am getting stuck on the VGA as well. (but I think I can get out of that). Quote Link to comment Share on other sites More sharing options...
SteveT Posted February 16, 2015 Report Share Posted February 16, 2015 You could start here https://eewiki.net/pages/viewpage.action?pageId=28278929Which should explain all you need to know. Quote Link to comment Share on other sites More sharing options...
Jack Gassett Posted February 16, 2015 Report Share Posted February 16, 2015 Hello Goos, It looks like the examples for the SD library included with DesignLab 1.0.1 are not correct. Alvie and I are working to update the library, in the meantime here is an example sketch you can use:/* SD card test This example shows how use the utility libraries on which the' SD library is based in order to get info about your SD card. Very useful for testing a card when you're not sure whether its working or not. created 28 Mar 2011 by Limor Fried modified 9 Apr 2012 by Tom Igoe modified 6/3/2013 by Jack Gassett for the Papilio */ // include the SD library:#include <SD.h>#include "SPI.h"//Uncomment for the SD card on the Papilio DUO Computing Shield#define circuit Computing_Shield#define CSPIN 16#define WISHBONESLOT 12// set up variables using the SD utility library functions:Sd2Card card;SdVolume volume;SdFile root;void setup(){ // Open serial communications and wait for port to open: Serial.begin(9600); pinMode(CSPIN,OUTPUT); Serial.print("\nInitializing SD card..."); // we'll use the initialization code from the utility libraries // since we're just testing if the card is working! if (!card.init(SPI_HALF_SPEED, CSPIN, WISHBONESLOT)) { Serial.println("initialization failed. Things to check:"); Serial.println("* is a card is inserted?"); Serial.println("* Is your wiring correct?"); Serial.println("* did you change the chipSelect pin to match your shield or module?"); return; } else { Serial.println("Wiring is correct and a card is present."); }}void loop(void) { Serial.println("\n\nStarting Card Info:"); // print the type of card Serial.print("Card type: "); switch(card.type()) { case SD_CARD_TYPE_SD1: Serial.println("SD1"); break; case SD_CARD_TYPE_SD2: Serial.println("SD2"); break; case SD_CARD_TYPE_SDHC: Serial.println("SDHC"); break; default: Serial.println("Unknown"); } // Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32 if (!volume.init(card)) { Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card"); return; } // print the type and size of the first FAT-type volume uint32_t volumesize; Serial.print("\nVolume type is FAT"); Serial.println(volume.fatType(), DEC); Serial.println(); volumesize = volume.blocksPerCluster(); // clusters are collections of blocks volumesize *= volume.clusterCount(); // we'll have a lot of clusters volumesize *= 512; // SD card blocks are always 512 bytes Serial.print("Volume size (bytes): "); Serial.println(volumesize); Serial.print("Volume size (Kbytes): "); volumesize /= 1024; Serial.println(volumesize); Serial.print("Volume size (Mbytes): "); volumesize /= 1024; Serial.println(volumesize); Serial.println("Card Info complete, waiting 5 seconds."); delay(5000); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.