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

Robertrip
Fri Apr 26 2024, 11:20 am
ArnoldDiant
Fri Apr 26 2024, 03:53 am
RodneyKnorb
Thu Apr 25 2024, 07:08 pm
Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm