using an Arduino board as an 'Programmer

Ok, thank you. yes i will try running the blinking LED. Right noe i got stuck with uploading the sketch again. I will have to find why. I think it has to do something with the connections.

Ok, the LED are blinking now with the disconnected Arduino board. :wink:

Next step will be the sweep. :slight_smile:

The sweep is working, but not the Code below. I was testing the Code before with the Arduino and everything went fine. With Arduino Pin 4 or pin 5 had to be connected to GD to let the servo do the movment.
Now with the ATmege if connect Pin6 or Pin11 to GD the servo should move, No?

#include <Servo.h>
int button1 = 4; //button pin, connect to ground to move servo
bool press1 ;
bool oldpress1 = false;
bool sweep1state = false;
int button2 = 5; //button pin, connect to ground to move servo
bool press2 ;
bool oldpress2 = false;
bool sweep2state = false;
Servo servo1;


void setup()
{
  pinMode(button1, INPUT_PULLUP);
  pinMode(button2, INPUT_PULLUP);
  servo1.attach(7);
  Serial.begin(9600);
  Serial.println(" make servo sweep to 170  and back to 90 when button 1 pressed ");
  Serial.println(" make servo sweep  to 0 and backk to 90 when button 2 pressed ");
  servo1.write(90);              // initialises the servo to 90
}


void loop()
{
  press1 = digitalRead(button1);  // check button1
  if (press1 == LOW && oldpress1 == HIGH) // test if button has been pressed
  {
    sweep1state = HIGH;         // if yes
  }
  if (sweep1state == HIGH)      // button1 has been pressed, sweep to 170 and back to 90
  {
    servo1.write(170);
    delay(2000);
    servo1.write(90);
    sweep1state = LOW;          // sweep accomplished.
  }
  oldpress1 = press1;           //update press1 for next program loop


  press2 = digitalRead(button2);
  if (press2 == LOW && oldpress2 == HIGH) // test if button has been pressed
  {
    sweep2state = HIGH;         // if yes
  }
  if (sweep2state == HIGH)      // button2 has been pressed, sweep 0 to 0 and back to 
  {
    servo1.write(0);
    delay(2000);
    servo1.write(90);
    sweep2state = LOW;          // sweep accomplished.
  }
  oldpress2 = press2;           //update press1 for next program loop
}

Everything is fine now. i took by mistake Pin15 of the ATmega instead of 13.

I’m glad to hear it’s working now. Thanks for taking the time to post an update. Enjoy!

pert:
I'm glad to hear it's working now. Thanks for taking the time to post an update. Enjoy!

Yes me too :slight_smile: I think its important to comunicate all the steps also for other users in a forum. Only like that we have the chance to learn and get better.
Its great forums like this one are existing. Thanks again for your help.

(Just beside i own now a serial to USB- Converter :slight_smile: