EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / do it in this way. don’t

do it in this way. don’t

|

Microcontroller › PIC › Novice at Microcontrollers › do it in this way. don’t

November 22, 2012 at 5:35 pm #8782
AJISH ALFRED
Participant

do it in this way.

 

don’t write anything inside the while (1) loop

befor while loop write a code for turn the led on and after sometimes it go off.

 

void main()
{
    ADCON1=0x0F;            // Set all pins as digital I/O
    CMCON=0x07;             // Set all comparators as digital I/O
    TRISEbits.RE0=0;            // Configure pin RE0 as output
    TRISBbits.RB0=1;            // Configure pin RB0 as input

     LATEbits.LATE0=1;   // Turn the LED On
     delay_ms (3000); //3 seconds delay here
    LATEbits.LATE0=0;   // Turn the LED Off

    while(1)
    {
       ;
    }
}

 

If your port settings and the circuit are alright, the led will on first then after 3 seconds it will go off. Please try and update

RSS Recent Posts

  • Fixing board, Easy question HEX SCHMITT July 9, 2025
  • Can I make two inputs from one?? July 9, 2025
  • The Analog Gods Hate Me July 9, 2025
  • How to make string LEDs? July 9, 2025
  • It's Amazing What A Buck And A Quarter.... July 8, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise