Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dummy variable mandatory for code to start #3

Open
ch-nry opened this issue Oct 18, 2014 · 0 comments
Open

dummy variable mandatory for code to start #3

ch-nry opened this issue Oct 18, 2014 · 0 comments

Comments

@ch-nry
Copy link

ch-nry commented Oct 18, 2014

hello,

thanks a lot for your code.
It will be very usefull for my current project.
The example is working perfectlly (after changing makefile to use attiny45 and setting fuses).
(i'm using linux, and avrdude as programer)

However, i noticed somthing that i can't understand :

this function is working :
int main()
{
Servo8Bit myServo; //create a servo object.
myServo.attach(1); //attach the servo to pin PB1
int nothing = 0;
while(1)
{
myServo.write(85); //rotate
delay(1000); //wait
myServo.write(95);
delay(1000);
}
}

but this function is not working :

int main()
{
Servo8Bit myServo; //create a servo object.
myServo.attach(1); //attach the servo to pin PB1
// int nothing = 0;
while(1)
{
myServo.write(85); //rotate
delay(1000); //wait
myServo.write(95);
delay(1000);
}
}

a dummy variable has to be declare, otherwise the code won't start.
Do you have a logic explanation?

best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant