ISC15ANP4 NKK smart switch

Found this online, but cannot compile getting errors, any hints/tips ?

/*######################### SMART BUTTON EXAMPLE  ############################
       This sketch gives a really basic example of how to send images to the Smart Button from NKK.  The button
       is just a basic button but the LCD screen is programmed with SPI.  We use one of our smart switch boards
       that uses an i2C to look for button presses and also send the control line to the smart switch.  The smart
       switch has a "selected" pin that needs to be high for the button to receive the data.
 
   From: Mike Myers (http://mikemyers.me)  @netnutmike
       Let's Make It Episode 36 at http://tech-zen.tv
       
       http://tech-zen.tv
       
       For the sample code, show notes, contact information and many more 
       videos, visit the show page at http://tech-zen.tv/letsmakeit

       Please subscribe to our YouTube channel or our netcasts at any of 
       your favorite netcast / podcast outlets.

       We normally record Let's Make It live on Monday evenings around 
       9pm eastern. You can watch it live by going to tech-zen.tv and clicking 
       the live link at the top of the page.

       We also have a community setup for our viewers and listeners. You can 
       join the community by going to community.tech-zen.tv.

       We love input on what you would like to know or if you have an idea for 
       a new Let's Make it episode, you can contact us via email or phone at 
       the show information page.
################################################################################*/

#include <Wire.h>
#include <MCP23017.h>

#include <NKKSmartSwitch.h>
NKKSmartSwitch SmartSwitch;


// Animated logo
static uint8_t movielogo[] PROGMEM = {
  32, // width
  20, // height

  /* page 0 (lines 0-7) */
  0xfc,0xfe,0xf3,0xf3,0xff,0xff,0xf3,0xf3,0xff,0xff,0xf3,0xf3,0xff,0xff,0xf7,0xf3,
  0xff,0xff,0xf7,0xf3,0xf7,0xff,0xff,0xf3,0xf3,0xfe,0xfc,0x80,0x80,0xc0,0xc0,0xc0,
  
  /* page 1 (lines 8-15) */
  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0x1f,0x3f,0x3f,0x7f,
  
  /* page 2 (lines 16-23) */
  0x3,0x7,0xc,0xc,0xf,0xf,0xc,0xc,0xf,0xf,0xc,0xc,0xf,0xf,0xe,0xc,
  0xf,0xf,0xe,0xc,0xe,0xf,0xf,0xc,0xe,0x7,0x3,0x0,0x0,0x0,0x0,0x0,
  
};




void setup() {

  // Start the Serial (debugging) and UDP:
  Serial.begin(9600);  

  // Always initialize Wire before starting the SmartSwitch library
  Wire.begin(); 

  // Switches on address 0:  
  //SmartSwitch.begin(0);    // Address 0, pins 5+6 default
  SmartSwitch.begin(7, 48, 49);    // Address 4, pins 48+49

  // Setting full brightness (range 0-7) of all buttons:
  SmartSwitch.setButtonBrightness(7, BUTTON_ALL);
  SmartSwitch.setButtonBrightness(7, BUTTON_ALL);

  // Setting white color for all buttons:
  SmartSwitch.setButtonColor(3,3,3,BUTTON_ALL);

  // Clear the display (if anything is on it:)
  SmartSwitch.clearScreen(BUTTON_ALL);
  delay(500);

  // Draw an image on the pixmap for button 1, centered, but offset -2 pixels in y direction (upwards). X-Y has origin in upper left corner and positive axes towards right/down
  SmartSwitch.drawImage(BUTTON1, 0, -2, IMAGE_CENTER, movielogo);
  SmartSwitch.updateScreen(BUTTON1);  // Writes the buffered pixmap to the button.
  delay(500);

  // Writing a bit of text on top of the pixmap - and write to button:
  SmartSwitch.writeText(BUTTON1, "TESTING", 3, TEXT_CENTER | TEXT_BACKGROUND | TEXT_REVERSE);
  SmartSwitch.updateScreen(BUTTON1);  // Writes the buffered pixmap to the button.

}

int i = 0;
int state, modes;

void loop() {
  word buttons = SmartSwitch.buttonUpAll();
  for(int j=0; j<4; j++) {
    if(buttons & (1 << j)) {
      modes = SmartSwitch.getButtonModes();
      Serial.print("Button ");
      Serial.print(j, DEC);
      Serial.println(" was pressed!");
      state = modes >> j*2 & B11;
      Serial.print("State: ");
      Serial.println(state, BIN);
      if(state == 0) {
        SmartSwitch.clearPixmap(1<<j);
        SmartSwitch.drawLine(0,0,63,31, 1<<j);
        SmartSwitch.drawLine(0,31,63,0, 1<<j);
        SmartSwitch.drawHorisontalLine(0, 1<<j);
        SmartSwitch.drawHorisontalLine(31, 1<<j);
        SmartSwitch.drawVerticalLine(0, 1<<j);
        SmartSwitch.drawVerticalLine(63, 1<<j);
        SmartSwitch.updateScreen(1<<j);
        SmartSwitch.setButtonModes(modes ^ 1 << 2*j);
        SmartSwitch.setButtonColor(3,0,0, 1<<j);
      } else if (state == 1) {
        SmartSwitch.clearPixmap(1<<j);
        SmartSwitch.drawCircle(31, 16, 21, 1<<j);
        SmartSwitch.updateScreen(1<<j);
        SmartSwitch.setButtonModes(modes ^ (state | 2) << 2*j);
        SmartSwitch.setButtonColor(0,3,0, 1<<j);
      } else {
        SmartSwitch.clearPixmap(1<<j);
        SmartSwitch.updateScreen(1<<j);
        SmartSwitch.setButtonModes(modes ^ state << 2*j);
        SmartSwitch.setButtonColor(0,0,3, 1<<j);
      }
      Serial.print("ButtonState: ");
      Serial.println(SmartSwitch.getButtonModes(), BIN);
      
    }
  }
  
}

