Discussion in "Project Addition or Changes" started by    wiresolder    Mar 7, 2015.
Sat Mar 07 2015, 10:07 am
#1
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,
Sat Mar 07 2015, 11:36 am
#2
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 08 2015, 04:34 pm
#3
thanks
Sun Mar 15 2015, 10:42 am
#4
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?
Mon Mar 16 2015, 01:26 am
#5
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
#6
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.


Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am