Forum > Embedded - AVR

lazarus Arduino servo control

(1/3) > >>

flori:
Hi everyone!
Does anyone know how to assign a button  for example: (stop servo, start, rotate 180 ) in lazarus to control the servo motor.  So! I want to control button with the servo motor.
I use SdpoSerial1 and COM7 port is active.
Thank you.
This is my arduino code:

#include <Servo.h>
Servo myservo;
int pos=0;
void setup() {
  // put your setup code here, to run once:
myservo.attach(5);
Serial.begin(9800);

}

void loop() {
  // put your main code here, to run repeatedly:
for (pos=0; pos<180; pos++){
  myservo.write(pos);
  delay(100);
  Serial.print("Servo pos: ");
  Serial.println(pos);
}
}

MarkMLl:
I don't see the connection between this and Lazarus. Please explain what you're asking us to do.

MarkMLl

flori:
This>

flori:
I would like to control  servo motor with lazarus

MarkMLl:
And...? That's running on a PC isn't it? The code you've shown us is running on an Arduino. Where's the connection?

/Specifically/, what in the Arduino code is waiting for commands- in some format or other- to arrive over the serial port from a PC? Once you've got that you can look at generating the commands on the PC, but not before.

MarkMLl

Navigation

[0] Message Index

[#] Next page

Go to full version