vinit13
Junior Member level 2

- Joined
- Nov 8, 2015
- Messages
- 23
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Location
- Bangalore, India
- Activity points
- 177
I have a power supply circuit...how do i turn it on
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.
Hi,
i previously used a solid state relay.
Something similar to S202S02 from SHARP...
i have kept R4 as 240 because relay coil resistance is 240 ohms.
//define RB0 as input
TRISB.B0=1;
//define RDO as output
TRISD.B0=0;
do
{
LATD0_bit= ! PORTB0_bit;
Delay_ms(100);
}
wile(1);
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #include<p18f452.h> #define sw PORTBbits.RB0 #define out PORTDbits.RD0 void main() { TRISBbits.TRISB0=1; TRISDbits.TRISD0=0; while(1) { if(sw==1) { out=1; } else out=0; } }
#define out PORTDbits.RD0
#define out LATDbits.LATD0
I am not clear about one thing...in your diagram..+30V line is connected to 5V supply...and the same line is connected to relay and diode...i didn't understand...could u please elaborate on that part?
#include<p18f452.h>
#define sw PORTBbits.RB0
#define out [B]LATDbits.RD0[/B]
#define led LATDbits.RD1
void main()
{
TRISBbits.TRISB0=1;
TRISDbits.TRISD0=0;
while(1)
{
if(sw==1)
{
out=1;
}
else
out=0;
// test if programme is running
Led=1;
delay_ms(500);
Led=0;
delay_ms(500);
}
}