ahmadfaizzakian
Newbie level 2
- Joined
- Feb 2, 2014
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 19
hello,im new around here and im not limited internet connection. im doing a project named automatic handwash with auto refill. well here is my coding. im using mikroC for the coding.
based on the coding, i manage to get all the washing circuit to work, but my problem is on the refill circuit as i dont know the coding. i know that port A can be used as ADC but i dont know how to use it. my liquid level sensor circuit work properly but i need the coding on PIC. i want to make when port A2 and A3 read 0V,it will turn on port D2 and D3.. can anyone help me?? im really noob in this:-(
please and thank you
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 void portb0() ; void main() { int mot0 = 0; int mot1 = 0; TRISA = 0b00000000; PORTA = 0x00; TRISB = 0b00000000; PORTB = 0x00; TRISC = 0b11111111; PORTC = 0x00; TRISD = 0b11111111; PORTD = 0x00; while (1) { if (PORTC.f0 == 1) while(1) { portb0() ; if (porta.f1 = 0) portd.f2 = 1 ; delay_ms(5000) ; if (porta.f2 = 0) portd.f3 = 1; delay_ms(5000) ; break ; } else { PORTB == 0 ; } } } void portb0 (void) { portb.f0 = 0x00000001 ; //air delay_ms(600) ; portb.f0 = 0x00000000 ; portb.f1 = 0x00000001 ; //sabun delay_ms(150) ; portb.f1 = 0x00000000 ; portb.f0 = 0x00000001 ; //air delay_ms(600) ; portb.f0 = 0x00000000 ; portb.f2 = 0x00000001 ; //blower delay_ms(600) ; portb.f2 = 0x00000000 ; portb.f3 = 0x00000001 ; //sanitizer delay_ms(150) ; portb.f3 = 0x00000000 ; }
based on the coding, i manage to get all the washing circuit to work, but my problem is on the refill circuit as i dont know the coding. i know that port A can be used as ADC but i dont know how to use it. my liquid level sensor circuit work properly but i need the coding on PIC. i want to make when port A2 and A3 read 0V,it will turn on port D2 and D3.. can anyone help me?? im really noob in this:-(
please and thank you