<mosaic.cnfolio.com>

Monome hacking





This page contains notes for students who are experimenting with the Monome 40h kit as a creative user interface for C programs.


Getting started


  1. Download and install the device drivers for the USB interface (FTDI FT245R IC) used by the monome board:
  2. If you do not already have a C compiler and editor, then download and install one of the following C integrated development environments (IDE):
  3. Download the following source code and resources to create the test program to verify connectivity to the monome board:
  4. Use the following documentation to understand the source code for the test program:



Multimedia gallery


Video of Modified Test Code
Video of test program.
Logic board visible inside lego enclosure.
Easy to remove/replace lego enclosure.
Fully covered lego enclosure.
Monome Smile !!!
Monome Keypad Uncovered
Keypad Uncovered Zoom
Keypad Button Cover (Rear)
Monome Logic Board



Summer projects



Monome Password Storage & Authentication - Program to store series of monome button coordinates to text file to be read and compared then as a password - built from example code (INCOMPLETE/UNSTABLE) - Uploaded (27/07/09)
#include <windows.h>
#include <stdio.h>
#include "ftd2xx.h"

#define MONOME_CONNECTION_ATTRIBUTES       ( FILE_ATTRIBUTE_NORMAL | FT_OPEN_BY_SERIAL_NUMBER )

#define MONOME_BUFFER_IDX_COMD             0
#define MONOME_BUFFER_IDX_DATA             1
#define MONOME_BUFFER_SIZE                 2

#define SET_MONOME_COMD_BOARDMODE(bf)      ( bf = ((6 & 0x0f) << 4) | (0 & 0x0f) )
#define SET_MONOME_COMD_LED_ON(bf)         ( bf = ((2 & 0x0f) << 4) | (1 & 0x0f) )
#define SET_MONOME_COMD_LED_OFF(bf)        ( bf = ((2 & 0x0f) << 4) | (0 & 0x0f) )
#define SET_MONOME_COMD_LED_ROW(bf,rn)     ( bf = ((8 & 0x0f) << 4) | (rn & 0x0f) )
#define SET_MONOME_COMD_LED_COL(bf,rn)     ( bf = ((7 & 0x0f) << 4) | (rn & 0x0f) )
#define SET_MONOME_DATA_BOARD_ON(bf)       ( bf = 1 )
#define SET_MONOME_DATA_BOARD_OFF(bf)      ( bf = 0 )
#define SET_MONOME_DATA_LED_ROWCOL_ON(bf)  ( bf = 255 )
#define SET_MONOME_DATA_LED_ROWCOL_OFF(bf) ( bf = 0 )

#define GET_MONOME_KEY_ROW(kp)             ( kp >> 4 )
#define GET_MONOME_KEY_COL(kp)             ( kp & 0x0f )

#define IS_MONOME_KEYPRESS_DOWN(bf)        ( bf == 1 )
#define IS_MONOME_KEYPRESS_UP(bf)          ( bf == 0 )

#define TEMP_BUFFER_SIZE                   128

