bananasiong
New Member
Yes, you're right. The LED is not necessary going off, but toggle.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
PORTDbits.RD1 = 1;
Yea I know these..mrfunkyjay said:Input is actually the Push Button RA4 (S2)
Output is actually the LED at PORTD
Yes, you can read the output as I said before. If you're only waiting for the button to be pressed, then you don't need to loop as the LED will stay on. Just poll the input RA4.Err.... so u mean I read from the LED. If it turns ON then just keep looping the flashing command until the next button pressed?
That was the question I answered.When I pressed it once, LEDS switched on forever until I pressed the push button again, then LEDS switched off.
char Previous;
#include <p18f4520.h>
#include <delays.h>
#pragma config OSC = HS
#pragma config WDT = OFF
#pragma config LVP = OFF
char Previous;
void main(void)
{
/*Settings*/
TRISD=0b00000000;
TRISA=0b00010000;
ADCON1=7;
TRISB=0b00000001;
Previous=PORTAbits.RA4;
if(PORTAbits.RA4==0 && Previous==1)
{
PORTDbits.RD1 = ~PORTDbits.RD1;
}
}
bananasiong said:May I know where the Logic Analyzer tool is? I can see only UART tool from PICkit 2 software.
Thanks
Do you have v2.5? It's a new addition, I think. I haven't downloaded it yet.bananasiong said:May I know where the Logic Analyzer tool is? I can see only UART tool from PICkit 2 software.