Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

pwm modulation for unipolar motor

Status
Not open for further replies.

paritybit

Newbie level 5
Newbie level 5
Joined
Dec 20, 2011
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
FLORIDA
Activity points
1,345
Hello world,
please can anyone help concerning my new code i wrote.I debug it using arduino and AVR studio 5.1 but i found it very difficult to run the code because it sees some error and warning in the code am using c as my programming language. and i would be glad if anyone can help me in correcting the error in it and making it to run am using atmega32u4 as my microcontroller and atmega328
.. The actual function of my code is to generate pwm for unipolar motor there is 0-7 pin at port A and i want two pins to go high at once delay for 250ms so i wrote the hex file for the two pins and that is 0x05,0x09,0x06,0x0A so the hex signify when the two pin are high together and it increment in step until the final step is reach and that is step 4 and a while loop start again and again. thanks i will really appreciate you assitance.




/* pulse generated to control the pulse width modulation of
unipolar motor.
*/

#include<stdio.h>

}
void setup() /*Beginning of the body of the program*/

int led =0; /* start from the begining*/
{
int led_array_[4]=(0x05,0x09,0x06,0x0A) /* pins use as output*/

void loop ()
{
p1=~led_array(led);
delay (250);
led++;
if (led==4)led=0;
}
}
}
 

/* pulse generated to control the pulse width modulation of
unipolar motor.
*/

#include<stdio.h>

void setup() /*Beginning of the body of the program*/
{
int led =0; /* start from the begining*/

int led_array_[4]=(0x05,0x09,0x06,0x0A) /* pins use as output*/
}
void loop ()
{
p1=~led_array(led);
delay (250);
led++;
if (led==4)led=0;
}
void main(void)
{
for(;;)
{

}
}
but i think ur c language and controller is weak so read mazidi book for 8051
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top