main(void)
{  
   FT_STATUS ftConnectionStatus;	/*initialise for connection information details*/
   FT_HANDLE ftConnectionHandle;	/*initalise for board connection responses*/
   DWORD     dwBufferSize = MONOME_BUFFER_SIZE;	/*set monome buffer*/
   DWORD     dwBufferActualSize;	/*set buffer*/
   char      sBuffer[ TEMP_BUFFER_SIZE ] = { '\0' };	/*reset temporary buffer*/
   byte      bMonomeData[ MONOME_BUFFER_SIZE ];	/*set memory for device settings*/

   FILE *pass_src;	/*initialise password file*/
   int KeyPress_Row, KeyPress_Col = 0;	/*set KeyPress coordinate values*/
   int count;	/*initialise counter*/
   int create_pass = 0;	/*initialise and reset create password flag*/
   char confirm = NULL;	/*initialise space for request confirmation responses*/

   ftConnectionStatus = FT_ListDevices( 0, sBuffer, FT_LIST_BY_INDEX | FT_OPEN_BY_SERIAL_NUMBER );	/*collect device information*/
   ftConnectionHandle = FT_W32_CreateFile( sBuffer, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, MONOME_CONNECTION_ATTRIBUTES, 0 );	/*store device details to file*/

   if ( ftConnectionHandle == INVALID_HANDLE_VALUE ) /*check if connection status with error handing*/
   {
	  printf("ERROR: Monome Connection Failed\n");	/*display invalid connection message*/
	  return 0; /*exit program*/
   }

   printf("OK: Monome Connection Found\n");	/*display successful connection message*/
   SET_MONOME_COMD_BOARDMODE( bMonomeData[ MONOME_BUFFER_IDX_COMD ] );	/*set monome for status change*/
   SET_MONOME_DATA_BOARD_ON( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );	/*turn device on*/
   FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );	/*save changed device settings*/

   pass_src = fopen("source.txt","r");	/*read password file*/

   if(pass_src == NULL)	/*check if file exists with password details*/
   {
	   printf("ERROR: Password File Read Failed\n");	/*display failed file read message*/
	   printf("REQUEST: Create New Password? (y/n)\n");	/*ask user to create a new password file*/
	   scanf("%c",confirm);	/*scan for user input response*/

	   if( (confirm == "y") || (confirm == "Y") )	/*check if user confirmed file creation*/
	   {
		   pass_src = fopen("source.txt","w");	/*create new file*/
		   create_pass = 1;	/*set password create flag*/
		   count = 0;	/*set counter value*/

		   while(create_pass == 1) /*check if flag is set for loop*/
		   {
			    if( IS_MONOME_KEYPRESS_DOWN( bMonomeData[ MONOME_BUFFER_IDX_COMD ] ) )	/*check if key has been pressed*/
				{
					count++;	/*increment counter value*/
					KeyPress_Row = GET_MONOME_KEY_ROW( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );	/*get button row coordinate*/
					KeyPress_Col = GET_MONOME_KEY_COL( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );	/*get button column coordinate*/
					printf( "OK: KeyPress(%d) at Row=%d, Column=%d\n", count, KeyPress_Row, KeyPress_Col );	/*display button coordindates*/
					SET_MONOME_COMD_LED_ON( bMonomeData[ MONOME_BUFFER_IDX_COMD ] );	/*turn pressed button led on*/
					FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );	/*store changed device settings and send to monome*/
				}

				if(count == 4)	/*if counter = maximum password length*/
				{
					create_pass = 0;	/*disable loop flag*/
					printf("OK: Password File Creation Successful");	/*display file creation confirmation message*/
				}
		   }
	   }
	   else
	   {
		   printf("OK: Program Exit");	/*display program exit message*/
		   return 0;	/*exit program*/
	   }
   }
}


Monome Light Show Program - Basic Light Show (Not working across entire extent of the board yet) - Uploaded (12/07/09)
#include <windows.h>
#include <stdio.h>
#include "ftd2xx.h"

#define MONOME_CONNECTION_ATTRIBUTES       ( FILE_ATTRIBUTE_NORMAL | FT_OPEN_BY_SERIAL_NUMBER )

#define MONOME_BUFFER_IDX_COMD             0
#define MONOME_BUFFER_IDX_DATA             1
#define MONOME_BUFFER_SIZE                 2

#define REPEAT_COUNT_TO_EXIT               6
#define BLINK_ROW_COLUMN_MODE              1

#define SET_MONOME_COMD_BOARDMODE(bf)      ( bf = ((6 & 0x0f) << 4) | (0 & 0x0f) )
#define SET_MONOME_COMD_LED_ON(bf)         ( bf = ((2 & 0x0f) << 4) | (1 & 0x0f) )
#define SET_MONOME_COMD_LED_OFF(bf)        ( bf = ((2 & 0x0f) << 4) | (0 & 0x0f) )
#define SET_MONOME_COMD_LED_ROW(bf,rn)     ( bf = ((8 & 0x0f) << 4) | (rn & 0x0f) )
#define SET_MONOME_COMD_LED_COL(bf,rn)     ( bf = ((7 & 0x0f) << 4) | (rn & 0x0f) )
#define SET_MONOME_DATA_BOARD_ON(bf)       ( bf = 1 )
#define SET_MONOME_DATA_BOARD_OFF(bf)      ( bf = 0 )
#define SET_MONOME_DATA_LED_ROWCOL_ON(bf)  ( bf = 255 )
#define SET_MONOME_DATA_LED_ROWCOL_OFF(bf) ( bf = 0 )

