Problem with Servo8bit and ATtiny85

Please help.

I am trying to get the Servo8bit library to work on my ATtiny85 chip.

I have gotten some code from a video i found and adjusted it for my project's needs. When connected to the Arduino UNO it works great.

I have used the Arduino as ISP to program the ATtiny85 for a LED project before, but now i want to use a servo.

I have installed the "Servo8bit" library and have "successfully" uploaded it to the ATtiny85(at least it compiles and says it is uploaded)

HOWEVER, when I plug in the components, nothing happens.

Project specifics:

I am using: -SHARP IR distance sensor - Micro Servo from Radioshack - ATtiny85 - Arduino UNO(as power supply for now)

The value of the sensor determines the angle of the servo. This is done with a map function.

Again, it all works great with the Arduino UNO board, but nothing whatsoever When on ATtiny85(getting power only from the Arduino UNO).

As you may be able to tell I am a complete novice at this.

Please help.

I have installed the "Servo8bit" library and have "successfully" uploaded it

You can't upload a library. You can upload a sketch, but you didn't post that either.

Sorry:

I meant I have installed the library and “successfully” uploaded my sketch with reference to the library.

Here is my sketch:

#include “Servo8Bit.h”

Servo8Bit myServo;

int distancePin = 3;

int angle;
int lowVoltage;
int highVoltage = 450;
int up = 190;
int down = 120;

void setup()
{
myServo.attach(1);

for(int i = 0; i < 10; i++)
{
lowVoltage += analogRead(distancePin);
delay(50);
}

lowVoltage /= 10;

}

void loop()
{
angle = analogRead(distancePin);
angle = map(angle, lowVoltage, highVoltage, up, down);
myServo.write(angle);
delay(100);
}

Please help.

I am trying to get the Servo8bit library to work on my ATtiny85 chip.

I have gotten some code from a video i found and adjusted it for my project’s needs. When connected to the Arduino UNO it works great.

I have used the Arduino as ISP to program the ATtiny85 for a LED project before, but now i want to use a servo.

I have installed the “Servo8bit” library and have “successfully” uploaded it to the ATtiny85(at least it compiles and says it is uploaded)

HOWEVER, when I plug in the components, nothing happens.

Project specifics:

I am using:
-SHARP IR distance sensor

  • Micro Servo from Radioshack
  • ATtiny85
  • Arduino UNO(as power supply for now)

The value of the sensor determines the angle of the servo. This is done with a map function.

Again, it all works great with the Arduino UNO board, but nothing whatsoever When on ATtiny85(getting power only from the Arduino UNO).

As you may be able to tell I am a complete novice at this.

Please help.

My code is as follows:

#include “Servo8Bit.h”

Servo8Bit myServo;

int distancePin = 3;

int angle;
int lowVoltage;
int highVoltage = 450;
int up = 190;
int down = 120;

void setup()
{
myServo.attach(1);

for(int i = 0; i < 10; i++)
{
lowVoltage += analogRead(distancePin);
delay(50);
}

lowVoltage /= 10;

}

void loop()
{
angle = analogRead(distancePin);
angle = map(angle, lowVoltage, highVoltage, up, down);
myServo.write(angle);
delay(100);
}

A common problem with that library.

Servo8Bit Library Not Working

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Threads merged.

  • Moderator