Spin Coater

Hi everybody!

I'm super new to Arduino and programming and decided to attempt to build a spin coater utilizing an Arduino Uno. I'm basically copying this project Spin Coater – Stefik Group except for the humidity and vacuum features. I've wired everything up based on what that site and others I've googled and attached is a quick paint picture of how it's wired.

I tried dumping the programs from the website into both Arduinos and get errors from both. Due to the length of the programs and errors, I have to post them in a separate post in this thread. Any help from if everything is even wired correctly to any fixes in the programs would be super appreciated.

Here is the program for the first Arduino:
#include <LiquidCrystal.h>
#include <Servo.h>
Servo myesc;

#define MAX_SIGNAL 2000
#define MIN_SIGNAL 500
#define ESC_PIN 13

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

//Key message
char msgs[5][15] = {“Right Key OK “,
“Up Key OK “,
“Down Key OK “,
“Left Key OK “,
“Select Key OK”
};
int adc_key_val[5] = {75, 250, 420, 620, 780 };
int adc_key_in;
int key = -1;
int oldkey = -1;
int speeds[] = {400, 500, 750, 1000, 1100, 1500, 2000, 3000, 4000, 5000, 7000};
int escvalues[] = {1093.9, 1106.1, 1136.7, 1167.2, 1179.4, 1228.2, 1289.3, 1411.4, 1533.5, 1655.6, 1899.8};
int times[] = {1, 1.5, 2, 5, 10, 20, 30, 45, 60, 120, 300, 600};
int speeds_size = sizeof(speeds) / sizeof(int) – 1;
int times_size = sizeof(times) / sizeof(int) – 1;
int selected_speed = 0;
int selected_time = 0;
String lyrics = “You spin me right round, wafer; Right round like a record, wafer; Right round round round; You spin me right round, wafer; Right round like a record, wafer; Right round round round “;
int lyrics_size = sizeof(lyrics) / sizeof(char) – 1;
void setup() {
Serial.begin(9600);
myesc.attach(ESC_PIN);

//myesc.writeMicroseconds(MAX_SIGNAL); //option to calibrate ESC
//delay(4000);

myesc.writeMicroseconds(MIN_SIGNAL);//start with motor off
Serial.println(“arming”);

lcd.begin(16, 2);// set up the LCD’s number of columns and rows:
lcd.setCursor(0, 0); lcd.print(“HNEI”);// Print a message to the LCD.
lcd.setCursor(0, 1); lcd.print(“THIN”); delay(800);
lcd.setCursor(0, 1); lcd.print(“FILMS“); delay(800);
lcd.setCursor(0, 1); lcd.print(“LAB“);
delay(800); //hold the load screen
lcd.setCursor(0, 1); update_display();
}
void loop() {
//lcd.setCursor(0, 1);// set the cursor to column 0, line 1 (note: line 1 is the second row, since counting begins with 0):
adc_key_in = analogRead(0); // read the value from the sensor
key = get_key(adc_key_in); // convert into key press

if (key != oldkey) // if keypress is detected
{

delay(50); // wait for debounce time
adc_key_in = analogRead(0); // read the value from the sensor
key = get_key(adc_key_in); // convert into key press

if (key != oldkey) //a new button press is detected!
{
oldkey = key; //avoid phantom presses durring continuous hold

if (key == 0) //right key pressed
{
if (selected_time != times_size)
{
selected_time++;
}
}

if (key == 1) //up key pressed
{
if (selected_speed != speeds_size)
{
selected_speed++;
}
}

if (key == 2) //down key pressed
{
if (selected_speed > 0)
{
selected_speed–;
}
}

if (key == 3) //left key pressed
{
if (selected_time > 0)
{
selected_time–;
}
}

if (key == 4) //select key pressed
{
//take 1 second to spin up
int mystep;
int numberofsteps = 10;
int nextspeed;
for (mystep = 0; mystep < numberofsteps; mystep++) //take 100 incraments from slowest speed to requested speed
{
nextspeed = escvalues[0] + (escvalues[selected_speed] – escvalues[0]) * mystep / numberofsteps;
myesc.writeMicroseconds(nextspeed);//set the motor speed
Serial.println(nextspeed);
delay(1000 / numberofsteps);
}

myesc.writeMicroseconds(escvalues[selected_speed]);
Serial.println(“requested speed”);
int t; int cursorpos;
for (t = times[selected_time] – 1; t >= 0; t–) //continue spinning for [requested time minus spinup time]
{
cursorpos = (times[selected_time] – t) * 2;
lcd.setCursor(0, 0); lcd.print(lyrics.substring(cursorpos, cursorpos + 16));
delay(500);
cursorpos++;
lcd.setCursor(0, 0); lcd.print(lyrics.substring(cursorpos, cursorpos + 16));
lcd.setCursor(0, 1); lcd.print(“woosh! “);
lcd.setCursor(9, 1); lcd.print(t); lcd.print(“s”);
delay(500);
}
myesc.writeMicroseconds(MIN_SIGNAL);//turn off motor
}
update_display();

} //
} //new key pressed
} //overall loop