#define GET_MONOME_KEY_ROW(kp)             ( kp >> 4 )
#define GET_MONOME_KEY_COL(kp)             ( kp & 0x0f )

#define IS_MONOME_KEYPRESS_DOWN(bf)        ( bf == 1 )
#define IS_MONOME_KEYPRESS_UP(bf)          ( bf == 0 )

#define TEMP_BUFFER_SIZE                   128


int main( void )
{
   FT_STATUS ftConnectionStatus;
   FT_HANDLE ftConnectionHandle;
   DWORD     dwBufferSize = MONOME_BUFFER_SIZE;
   DWORD     dwBufferActualSize;
   char      sBuffer[ TEMP_BUFFER_SIZE ] = { '\0' };
   byte      bMonomeData[ MONOME_BUFFER_SIZE ];
   int		 light_display_flag = NULL;

   ftConnectionStatus = FT_ListDevices( 0, sBuffer, FT_LIST_BY_INDEX | FT_OPEN_BY_SERIAL_NUMBER );
   ftConnectionHandle = FT_W32_CreateFile( sBuffer, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, MONOME_CONNECTION_ATTRIBUTES, 0 );

   if ( ftConnectionHandle == INVALID_HANDLE_VALUE )
   {
	  printf( "ERROR: Monome board is not connected\n" );
	  return 0;
   }

   printf( "OK: Found Monome board using serial number %s\n", sBuffer );
   SET_MONOME_COMD_BOARDMODE( bMonomeData[ MONOME_BUFFER_IDX_COMD ] );
   SET_MONOME_DATA_BOARD_ON( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
   FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );

   while(1)
   {
		bMonomeData[ MONOME_BUFFER_IDX_COMD ] = bMonomeData[ MONOME_BUFFER_IDX_DATA ] = 0;
		
		if ( FT_W32_ReadFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL ) )
		{
			if( !light_display_flag )
			{
				int i;
				for( i=1; i<=8; i++ )
				{
					SET_MONOME_COMD_LED_COL( bMonomeData[ MONOME_BUFFER_IDX_COMD ], i );
					SET_MONOME_COMD_LED_ON( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
					FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
					Sleep(50);
				}

				for( i=1; i<=8; i++ )
				{
					SET_MONOME_COMD_LED_COL( bMonomeData[ MONOME_BUFFER_IDX_COMD ], i );
					SET_MONOME_COMD_LED_OFF( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
					FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
					Sleep(50);
				}

				for( i=1; i<=8; i++ )
				{
					SET_MONOME_COMD_LED_ROW( bMonomeData[ MONOME_BUFFER_IDX_COMD ], i );
					SET_MONOME_COMD_LED_ON( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
					FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
					Sleep(50);
				}
	
				for( i=1; i<=8; i++ )
				{
					SET_MONOME_COMD_LED_ROW( bMonomeData[ MONOME_BUFFER_IDX_COMD ], i );
					SET_MONOME_COMD_LED_OFF( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
					FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
					Sleep(50);
				}

				for( i=8; i>=1; i-- )
				{
					SET_MONOME_COMD_LED_ROW( bMonomeData[ MONOME_BUFFER_IDX_COMD ], i );
					SET_MONOME_COMD_LED_ON( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
					FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
					Sleep(50);
				}

				for( i=1; i<=8; i++ )
				{
					SET_MONOME_COMD_LED_COL( bMonomeData[ MONOME_BUFFER_IDX_COMD ], i );
					SET_MONOME_COMD_LED_OFF( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
					FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
					Sleep(50);
				}

				for( i=1; i<=8; i++ )
				{
					SET_MONOME_COMD_LED_ROW( bMonomeData[ MONOME_BUFFER_IDX_COMD ], i );
					SET_MONOME_COMD_LED_ON( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
					FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
					Sleep(50);
				}

				for( i=8; i>=1; i-- )
				{
					SET_MONOME_COMD_LED_COL( bMonomeData[ MONOME_BUFFER_IDX_COMD ], i );
					SET_MONOME_COMD_LED_OFF( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
					FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
					Sleep(50);
				}

				printf("OK: Monome Light Display Complete");
				light_display_flag = 1;
			}
		}
   }
}


Modified Test Code - Wait for 5 button presses - Uploaded (12/07/09)
#include <windows.h>
#include <stdio.h>
#include "ftd2xx.h"

/* Add FILE_FLAG_OVERLAPPED to use overlap IO mode */
#define MONOME_CONNECTION_ATTRIBUTES       ( FILE_ATTRIBUTE_NORMAL | FT_OPEN_BY_SERIAL_NUMBER )

#define MONOME_BUFFER_IDX_COMD             0
#define MONOME_BUFFER_IDX_DATA             1
#define MONOME_BUFFER_SIZE                 2

#define REPEAT_COUNT_TO_EXIT               6
#define BLINK_ROW_COLUMN_MODE              1

#define SET_MONOME_COMD_BOARDMODE(bf)      ( bf = ((6 & 0x0f) << 4) | (0 & 0x0f) )
#define SET_MONOME_COMD_LED_ON(bf)         ( bf = ((2 & 0x0f) << 4) | (1 & 0x0f) )
#define SET_MONOME_COMD_LED_OFF(bf)        ( bf = ((2 & 0x0f) << 4) | (0 & 0x0f) )
#define SET_MONOME_COMD_LED_ROW(bf,rn)     ( bf = ((8 & 0x0f) << 4) | (rn & 0x0f) )
#define SET_MONOME_COMD_LED_COL(bf,rn)     ( bf = ((7 & 0x0f) << 4) | (rn & 0x0f) )
#define SET_MONOME_DATA_BOARD_ON(bf)       ( bf = 1 )
#define SET_MONOME_DATA_BOARD_OFF(bf)      ( bf = 0 )
#define SET_MONOME_DATA_LED_ROWCOL_ON(bf)  ( bf = 255 )
#define SET_MONOME_DATA_LED_ROWCOL_OFF(bf) ( bf = 0 )

#define GET_MONOME_KEY_ROW(kp)             ( kp >> 4 )
#define GET_MONOME_KEY_COL(kp)             ( kp & 0x0f )

#define IS_MONOME_KEYPRESS_DOWN(bf)        ( bf == 1 )
#define IS_MONOME_KEYPRESS_UP(bf)          ( bf == 0 )

#define TEMP_BUFFER_SIZE                   128

int main( void )
{
   int KeyPress = 0;

   FT_STATUS ftConnectionStatus;	//stores connection status value
   FT_HANDLE ftConnectionHandle;	//stores connection handle value
   DWORD     dwBufferSize = MONOME_BUFFER_SIZE;		//sets buffer size
   DWORD     dwBufferActualSize;
   char      sBuffer[ TEMP_BUFFER_SIZE ] = { '\0' };	//sets sBuffer array size according to the value of TEMP_BUFFER_SIZE
   byte      bMonomeData[ MONOME_BUFFER_SIZE ];		//sets the maximum buffer packet size to be used
   int       iRepeatKeyRow = 0, iRepeatKeyCol = 0, iRepeatKeyCount = 0;		//sets all repeat key press counts to 0
   int       iBlinkRow = -1, iBlinkCol = -1, iRowBlinking = 0, iColBlinking = 0;	//sets all light blinking settings to off

   ftConnectionStatus = FT_ListDevices( 0, sBuffer, FT_LIST_BY_INDEX | FT_OPEN_BY_SERIAL_NUMBER );		//stores connected device number and serial number (if multiple devices are connnected, the index value will be incremented)
   ftConnectionHandle = FT_W32_CreateFile( sBuffer, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, MONOME_CONNECTION_ATTRIBUTES, 0 );	//read sBuffer for connection details and store these values

   if ( ftConnectionHandle == INVALID_HANDLE_VALUE )	//checks if connection exists	
   {
	  printf( "ERR: Monome board is not connected\n" );		//displays failed connection message
	  return 0;		//returns program exit value
   }

   printf( "OK: Found Monome board using serial number %s\n", sBuffer );	//displays successful connection message along with device serial number stored in sBuffer
   SET_MONOME_COMD_BOARDMODE( bMonomeData[ MONOME_BUFFER_IDX_COMD ] );
   SET_MONOME_DATA_BOARD_ON( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
   FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );



   //Wait for user to press 5 keys before starting initial program
   while ( KeyPress <= 4 )
   {
		bMonomeData[ MONOME_BUFFER_IDX_COMD ] = bMonomeData[ MONOME_BUFFER_IDX_DATA ] = 0;	//clears buffer

		if ( FT_W32_ReadFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL ) )	//loads connection file
		{
			if ( IS_MONOME_KEYPRESS_DOWN( bMonomeData[ MONOME_BUFFER_IDX_COMD ] ) )		//if a key is pressed down
			{
				KeyPress++;	//increment flag
				printf("OK: KeyPress = %d \n", KeyPress);	//print flag value
			}

			if ( IS_MONOME_KEYPRESS_UP( bMonomeData[ MONOME_BUFFER_IDX_COMD ] ) )	//after a key has been released
			{
				SET_MONOME_COMD_LED_ON( bMonomeData[ MONOME_BUFFER_IDX_COMD ] );	//turn button LED on
				FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );	//sends information to monome
			}
		
			if ( KeyPress == 5 )	//if flag = 5
			{
				int i;	//declare i

				for ( i=1; i<=8; i++ )
				{
				  SET_MONOME_COMD_LED_COL( bMonomeData[ MONOME_BUFFER_IDX_COMD ], i );	//loop through columns in occordance to i
	              SET_MONOME_DATA_LED_ROWCOL_OFF( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );	//turn column LED's off
	              FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );	//send information to monome
				}
			}
		}
   }



   while ( 1 )
   {
	  bMonomeData[ MONOME_BUFFER_IDX_COMD ] = bMonomeData[ MONOME_BUFFER_IDX_DATA ] = 0;	//resets buffer packets

	  if ( FT_W32_ReadFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL ) )	//if connection details are true (exist), continue
	  {
	     if ( dwBufferSize == dwBufferActualSize )
	     {
	        if ( IS_MONOME_KEYPRESS_DOWN( bMonomeData[ MONOME_BUFFER_IDX_COMD ] ) )		//if a button has been pressed
	        {
	           if ( ( iRepeatKeyRow == GET_MONOME_KEY_ROW( bMonomeData[ MONOME_BUFFER_IDX_DATA ] ) ) && ( iRepeatKeyCol == GET_MONOME_KEY_COL( bMonomeData[ MONOME_BUFFER_IDX_DATA ] ) ) )		//if the same key is pressed more than once, continue
	           {
	              iRepeatKeyCount++;	//increment repeat button press counter (iRepeatKeyCount)
	              if ( iRepeatKeyCount == REPEAT_COUNT_TO_EXIT )	//if repeat count press equals max count level (REPEAT_COUNT_TO_EXIT) then exit program
	                 break;
	           }
	           else
	              iRepeatKeyCount = 0;	//if a different key has been pressed, reset iRepeatKeyCount

	           iRepeatKeyRow = GET_MONOME_KEY_ROW( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );		//store the row of the pressed button
	           iRepeatKeyCol = GET_MONOME_KEY_COL( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );		//store the column of the pressed button
	           printf( "OK: Received keypress at row=%d, column=%d\n", iRepeatKeyRow, iRepeatKeyCol );		//print recieved key press confirmation message with button coordinates
	           SET_MONOME_COMD_LED_ON( bMonomeData[ MONOME_BUFFER_IDX_COMD ] );		//turn on button LED
	           FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );	

	           if ( iBlinkRow == iRepeatKeyRow ) iRowBlinking = 1; 		//sets iRowBlinking flag when iRepeatKeyRow equals iBlinkRow
	           if ( iBlinkCol == iRepeatKeyCol ) iColBlinking = 1;		//sets iColBlinking flag when iRepeatKeyCol equals iBlinkCol
	           iBlinkRow = iRepeatKeyRow;	//copies the value of iRepeatKeyRow to iBlinkRow
	           iBlinkCol = iRepeatKeyCol;	//copies the value of iRepeatKeyCol to iBlinkCol

	           if ( BLINK_ROW_COLUMN_MODE && iRowBlinking )		//if both BLINK_ROW_COLUMN_MODE and iRowBlinking are not 0, continue
	           {
				  SET_MONOME_COMD_LED_ROW( bMonomeData[ MONOME_BUFFER_IDX_COMD ], iBlinkRow );
	              SET_MONOME_DATA_LED_ROWCOL_ON( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
	              FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
	           }

	           if ( BLINK_ROW_COLUMN_MODE && iColBlinking )		//if both BLINK_ROW_COLUMN_MODE and iColBlinking are not 0, continue
	           {
	              SET_MONOME_COMD_LED_COL( bMonomeData[ MONOME_BUFFER_IDX_COMD ], iBlinkCol );
	              SET_MONOME_DATA_LED_ROWCOL_ON( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
	              FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
	           }
	        }
	        else
	        {
	           if ( IS_MONOME_KEYPRESS_UP( bMonomeData[ MONOME_BUFFER_IDX_COMD ] ) )
	           {
	              SET_MONOME_COMD_LED_OFF( bMonomeData[ MONOME_BUFFER_IDX_COMD ] );
	              FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );

	              if ( BLINK_ROW_COLUMN_MODE && iRowBlinking )	//if BLINK_ROW_COLUMN_MODE and iRowBlinking are enabled, reset row blinking to off
	              {
	                 iRowBlinking = 0;
	                 SET_MONOME_COMD_LED_ROW( bMonomeData[ MONOME_BUFFER_IDX_COMD ], iBlinkRow );
	                 SET_MONOME_DATA_LED_ROWCOL_OFF( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
	                 FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
	              }

	              if ( BLINK_ROW_COLUMN_MODE && iColBlinking )	//if BLINK_ROW_COLUMN_MODE and iColBlinking are enabled, reset column blinking to off
	              {
	                 iColBlinking = 0;
	                 SET_MONOME_COMD_LED_COL( bMonomeData[ MONOME_BUFFER_IDX_COMD ], iBlinkCol );
	                 SET_MONOME_DATA_LED_ROWCOL_OFF( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
	                 FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
	              }
	           }
	        }
	     }
	     else
	        printf( "ERR: Timed out while trying to read data" );	//return error message stating no button press was detected
	  }
	  else
	     printf( "ERR: Failed to read data\n" );	//print error message to state a failed device connection
   }
   
   SET_MONOME_COMD_BOARDMODE( bMonomeData[ MONOME_BUFFER_IDX_COMD ] );
   SET_MONOME_DATA_BOARD_OFF( bMonomeData[ MONOME_BUFFER_IDX_DATA ] );
   FT_W32_WriteFile( ftConnectionHandle, bMonomeData, dwBufferSize, &dwBufferActualSize, NULL );
   FT_W32_CloseHandle( ftConnectionHandle );
   return 1;	//returns exit status value
}




File manager


Attachment Timestamp Size
keypad_uncovered.jpg 2009-07-13 12:16 52.39 KB
keypad_cover_rear.jpg 2009-07-13 12:16 38.84 KB
keypad.jpg 2009-07-13 12:16 46.03 KB
contained_logic_board.jpg 2009-07-13 12:15 51.12 KB
monome_smile.jpg 2009-07-07 15:47 11.25 KB
board_lego_03.jpg 2009-06-30 06:16 79.56 KB
board_lego_02.jpg 2009-06-30 06:15 82.54 KB
board_lego_01.jpg 2009-06-30 06:15 78.49 KB
ftd2xx.lib 2009-06-24 14:59 18.61 KB
ftd2xx.h 2009-06-24 14:58 22.84 KB