Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4924

pic switching code does not work as i want.

$
0
0
hello,
i am try to code switching code which work some thing like this
when code start pin 1 on and pin 2 off
and continuously check if pin 3 off than
pin 1,2 off
else
if last time pin 1 on than do this
pin 1 off and pin 2 on
if last time pin 2 on than do this
pin 1 on pin 2 off


i try following code;

Code (C):
  1.  
  2. int a = 0;
  3.  
  4. void main() {
  5.  
  6.   TRISA.F0 = 0;  //pin1
  7.   TRISA.F1 = 0;  //pin2
  8.  
  9.   TRISA.F2 = 1;  // input pin
  10.  
  11.   PORTA.F0 = 1;...
pic switching code does not work as i want.

Viewing all articles
Browse latest Browse all 4924

Trending Articles