This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Arduino Transfer Pak test thing

By: a guest on Apr 18th, 2013  |  syntax: C++  |  size: 0.87 KB  |  views: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. void init_tpak ()
  2. {
  3.   const word cmd_size = 35;
  4.   unsigned char command [cmd_size] = { 0x03, 0x80, 0x01 };
  5.   memset ( &command [3], 0xFE, 32 );
  6.  
  7.   noInterrupts ();
  8.   N64_send ( command, cmd_size );
  9.   N64_read_addr ();
  10.   interrupts ();
  11.  
  12.   manage_mem_dump ();
  13.  
  14.   Serial.println ( N64_mem_managed [0], HEX );
  15.  
  16.   delay (100);
  17.  
  18.   memset ( &command [3], 0x84, 32 );
  19.  
  20.   noInterrupts ();
  21.   N64_send ( command, cmd_size );
  22.   N64_read_addr ();
  23.   interrupts ();
  24.  
  25.   manage_mem_dump ();
  26.  
  27.   Serial.println ( N64_mem_managed [0], HEX );
  28.  
  29.   delay (100);
  30.  
  31.   command [0] = 0x02;
  32.  
  33.   noInterrupts ();
  34.   N64_send ( command, 3 );
  35.   N64_read_addr ();
  36.   interrupts ();
  37.  
  38.   manage_mem_dump ();
  39.  
  40.   for ( int i=0; i<33; ++i )
  41.   {
  42.     Serial.print ( N64_mem_managed [0], HEX );
  43.     Serial.print (" ");
  44.   }
  45.   Serial.println ();
  46.  
  47.   delay (100);
  48.  
  49. }
clone this paste RAW Paste Data