Click here to Skip to main content
15,936,517 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
GeneralRe: Cpu pins Pin
Calin Negru7-Oct-23 4:24
Calin Negru7-Oct-23 4:24 
GeneralFirst question solved and with your permission I came up with another one Pin
Calin Negru7-Oct-23 8:05
Calin Negru7-Oct-23 8:05 
GeneralRe: First question solved and with your permission I came up with another one Pin
Dave Kreskowiak7-Oct-23 9:15
mveDave Kreskowiak7-Oct-23 9:15 
GeneralRe: First question solved and with your permission I came up with another one Pin
Calin Negru7-Oct-23 21:23
Calin Negru7-Oct-23 21:23 
AnswerRe: Cpu pins Pin
trønderen7-Oct-23 13:20
trønderen7-Oct-23 13:20 
GeneralRe: Cpu pins Pin
Calin Negru7-Oct-23 21:16
Calin Negru7-Oct-23 21:16 
QuestionZero insertion force (zif) connector esthetes, listen up! Pin
RedDk7-Sep-23 6:50
RedDk7-Sep-23 6:50 
QuestionArduino not looping??? Pin
glennPattonWork321-Jun-23 4:14
professionalglennPattonWork321-Jun-23 4:14 
Hi All,

Using an Arduino to drive a servo motor (well trying).
C++
#include <Servo.h>

Servo myServo;
int servoPin = 2;
uint16_t i = 0;

void setup() {
  // put your setup code here, to run once:
 myServo.attach(servoPin);
 pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  HERE:
  i = 0;
   for(i = 1; i <= 180; i++)
   {
    myServo.write(i);
    delay(15);
  }
 for(i = 180; i >= 1; i--)
  {
    myServo.write(i);
     delay(15);
  }
goto HERE;
}
Now what I believe Should happen is digital Pin 2 which is being used as the servo pin goes high and the due to the loop the pulse is 'stretched' from 1 to 180 which is taken by Servo and magiced it into a value and sent via pin 2, once this is done the value get counted down from 180 back to 1 by the second loop.
What happens is by scoping the pin the pulse is one get to 180 counts back and does not loop.
This started as a 'Hmmm' problem and has slowly been upgraded. I have put the loops in separate functions to see if that helps, no. Google has been a no and I can't log on to Arduino board as my Pass word was rejected ands the sent pass word link doesn't. Going fully bananas here.

Glenn

PANIC OVER THE CODE NOW WORKS!
AnswerRe: Arduino not looping??? Pin
pkfox21-Jun-23 5:26
professionalpkfox21-Jun-23 5:26 
GeneralRe: Arduino not looping??? Pin
glennPattonWork321-Jun-23 6:13
professionalglennPattonWork321-Jun-23 6:13 
AnswerRe: Arduino not looping??? Pin
jschell21-Jun-23 6:01
jschell21-Jun-23 6:01 
GeneralRe: Arduino not looping??? Pin
glennPattonWork321-Jun-23 6:16
professionalglennPattonWork321-Jun-23 6:16 
AnswerRe: Arduino not looping??? Pin
Dave Kreskowiak21-Jun-23 6:07
mveDave Kreskowiak21-Jun-23 6:07 
GeneralRe: Arduino not looping??? Pin
glennPattonWork321-Jun-23 6:15
professionalglennPattonWork321-Jun-23 6:15 
AnswerRe: Arduino not looping??? Pin
honey the codewitch21-Jun-23 13:24
mvahoney the codewitch21-Jun-23 13:24 
AnswerRe: Arduino not looping??? Pin
Ed Attfield22-Jun-23 1:53
Ed Attfield22-Jun-23 1:53 
GeneralRe: Arduino not looping??? Pin
glennPattonWork322-Jun-23 5:41
professionalglennPattonWork322-Jun-23 5:41 
QuestionMini PC Pin
VE27-Jun-23 2:14
VE27-Jun-23 2:14 
AnswerRe: Mini PC Pin
Gerry Schmitz7-Jun-23 3:30
mveGerry Schmitz7-Jun-23 3:30 
GeneralRe: Mini PC Pin
jschell7-Jun-23 5:25
jschell7-Jun-23 5:25 
GeneralRe: Mini PC Pin
Gerry Schmitz7-Jun-23 6:05
mveGerry Schmitz7-Jun-23 6:05 
QuestionAny RFID (13.56) experts?? Pin
glennPattonWork36-Jun-23 1:52
professionalglennPattonWork36-Jun-23 1:52 
AnswerRe: Any RFID (13.56) experts?? Pin
jschell6-Jun-23 4:57
jschell6-Jun-23 4:57 
GeneralRe: Any RFID (13.56) experts?? Pin
glennPattonWork36-Jun-23 5:18
professionalglennPattonWork36-Jun-23 5:18 
GeneralRe: Any RFID (13.56) experts?? Pin
jschell7-Jun-23 5:14
jschell7-Jun-23 5:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.