In SX Microcontrollers, SX/B Compiler and SX-Key Tool, johncouture wrote: I think I understand how interrupts work but I'm having difficulty calling a subroutine later in the program. In other words, readI2C below is a subroutine that reads from an I2C RTC (these are borrowed Jon Williams MEMOUT and MEMIN routines). temp4 is just the memory location. Error given by the compiler is: "Invalid number of Parameters" writeI2C is going to give me trouble too. It seems odd that you have to declare the SUB calls AFTER the Interrupt declaration which may be why the compiler does not like those subroutine calls. I need to use the read and write routines later in the program also so moving them before the Program Start does not solve the problem. ' ------------------------------------------------------------------------- INTERRUPT ' ------------------------------------------------------------------------- ISR_Start: if Sensor = 0 THEN for temp4 = 0 to 10 lcdChr = readI2C temp4 writeI2C temp4 + 20 pause 1 next SOUND Piezo, 80, 200 ' Audible Alert to say ready to get started pause DelayForBounce endif RETURNINT ' {cycles} '======== PROGRAM START '======== readI2C SUB 1 ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=89749 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)