Errors uploading sketch to attiny45 with arduino uno

I have been working on an electric longboard and have run into some problem while uploading this sketch to the attiny45.

#include <SPI.h>

#include <SoftwareSerial.h>

int ESC
int potentiometer = A1;
int button1 = 3;
int button2 = 4;
int potval;
int curval;
SoftwareServo = ESC;

void setup() {

pinMode(potentiometer, INPUT);
pinMode(button1, INPUT);
pinMode(button2, INPUT);
ESC.attach(1);
curval = 0;
ESC.setMinimumPulse(800);
ESC.setMaximumPulse(2000);
}

void loop() {

while (digitalRead(button1) == HIGH) {
potval = analogRead(potentiometer);
potval = map(potval, 0, 1023, 0, 180);

while (curval < potval) {
potval = analogRead(potentiometer);
potval = map(potval, 0, 1023, 0, 180);
curval = curval + 1;
ESC.write(curval);
SoftwareServo::refresh();
delay(50);
while (digitalRead(button2) == HIGH) {
ESC.write(curval);
SoftwareServo::refresh();
}
}

while (curval > potval) {
potval = analogRead(potentiometer);
potval = map(potval, 0, 1023, 0, 180);
curval = curval - 1;
ESC.write(curval);
SoftwareServo::refresh();
delay(50);
while (digitalRead(button2) == HIGH) {
ESC.write(curval);
SoftwareServo::refresh();
}
}

ESC.write(curval);
SoftwareServo::refresh();
}

potval = 0;
while (curval > potval) {
curval = curval - 1;
ESC.write(curval);
SoftwareServo::refresh();
delay(50);
}

ESC.write(curval);
SoftwareServo::refresh();
}

Maybe some better minds than mine could tell me how to fix them.

I would upload the error messages but there are too many of them for this forum :slight_smile:

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn’t show the posting toolbar then you can just manually add the code tags:
[code]``[color=blue]// your code is here[/color]``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

When you encounter an error you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar). If the error is longer than the 9000 characters the forum allows then save it to a text file and add it as an attachment. You will see the attachment option when you click the “Reply” button.