Dare2Tech
  • Home
    • Electronics
    • About
    • Contact
  • Electronics
    • PIC32 Topics
    • Transistors
  • About
  • Contact
  • Home
    • Electronics
    • About
    • Contact
  • Electronics
    • PIC32 Topics
    • Transistors
  • About
  • Contact

Ways to Toggle digital pin

5/26/2015

0 Comments

 
There are many different ways to toggle a digital pin on a PIC32 microcontroller using MPIDE or UECIDE.

I will be going over a few different ways available and then going over the details for each if there is any interest in a complete code example to run.



1)    digitalWrite(14, HIGH);
       digitalWrite(14, LOW);

2)    LATA |= 1;
       LATA &= ~1;

3)    LATAbits.LATA1 = 1;
       LATAbits.LATA1 = 0;

4)    digitalWrite(14, ~digitalRead(14));

5)    digitalWrite(14, !digitalRead(14));

6)    LATAINV =1;

7)    LATASET=1;
       LATACLR=1;

Do you have a favorite way to access a digital pin or another way not listed?

Feel free to leave a comment below.
Disclaimer - About Page

0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Author

    I'm a Computer Engineer with passion for hardware & software.

    Categories

    All
    PIC32
    Transistors

    Archives

    August 2015
    June 2015
    May 2015

    RSS Feed

Electronics
About
Contact
Mobile Site