im having a problem controlling a stepper motor using a microcontroller..what i did is that i test it with my board coz it has led's to check whether its working or not..we are tasked to make a program in c++ that would make a variable reluctance stepper motor work. If you press the the R button the rotor of the stepper motor will turn forward (clockwise), if you press L it will turn backward (counter clockwise), and if you press S the program will stop.. so how would you be able to make a program out of this conditions?
programmingnoob
0
Light Poster
Recommended Answers
Jump to PostThis looks more like C than C++... Anyway, to be able to do something like you described, you'll need real-time I/O. This isn't supported by standard C/C++, so you'll have to look into your compiler documentation for more information regarding this (or get a third-party library to handle it). Oh, …
Jump to PostWhy didn't you use CODE-TAGS as Joey mentioned? Why did you use void main ()?
*heres the code i made, but it didnt work..
What doesn't work? Does it compile/run/..?
Niek
Jump to Postvoid main() is fine. There isn't an OS. The code runs in an infinite loop until the power is removed.
Jump to PostWhy would you attempt to start writing code to control a circuit if you're not sure of it's wiring.
Everything about the motor, you should find in the datasheet.
Jump to Postyou should be able to simulate the computer input "manually" to verify it's functioning before frustrating yourself by chasing a phantom.
That's troubleshooting 101. Keep cutting the problem in half. Verify what works vs. what doesn't.
Then continue to break down the components of the non-working section, etc.…
All 24 Replies
programmingnoob
0
Light Poster
John A
1,896
Vampirical Lurker
Team Colleague
programmingnoob
0
Light Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
Colin Mac
53
Posting Whiz
programmingnoob
0
Light Poster
Colin Mac
53
Posting Whiz
JRM
107
Practically a Master Poster
programmingnoob
0
Light Poster
programmingnoob
0
Light Poster
John A
1,896
Vampirical Lurker
Team Colleague
programmingnoob
0
Light Poster
JRM
107
Practically a Master Poster
John A
1,896
Vampirical Lurker
Team Colleague
programmingnoob
0
Light Poster
John A
1,896
Vampirical Lurker
Team Colleague
JRM
107
Practically a Master Poster
JRM
107
Practically a Master Poster
programmingnoob
0
Light Poster
programmingnoob
0
Light Poster
JRM
107
Practically a Master Poster
farris
0
Newbie Poster
Yumie_1
0
Newbie Poster
rproffitt
2,565
"Nothing to see here."
Moderator
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.