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
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

  • question about speaker crossover August 19, 2022
  • How does a transistor works as a switch? August 19, 2022
  • Designspark PCB V10.0 on Windows 11 - fails to start August 19, 2022
  • Pedestal fan August 19, 2022
  • Peltier control August 19, 2022

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2022 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