![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
Hi .. I wrote the following code in Keil for a 89s52 and downloaded it to the chip.. It is only for the bot to move straight..I am using a L298HN ..the code ompiled successfully .. But the bot does not move .. I am getting a voltage reading of 3-4 volts at the Port 2 pins .. PLzz help me out .. | |
| |
| | #2 |
|
try this ok //-------------------------------------------------------------------- #include<AT89x52.h> int forward=0x33; //assum the code for for movement int revers=0xD2; //assum the code for rev movement //----------------------------------------- void gofor(); void gorev(); void delay(); //----------------------------------------- void main() { while(1){ gofor(); delay(); delay(); delay(); delay(); gorev(); delay(); delay(); delay(); delay(); } return; } //----------------------------------------- void gofor() { P2=forward; } //----------------------------------------- void gorev() { P2=revers; } //----------------------------------------- void delay() { for(; ;for(; ;} //----------------------------------------- | |
| |
| | #3 |
|
The robot go forward with motor I think you should learn how to control motor first.
__________________ Microcontroller Programming Forums: http://forum.mcuprogramming.com Answer to your questions! --- Microcontroller Programming Blog: http://mcu-programming.blogspot.com uC - News, Resources and Tutorials | |
| |
| | #4 |
|
i could not quite understand sci-3d .. i'll shortly put up the circuit i am using ..
| |
| |
| | #5 |
|
I have attached the l298 ckt that i am using .. will some one plzz look it up and tell me if it is correct or not | |
| |
|
| Tags |
| 89s52, problem, program |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| program for writing and testing circuits | luca-deltodesco | General Electronics Chat | 3 | 13th August 2006 11:17 AM |
| Newbie, please help with power problem | techieguy | Micro Controllers | 11 | 25th July 2005 01:07 PM |
| Program Address for 16F628A | johnnyquest | Micro Controllers | 1 | 11th January 2005 07:47 PM |
| Problem with 89S52 | rellutzu | Micro Controllers | 6 | 24th May 2004 03:23 AM |
| PicBasic Keypad program | Sora | Micro Controllers | 0 | 20th April 2004 08:02 PM |