Mpin_xxxx Library

Mpin_xxxx library contains macros for pin and port manipulation of microcontrollers. this library use full for access any pin or port and from this library make any in Pinmode INPUT | OUTPUT, from this library write any in pin digitally HIGH | LOW and also toggle Pinmode and digital pin. This library is named by different names in micro studio core system such as Mpin_8051, Mpin_8052, Mpin_Pic16, MPin_pdk13 etc..

How to define a pin in MikroStudio for this library

#define LED A,2 // PORTA, bit 2

#define  BUTTON B,4 // PORTB, bit 4

Following functions can be used by this library.
  • MpinMode(LED,OUTPUT); // Makes the pin OUTPUT.
  • MpinMode(BUTTON,INPUT); // Makes the pin INPUT.
  • MpinModeToggle(LED); // Toggling pinmode INPUT or OUTPUT.
  • MdigitalWrite(LED,LOW); // Writeing digital pin output LOW.
  • MdigitalWrite(LED,HIGH); // Writeing digital pin output HIGH.
  • MdigitalToggle(LED); // Toggling digital pin output HIGH or LOW.
  • bool bt = MdigitalRead(BUTTON); // Reading digital pin input HIGH or LOW.

Author: Admin

Leave a Reply