void update_display() {
lcd.setCursor(0, 0); lcd.print(“HNEI TFL”);// Print a message to the LCD.
lcd.setCursor(0, 1);
lcd.print(speeds[selected_speed]);
lcd.print(” RPM, “);
lcd.print(times[selected_time]);
lcd.print(“s ” );
}

int get_key(unsigned int input) // Convert ADC value to key number
{ int k;
for (k = 0; k < 5; k++)
{
if (input < adc_key_val[k])
{
return k;
}
}
if (k >= 5)
k = -1; // No valid key pressed
return k;
}

Here is the code for the second Arduino:

#include <FreqMeasure.h>
void setup() {
Serial.begin(57600);
FreqMeasure.begin();
}
double sum = 0;
int count = 0;
void loop() {
if (FreqMeasure.available()) {
// average several reading together
sum = sum + FreqMeasure.read();
count = count + 1;
// Serial.println(“measuring”);
if (count > 10) {
float frequency = FreqMeasure.countToFrequency(sum / count);
float rpm = frequency *2 /14 *60;
Serial.println(rpm);
sum = 0;
count = 0;
}
}
}

The error for the first program is:

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

sketch_aug25a:13: error: stray '\342' in program

char msgs[5][15] = {“Right Key OK “,

^

sketch_aug25a:13: error: stray '\200' in program

sketch_aug25a:13: error: stray '\234' in program

sketch_aug25a:13: error: stray '\342' in program

sketch_aug25a:13: error: stray '\200' in program

sketch_aug25a:13: error: stray '\234' in program

sketch_aug25a:14: error: stray '\342' in program

“Up Key OK “,

^

sketch_aug25a:14: error: stray '\200' in program

sketch_aug25a:14: error: stray '\234' in program

sketch_aug25a:14: error: stray '\342' in program

sketch_aug25a:14: error: stray '\200' in program

sketch_aug25a:14: error: stray '\234' in program

sketch_aug25a:15: error: stray '\342' in program

“Down Key OK “,

^

sketch_aug25a:15: error: stray '\200' in program

sketch_aug25a:15: error: stray '\234' in program

sketch_aug25a:15: error: stray '\342' in program

sketch_aug25a:15: error: stray '\200' in program

sketch_aug25a:15: error: stray '\234' in program

sketch_aug25a:16: error: stray '\342' in program

“Left Key OK “,

^

sketch_aug25a:16: error: stray '\200' in program

sketch_aug25a:16: error: stray '\234' in program

sketch_aug25a:16: error: stray '\342' in program

sketch_aug25a:16: error: stray '\200' in program

sketch_aug25a:16: error: stray '\234' in program

sketch_aug25a:17: error: stray '\342' in program

“Select Key OK�

^

sketch_aug25a:17: error: stray '\200' in program

sketch_aug25a:17: error: stray '\234' in program

sketch_aug25a:17: error: stray '\342' in program

sketch_aug25a:17: error: stray '\200' in program

sketch_aug25a:17: error: stray '\235' in program

sketch_aug25a:26: error: stray '\342' in program

int speeds_size = sizeof(speeds) / sizeof(int) – 1;

^

sketch_aug25a:26: error: stray '\200' in program

sketch_aug25a:26: error: stray '\223' in program

sketch_aug25a:27: error: stray '\342' in program

int times_size = sizeof(times) / sizeof(int) – 1;

^

sketch_aug25a:27: error: stray '\200' in program

sketch_aug25a:27: error: stray '\223' in program

sketch_aug25a:30: error: stray '\342' in program

String lyrics = “You spin me right round, wafer; Right round like a record, wafer; Right round round round; You spin me right round, wafer; Right round like a record, wafer; Right round round round “;

^

sketch_aug25a:30: error: stray '\200' in program

sketch_aug25a:30: error: stray '\234' in program

sketch_aug25a:30: error: stray '\342' in program

sketch_aug25a:30: error: stray '\200' in program

sketch_aug25a:30: error: stray '\234' in program

sketch_aug25a:31: error: stray '\342' in program

int lyrics_size = sizeof(lyrics) / sizeof(char) – 1;

^

sketch_aug25a:31: error: stray '\200' in program

sketch_aug25a:31: error: stray '\223' in program

sketch_aug25a:40: error: stray '\342' in program

Serial.println(“arming�);

^

sketch_aug25a:40: error: stray '\200' in program

sketch_aug25a:40: error: stray '\234' in program

sketch_aug25a:40: error: stray '\342' in program

sketch_aug25a:40: error: stray '\200' in program

sketch_aug25a:40: error: stray '\235' in program

sketch_aug25a:43: error: stray '\342' in program

lcd.setCursor(0, 0); lcd.print(“HNEI�);// Print a message to the LCD.

^

sketch_aug25a:43: error: stray '\200' in program

sketch_aug25a:43: error: stray '\234' in program

sketch_aug25a:43: error: stray '\342' in program

sketch_aug25a:43: error: stray '\200' in program

sketch_aug25a:43: error: stray '\235' in program

sketch_aug25a:44: error: stray '\342' in program

lcd.setCursor(0, 1); lcd.print(“THIN�); delay(800);

^

sketch_aug25a:44: error: stray '\200' in program

sketch_aug25a:44: error: stray '\234' in program

sketch_aug25a:44: error: stray '\342' in program

sketch_aug25a:44: error: stray '\200' in program

sketch_aug25a:44: error: stray '\235' in program

sketch_aug25a:45: error: stray '\342' in program

lcd.setCursor(0, 1); lcd.print(“FILMS“); delay(800);

^

sketch_aug25a:45: error: stray '\200' in program

sketch_aug25a:45: error: stray '\234' in program

sketch_aug25a:45: error: stray '\342' in program

sketch_aug25a:45: error: stray '\200' in program

sketch_aug25a:45: error: stray '\234' in program

sketch_aug25a:46: error: stray '\342' in program

lcd.setCursor(0, 1); lcd.print(“LAB“);

^

sketch_aug25a:46: error: stray '\200' in program

sketch_aug25a:46: error: stray '\234' in program

sketch_aug25a:46: error: stray '\342' in program

sketch_aug25a:46: error: stray '\200' in program

sketch_aug25a:46: error: stray '\234' in program

sketch_aug25a:86: error: stray '\342' in program

selected_speed–;

^

sketch_aug25a:86: error: stray '\200' in program

sketch_aug25a:86: error: stray '\223' in program

sketch_aug25a:94: error: stray '\342' in program

selected_time–;

^

sketch_aug25a:94: error: stray '\200' in program

sketch_aug25a:94: error: stray '\223' in program

sketch_aug25a:106: error: stray '\342' in program

nextspeed = escvalues[0] + (escvalues[selected_speed] – escvalues[0]) * mystep / numberofsteps;

^

sketch_aug25a:106: error: stray '\200' in program

sketch_aug25a:106: error: stray '\223' in program

sketch_aug25a:113: error: stray '\342' in program

Serial.println(“requested speed�);

^

sketch_aug25a:113: error: stray '\200' in program

sketch_aug25a:113: error: stray '\234' in program

sketch_aug25a:113: error: stray '\342' in program

sketch_aug25a:113: error: stray '\200' in program

sketch_aug25a:113: error: stray '\235' in program

sketch_aug25a:115: error: stray '\342' in program

for (t = times[selected_time] – 1; t >= 0; t–) //continue spinning for [requested time minus spinup time]

^

sketch_aug25a:115: error: stray '\200' in program

sketch_aug25a:115: error: stray '\223' in program

sketch_aug25a:115: error: stray '\342' in program

sketch_aug25a:115: error: stray '\200' in program

sketch_aug25a:115: error: stray '\223' in program

sketch_aug25a:117: error: stray '\342' in program

cursorpos = (times[selected_time] – t) * 2;

^

sketch_aug25a:117: error: stray '\200' in program

sketch_aug25a:117: error: stray '\223' in program

sketch_aug25a:122: error: stray '\342' in program

lcd.setCursor(0, 1); lcd.print(“woosh! “);

^

sketch_aug25a:122: error: stray '\200' in program

sketch_aug25a:122: error: stray '\234' in program

sketch_aug25a:122: error: stray '\342' in program

sketch_aug25a:122: error: stray '\200' in program

sketch_aug25a:122: error: stray '\234' in program

sketch_aug25a:123: error: stray '\342' in program

lcd.setCursor(9, 1); lcd.print(t); lcd.print(“s�);

^

sketch_aug25a:123: error: stray '\200' in program

sketch_aug25a:123: error: stray '\234' in program

sketch_aug25a:123: error: stray '\342' in program

sketch_aug25a:123: error: stray '\200' in program

sketch_aug25a:123: error: stray '\235' in program

sketch_aug25a:135: error: stray '\342' in program

lcd.setCursor(0, 0); lcd.print(“HNEI TFL�);// Print a message to the LCD.

^

sketch_aug25a:135: error: stray '\200' in program

sketch_aug25a:135: error: stray '\234' in program

sketch_aug25a:135: error: stray '\342' in program

sketch_aug25a:135: error: stray '\200' in program

sketch_aug25a:135: error: stray '\235' in program

sketch_aug25a:138: error: stray '\342' in program

lcd.print(� RPM, “);

^

sketch_aug25a:138: error: stray '\200' in program

sketch_aug25a:138: error: stray '\235' in program

sketch_aug25a:138: error: stray '\342' in program

sketch_aug25a:138: error: stray '\200' in program

sketch_aug25a:138: error: stray '\234' in program

sketch_aug25a:140: error: stray '\342' in program

lcd.print(“s � );

^

sketch_aug25a:140: error: stray '\200' in program

sketch_aug25a:140: error: stray '\234' in program

sketch_aug25a:140: error: stray '\342' in program

sketch_aug25a:140: error: stray '\200' in program

sketch_aug25a:140: error: stray '\235' in program

sketch_aug25a:13: error: 'Right' was not declared in this scope

char msgs[5][15] = {“Right Key OK “,

^

sketch_aug25a:13: error: expected '}' before 'Key'

char msgs[5][15] = {“Right Key OK “,

^

sketch_aug25a:13: error: expected ',' or ';' before 'Key'

sketch_aug25a:18: error: expected declaration before '}' token

};

^

exit status 1
stray '\342' in program

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The error for the second code is:

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\Josh\Documents\Arduino\sketch_aug25b\sketch_aug25b.ino:1:25: fatal error: FreqMeasure.h: No such file or directory

#include <FreqMeasure.h>

^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

OK, let's cut to the chase.

Please go and read the instructions, then go back and modify each of your posts using the "More --> Modify" option to the bottom right of the post, to mark up the code (but it always needs to be the complete code) as such so we can examine it conveniently and accurately. Please do not post a ".ino" file as an attachment - that would mean that you are expecting people to actually load it to their IDE to look at it and that is extra unnecessary labour. In fact, attachments do not always show properly on different operating systems.

If you do not mark it up as code, whatever code you do post could well be garbled and is certainly anything but easy to read. Yours may have survived so far but I most certainly did not look closely.

Note: Also mark up any data in the same way. This includes error output that you get from the IDE.

And - before you post any code, use "Auto Format" in the Tools menu of the IDE to properly present the code.

Try and avoid unnecessary white space (blank lines). You should only use these to separate functional blocks of code.

Unless you do this, this deluge of whitespace will repel any serious answers.

(deleted)