help with 8051 Toll Plaza code mod to include motor control
Discussion in "Project Addition or Changes" started by wiresolder Mar 7, 2015.
Sat Mar 07 2015, 10:07 am
Hello!
I am tinkering with a hobby project of 8051 toll plaza here:
engineersgarage.com/microcontroller/8051projects/simple-toll-plaza-rfid-interface-at89c51-circuit.
Where should I add the code to control a dc motor after the main code executes?
here's the code: http://textdump.net/read/6881/
Best Regards,
I am tinkering with a hobby project of 8051 toll plaza here:
engineersgarage.com/microcontroller/8051projects/simple-toll-plaza-rfid-interface-at89c51-circuit.
Where should I add the code to control a dc motor after the main code executes?
here's the code: http://textdump.net/read/6881/
Best Regards,
Sat Mar 07 2015, 11:36 am
You can add it anywhere inside this loop:
if(tool==0) { // You can add it here... lcd_string("Thank you User "); lcd_command(0x8F); lcd_data(49+i); delay(250); lcd_command(0x01); lcd_string("Charges 10.00"); amount[i]=amount[i]-10; lcd_command(0xC0); lcd_string("Amt left "); balance=amount[i]; lcd_display(balance); lcd_command(0xCD); lcd_string(".00"); // or anywhere above this comment delay(250); lcd_command(0x01); // Rest of the code..
Sun Mar 15 2015, 10:42 am
Hi!!
I am using a simple LED program to test my idea for the toll plaza
here:
http://codepaste.net/eon5o1
but i get the following error
Line 285 ATP.C(285): error C141: syntax error near 'sbit'
Line 287 ATP.C(287): error C141: syntax error near 'void'
How can I correct this?
I am using a simple LED program to test my idea for the toll plaza
here:
http://codepaste.net/eon5o1
but i get the following error
Line 285 ATP.C(285): error C141: syntax error near 'sbit'
Line 287 ATP.C(287): error C141: syntax error near 'void'
How can I correct this?
Mon Mar 16 2015, 01:26 am
You cannot define sbit (special bit) variable inside a loop or a function. You have to do it outside or say a global variable instead.
Mon Mar 16 2015, 01:33 am
There are several other errors as well, caused by trying to 'hack' the original program.
You have repeat definitions for Led, delay() and Main().
there are probably miss placed brackets as well.
It may be better to create a fresh program for your test code.
You have repeat definitions for Led, delay() and Main().
there are probably miss placed brackets as well.
It may be better to create a fresh program for your test code.
Powered by e107 Forum System