void animatedBox() {
    int i = 0;
    int inc = 3;
    while(1){
    i = i + inc;
    if(i+12 > 256) {
      inc = -5;
      
    } else if(i < 0) {
      inc = 5;
      continue;
    }
    SmartSwitch.clearPixmap(15);
    SmartSwitch.updateScreen(15);
    }
}

Sorry, my crystal ball is broken, but which compile errors?

// Per.

Arduino: 1.6.7 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\raoul\Documents\Arduino\sketch_feb10a\sketch_feb10a.ino: In function 'void updateDisplay(char*)':

sketch_feb10a:72: error: 'imageGroupNum' was not declared in this scope

  SS_Image(FULLH, NBG, BLACK, imageGroupNum);

                              ^

C:\Users\raoul\Documents\Arduino\sketch_feb10a\sketch_feb10a.ino: In function 'void SS_Init(int, char)':

sketch_feb10a:79: error: 'DIM' was not declared in this scope

  if (Bright == DIM) {

                ^

sketch_feb10a:149: error: 'DIM' was not declared in this scope

  if (Bright == DIM) {

                ^

C:\Users\raoul\Documents\Arduino\sketch_feb10a\sketch_feb10a.ino: In function 'void SS_Image(byte, byte, byte, int)':

sketch_feb10a:246: error: 'SPI' was not declared in this scope

        SPI.transfer(tval);  // write data 

        ^

sketch_feb10a:252: error: 'SPI' was not declared in this scope

        SPI.transfer(tval);  // write data 

        ^

C:\Users\raoul\Documents\Arduino\sketch_feb10a\sketch_feb10a.ino: In function 'void SwitchSelect(int, byte)':

sketch_feb10a:313: error: 'NUMSWITCH' was not declared in this scope

  for(int ctr=0; ctr<NUMSWITCH; ctr++)  digitalWrite(LCDpin[ctr], HIGH);   // set all selects off

                     ^

sketch_feb10a:313: error: 'LCDpin' was not declared in this scope

  for(int ctr=0; ctr<NUMSWITCH; ctr++)  digitalWrite(LCDpin[ctr], HIGH);   // set all selects off

                                                     ^

sketch_feb10a:323: error: 'LCDpin' was not declared in this scope

    digitalWrite(LCDpin[Dat], LOW);  

                 ^

C:\Users\raoul\Documents\Arduino\sketch_feb10a\sketch_feb10a.ino: In function 'void SPI_Write(int, byte)':

sketch_feb10a:344: error: 'SPI' was not declared in this scope

  SPI.transfer(value);

  ^

C:\Users\raoul\Documents\Arduino\sketch_feb10a\sketch_feb10a.ino: In function 'void Mode(boolean)':

sketch_feb10a:350: error: 'DCpin' was not declared in this scope

  if(DC == COMMAND) digitalWrite(DCpin, LOW); 

                                 ^

sketch_feb10a:351: error: 'DCpin' was not declared in this scope

  else digitalWrite(DCpin, HIGH);

                    ^

C:\Users\raoul\Documents\Arduino\sketch_feb10a\sketch_feb10a.ino: In function 'void SD_Read8(int, char*)':

sketch_feb10a:384: error: 'myFile' was not declared in this scope

  if(myFile.open(FileName,O_READ)){

     ^

sketch_feb10a:384: error: 'O_READ' was not declared in this scope

  if(myFile.open(FileName,O_READ)){

                          ^

C:\Users\raoul\Documents\Arduino\sketch_feb10a\sketch_feb10a.ino: In function 'void SD_Read16(int, char*)':

sketch_feb10a:531: error: 'myFile' was not declared in this scope

  if(myFile.open(FileName,O_READ)){

     ^

sketch_feb10a:531: error: 'O_READ' was not declared in this scope

  if(myFile.open(FileName,O_READ)){

                          ^

exit status 1
'imageGroupNum' was not declared in this scope

 This report would have more information with
 "Show verbose output during compilation"
 enabled in File > Preferences.

Please edit your post and add the tags so it's readable.

// Per.

Hello,

where have you downloaded the library for this sketch?

(There is a line "#include <NKKSmartSwitch.h>" in the code)

This "NKKSmartSwitch.h" file (and probably a "NKKSmartSwitch.cpp", too) is essential for driving the displays of the Smart Switches.

I've searched everything I could find about Mike Myers and his "http://tech-zen.tv/" to find the necessary library files - without success!

It now seems that he has posted completely worthless code because it can only work together with the missing library :sob:

If you have the library, PLEASE share it here!

If you don't have it - that could be a explanation, why it does not work :wink:


edit:

Just out of interest: Are you sure, you have a "ISC15ANP4" ?
I ask, because Mike Myers shows a Smart Switch with a 36x24 Pixel monochrome LCD and the "ISC15ANP4" is a newer generation Smart Switch with a 64x48 Pixel RGB OLED Display. I don't think, you have any chance to get this display to show you anything with this sketch...

But perhaps Skaarhoj's SmartSwitch2 Library can help you. SKAARHOJ-Open-Engineering/ArduinoLibs/SkaarhojSmartSwitch2 at master · kasperskaarhoj/SKAARHOJ-Open-Engineering · GitHub