I'm STUCK! I posted a short piece of code as an example. The first 3 lines work well. Power up the PIR, read the signal Turn the MOSFET switch on or off. (Powers the servo from the UNO) I need to do the same thing at the same time with the servo.write but I can't for the life of me figure it out since it isn't a digital or analog write. There is bound to be a statement? or maybe even a combo statement to do both at the same time??? Thank you!
void loop() {
digitalWrite(POWER_PIR, HIGH); //turns on the PIR
val = digitalRead(PIR_SIGNAL); // read the input pin
digitalWrite(POWER_MOSFET, val); // sets the MOSFET to the PIRS's value, HIGH or LOW
servo1.write(0);
delay(100);
servo1.write(10);
delay(50);
So what does it do?
And what exactly are you trying to do?
Given that you have just used the value of val, to turn off the FET that powers the servo why would you expect any servo movement anyway?
It is quite clear that you have not posted enough information about your project.
Please post the full code, and what you are trying to do along with full schematic.
well that's another problem in it's self, at the moment the servo is connected directly to a power source. because when I try to power it from the mosfet, it just wigs out. But, it should also STOP sending the servo.write call. I also believe another issue is that I an using delays. so I'll be looking into millis because as I understand it, they don't BLOCK code, Is that correct?
The may or may not block code it depends on how you write them.
Thank you for ignoring my request for all that information that is needed to help you solve your problem. Sorry it is needed because my crystal ball is in for its annual service at the moment.
Maybe you will find some one else who's crystal ball still works.
Good bye.
I will put this thread on mute so I will not see any more posts in it.