Hi all,
I'm the beginner of PIC MCU and C also.
I want to make a circuit it's call auto-up/down car window.
- two inputs
- two outputs
- one current sensor (currently not implement yet)
The idea for this is when user push down or up switch the input of this circuit will receive Hi:Lo or Lo:Hi depend on up or down.
When the mcu detect that signal it will count for judge the mode for operation.
If signal is come less than 0.5 sec it will judge it's automatic mode.
Then the mcu will output Hi:Lo or Lo:Hi till the current sensor detect the overcurrent signal. When detected the mcu will stop the output immediately.
But if signal come longer than 0.5sec it judge to manual mode and it will output signal depending on input (if user release button the output will stopped).
So I try to study the PIC and C for do that.
I write below code it's almost satisfy but some problem still occur and I can't fix them.
I need your help on this.
1. Currently the count time not exactly.
2. When it's in automatic mode I want to stop the window by pressing the opposite side key (currently it's not stop but working in opposite direction).
Code:
ignore
Thank you.
Sorry for my poor English.
Last edited by rockuup on Mon Aug 09, 2010 7:07 pm; edited 1 time in total
rockuup
Joined: 07 Aug 2010 Posts: 4
Posted: Mon Aug 09, 2010 10:53 am
Can anybody help me? Please!
I need only when press other button in other mode it will stop output.
please help me to revise the code.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Mon Aug 09, 2010 11:16 am
Most people don't want to look at your code for these reasons:
1. The formatting packs too much code on each line. I think most
people want to look at a more conventional coding style. We don't
want to have to struggle to understand the code.
2. You've dumped a whole program on us, instead of just a little
aspect of it. You've made a program that you don't understand
(that's difficult to read) and you want us to fix it.
rockuup
Joined: 07 Aug 2010 Posts: 4
Posted: Mon Aug 09, 2010 7:06 pm
PCM programmer wrote:
Most people don't want to look at your code for these reasons:
1. The formatting packs too much code on each line. I think most
people want to look at a more conventional coding style. We don't
want to have to struggle to understand the code.
2. You've dumped a whole program on us, instead of just a little
aspect of it. You've made a program that you don't understand
(that's difficult to read) and you want us to fix it.
Thank you for your comment. I will try to do better in the next time.
Currently I'm newbie for both PIC and C language programming.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum