Jump to content

Arduino Elo calculator

Hello everybody,

I am working on a new ELO system for csgo and I don't know how to code for it on arduino. WARNING: I AM A NOOB WITH ARDUINO!!! 

 

I am looking for a way to use the serial monitor to give me an answer based on my inputs

EXAMPLE:

if i have the equasion Y=MX+B, I want it (the arduino) to ask me what M, X, and B are then, once i input the answer, solve.

 

This ELO equasion takes into account rounds won/lost KDR (more in that later) and round impact.

 

 

                           Gaming PC:                                        Server PC:                                         Streaming PC:

Processors:        i9-10900k                                          i5-9600k                                             i7-5820k

Motherboards:    ASUS ROG STRIX Z490-E               ASUS ROG STRIX Z390-E                ASUS ROG STRIX X99

RAM:                  Gskill TridentZ 32 GB @3500mhz    Gskill TridentZ 32 GB @3500mhz      Gskill TridentZ 32 GB @3500mhz

GPU:                  MSI RTX 3080ti                                 Asus ROG 1050ti                               Asus ROG 1060 OC

SSD:                  Samsung 980 Pro                             Samsung 960 Evo                              Samsung 960 Evo

PSU:                  ROG Thor 1200W                             ROG Thor 850W                                 ROG Thor 850W

CPU Cooler:      Corsair hardline                                 Corsair hardline                                  Corsair hardline

Case:                 Custom                                              Custom                                               Custom

Link to comment
Share on other sites

Link to post
Share on other sites

I will post an equation at a later date as i am not done making the equation.

                           Gaming PC:                                        Server PC:                                         Streaming PC:

Processors:        i9-10900k                                          i5-9600k                                             i7-5820k

Motherboards:    ASUS ROG STRIX Z490-E               ASUS ROG STRIX Z390-E                ASUS ROG STRIX X99

RAM:                  Gskill TridentZ 32 GB @3500mhz    Gskill TridentZ 32 GB @3500mhz      Gskill TridentZ 32 GB @3500mhz

GPU:                  MSI RTX 3080ti                                 Asus ROG 1050ti                               Asus ROG 1060 OC

SSD:                  Samsung 980 Pro                             Samsung 960 Evo                              Samsung 960 Evo

PSU:                  ROG Thor 1200W                             ROG Thor 850W                                 ROG Thor 850W

CPU Cooler:      Corsair hardline                                 Corsair hardline                                  Corsair hardline

Case:                 Custom                                              Custom                                               Custom

Link to comment
Share on other sites

Link to post
Share on other sites

Here is the equation...

ELO Equasion.docx

Edited by Yacovrex

                           Gaming PC:                                        Server PC:                                         Streaming PC:

Processors:        i9-10900k                                          i5-9600k                                             i7-5820k

Motherboards:    ASUS ROG STRIX Z490-E               ASUS ROG STRIX Z390-E                ASUS ROG STRIX X99

RAM:                  Gskill TridentZ 32 GB @3500mhz    Gskill TridentZ 32 GB @3500mhz      Gskill TridentZ 32 GB @3500mhz

GPU:                  MSI RTX 3080ti                                 Asus ROG 1050ti                               Asus ROG 1060 OC

SSD:                  Samsung 980 Pro                             Samsung 960 Evo                              Samsung 960 Evo

PSU:                  ROG Thor 1200W                             ROG Thor 850W                                 ROG Thor 850W

CPU Cooler:      Corsair hardline                                 Corsair hardline                                  Corsair hardline

Case:                 Custom                                              Custom                                               Custom

Link to comment
Share on other sites

Link to post
Share on other sites

Weird, it works for me. Are you on a mac?

                           Gaming PC:                                        Server PC:                                         Streaming PC:

Processors:        i9-10900k                                          i5-9600k                                             i7-5820k

Motherboards:    ASUS ROG STRIX Z490-E               ASUS ROG STRIX Z390-E                ASUS ROG STRIX X99

RAM:                  Gskill TridentZ 32 GB @3500mhz    Gskill TridentZ 32 GB @3500mhz      Gskill TridentZ 32 GB @3500mhz

GPU:                  MSI RTX 3080ti                                 Asus ROG 1050ti                               Asus ROG 1060 OC

SSD:                  Samsung 980 Pro                             Samsung 960 Evo                              Samsung 960 Evo

PSU:                  ROG Thor 1200W                             ROG Thor 850W                                 ROG Thor 850W

CPU Cooler:      Corsair hardline                                 Corsair hardline                                  Corsair hardline

Case:                 Custom                                              Custom                                               Custom

Link to comment
Share on other sites

Link to post
Share on other sites

Also do you know how to define a variable using serial monitor?

#define x <a value inputted in serial monitor>

 

Basically i want the serial monitor to ask me  "what is the value of x?"

then i type in a number (for example 34)

then the definition becomes  #define x 34

 

If yes, please explain as simply as possible and assume I know nothing (Jon Snow memes aside).

Edited by Yacovrex

                           Gaming PC:                                        Server PC:                                         Streaming PC:

Processors:        i9-10900k                                          i5-9600k                                             i7-5820k

Motherboards:    ASUS ROG STRIX Z490-E               ASUS ROG STRIX Z390-E                ASUS ROG STRIX X99

RAM:                  Gskill TridentZ 32 GB @3500mhz    Gskill TridentZ 32 GB @3500mhz      Gskill TridentZ 32 GB @3500mhz

GPU:                  MSI RTX 3080ti                                 Asus ROG 1050ti                               Asus ROG 1060 OC

SSD:                  Samsung 980 Pro                             Samsung 960 Evo                              Samsung 960 Evo

PSU:                  ROG Thor 1200W                             ROG Thor 850W                                 ROG Thor 850W

CPU Cooler:      Corsair hardline                                 Corsair hardline                                  Corsair hardline

Case:                 Custom                                              Custom                                               Custom

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Yacovrex said:

Weird, it works for me. Are you on a mac?

Nope, Windows 10.

 

2 hours ago, Yacovrex said:

Also do you know how to define a variable using serial monitor?

#define x <a value inputted in serial monitor>

#define doesn't define a variable. It does a text replacement before the code is even compiled so it can't be set to something at runtime using serial monitor. 

 

I'd suggest before even starting with the Arduino go through a basic C++ tutorial.

1474412270.2748842

Link to comment
Share on other sites

Link to post
Share on other sites

20 hours ago, fizzlesticks said:

That doc is blank for me. 

Here you go :

Xt040S9.png

I'm on Windows 10 as well and I could see it. Oh well...

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to comment
Share on other sites

Link to post
Share on other sites

i know it was a mistake on my part and am in the progress of fixing it (the #define and int mix ups). In the meanwhile i have some problems with serial not being declared....I don't know why( ignore the expressions and functions problem i am working on it)

 

#include <SoftwareSerial.h>

 

error: 'serial' was not declared in this scope WHY IS THIS A THING


//Score Variable(s)
#define x 16//<whatever the user inputs> //Rounds won
#define y 0//<whatever the user inputs> //Rounds lost

//Round Impact Variable(s)
#define k5 0//<whatever the user inputs> //ACE
#define k4 0//<whatever the user inputs> //4k
#define ds 0//<whatever the user inputs> //suicide
#define kf 0//<whatever the user inputs> //teamkill

//Kill Variables(s)
#define ak 0//<whatever the user inputs> //Weapon class A Kill
#define bk 0//<whatever the user inputs> //Weapon class B Kill
#define ck 0//<whatever the user inputs> //Weapon class C Kill
#define dk 0//<whatever the user inputs> //Weapon class D Kill

//Assist Variable(s)
#define aa 0//<whatever the user inputs> //Weapon class A Assist
#define ba 0//<whatever the user inputs> //Weapon class B Assist
#define ca 0//<whatever the user inputs> //Weapon class C Assist
#define da 0//<whatever the user inputs> //Weapon class D Assist

//Headshot Variable(s)
#define hk 0//<whatever the user inputs> //Headshots

//Death Variables
#define ad 0//<whatever the user inputs> //Weapon class A Death
#define bd 0//<whatever the user inputs> //Weapon class B Death
#define cd 0//<whatever the user inputs> //Weapon class C Death
#define dd 0//<whatever the user inputs> //Weapon class D Death


   int R = 4*(x-y) ;  //Round Score
   int P = k5+((4*k4)/5)-(ds+kf) ; //Round Impact Score
   int K = ak+(1.25*bk)+(.5*ck)+(2*dk) ; //Kill Score (based on weapon skill)
   int A = .5(aa+(1.25*ba)+(.5*ca)+(2*da)) ; //Assist Score (based on weapon skill)
   int H = .2*hk ; //Headshot Score
   int D = ad+(bd/1.25)+(cd/.5)+(dd/2) ; //Death Score (based on weapon skill)
   int ELO = R+P+(K+A+H)/D ; //Overall Elo Score                                             
   
// Full Equation (4(x-y)) + (k5+((4*k4)/5)-(ds+kf)) + (((ak+(1.25*bk)+(.5*ck)+(2*dk)) + (.5(aa+(1.25*ba)+(.5*ca)+(2*da))))+(.2*h)/(ad+(bd/1.25)+(cd/.5)+(dd/2)))


void setup()
{
    Serial.begin(9600);
}

void loop()
{
  while (Serial.available() == 0);
  int val = Serial.parseInt();
  Serial.println(val);
  
  
/////////////////////////////////////////////////////////////////////// Game outcome information
  if (x > y);
{
  serial.print ("Victory");
}
  if (x < y);
{
  serial.print ("Defeat");
}
  if (x == 15, y ==15);
{
  serial.print ("Draw");
}

serial.print (ELO);

  
/////////////////////////////////////////////////////////////////////// WIP
  //if (x > 16)
 /* if (Serial.available()) {   
    delay(100);
    byteRead = Serial.read();
   Serial.write(byteRead);
  } */
}

                           Gaming PC:                                        Server PC:                                         Streaming PC:

Processors:        i9-10900k                                          i5-9600k                                             i7-5820k

Motherboards:    ASUS ROG STRIX Z490-E               ASUS ROG STRIX Z390-E                ASUS ROG STRIX X99

RAM:                  Gskill TridentZ 32 GB @3500mhz    Gskill TridentZ 32 GB @3500mhz      Gskill TridentZ 32 GB @3500mhz

GPU:                  MSI RTX 3080ti                                 Asus ROG 1050ti                               Asus ROG 1060 OC

SSD:                  Samsung 980 Pro                             Samsung 960 Evo                              Samsung 960 Evo

PSU:                  ROG Thor 1200W                             ROG Thor 850W                                 ROG Thor 850W

CPU Cooler:      Corsair hardline                                 Corsair hardline                                  Corsair hardline

Case:                 Custom                                              Custom                                               Custom

Link to comment
Share on other sites

Link to post
Share on other sites

I FIGURED IT OUT

IM SO HYPED

I fixed the define int mix up and serial is with a capital S not a lowercase O_o


//Score Variable(s)
int x = 16 ;;//Rounds won
int y = 0;//Rounds lost

//Round Impact Variable(s)
int k5 = 0;//ACE
int k4 = 0;//4k
int ds = 0;//suicide
int kf = 0;//teamkill

//Kill Variables(s)
int ak = 0;//Weapon class A Kill
int bk = 0;//Weapon class B Kill
int ck = 0;//Weapon class C Kill
int dk = 0;//Weapon class D Kill

//Assist Variable(s)
int aa = 0;//Weapon class A Assist
int ba = 0;//Weapon class B Assist
int ca = 0;//Weapon class C Assist
int da = 0;//Weapon class D Assist

//Headshot Variable(s)
int hk = 0;//Headshots

//Death Variables
int ad = 0;//Weapon class A Death
int bd = 0;//Weapon class B Death
int cd = 0;//Weapon class C Death
int dd = 0;//Weapon class D Death

/////////////////////////////////////////////////////////////////////// Weapon definiton(s)

//WIP

/////////////////////////////////////////////////////////////////////// Score definition(s)

#define R 4*(x-y)  //Round Score
#define P k5+((4*k4)/5)-(ds+kf) //Round Impact Score
#define K ak+(1.25*bk)+(.5*ck)+(2*dk) //Kill Score (based on weapon skill)
#define A (aa+(1.25*ba)+(.5*ca)+(2*da))/2 //Assist Score (based on weapon skill)
#define H .2*hk  //Headshot Score
#define D ad+(bd/1.25)+(cd/.5)+(dd/2) //Death Score (based on weapon skill)
#define ELO R+P+(K+A+H)/D //Overall Elo Score

///////////////////////////////////////////////////////////////////////

// Full Equation (4(x-y)) + (k5+((4*k4)/5)-(ds+kf)) + (((ak+(1.25*bk)+(.5*ck)+(2*dk)) + (.5(aa+(1.25*ba)+(.5*ca)+(2*da))))+(.2*h)/(ad+(bd/1.25)+(cd/.5)+(dd/2)))


void setup() {
  Serial.begin(9600);

}

void loop() {
  
/////////////////////////////////////////////////////////////////////// Game outcome information
   if (x > y);
{
  Serial.print ("Victory");
}
  if (x < y);
{
  Serial.print ("Defeat");
}
  if (x == 15, y ==15);
{
  Serial.print ("Draw");
}
  
  Serial.print (ELO);
/////////////////////////////////////////////////////////////////////// WIP
}

                           Gaming PC:                                        Server PC:                                         Streaming PC:

Processors:        i9-10900k                                          i5-9600k                                             i7-5820k

Motherboards:    ASUS ROG STRIX Z490-E               ASUS ROG STRIX Z390-E                ASUS ROG STRIX X99

RAM:                  Gskill TridentZ 32 GB @3500mhz    Gskill TridentZ 32 GB @3500mhz      Gskill TridentZ 32 GB @3500mhz

GPU:                  MSI RTX 3080ti                                 Asus ROG 1050ti                               Asus ROG 1060 OC

SSD:                  Samsung 980 Pro                             Samsung 960 Evo                              Samsung 960 Evo

PSU:                  ROG Thor 1200W                             ROG Thor 850W                                 ROG Thor 850W

CPU Cooler:      Corsair hardline                                 Corsair hardline                                  Corsair hardline

Case:                 Custom                                              Custom                                               Custom

Link to comment
Share on other sites

Link to post
Share on other sites

fizzlesticks, stick around i may have more questions in the future and i will post them here until the program is done.

                           Gaming PC:                                        Server PC:                                         Streaming PC:

Processors:        i9-10900k                                          i5-9600k                                             i7-5820k

Motherboards:    ASUS ROG STRIX Z490-E               ASUS ROG STRIX Z390-E                ASUS ROG STRIX X99

RAM:                  Gskill TridentZ 32 GB @3500mhz    Gskill TridentZ 32 GB @3500mhz      Gskill TridentZ 32 GB @3500mhz

GPU:                  MSI RTX 3080ti                                 Asus ROG 1050ti                               Asus ROG 1060 OC

SSD:                  Samsung 980 Pro                             Samsung 960 Evo                              Samsung 960 Evo

PSU:                  ROG Thor 1200W                             ROG Thor 850W                                 ROG Thor 850W

CPU Cooler:      Corsair hardline                                 Corsair hardline                                  Corsair hardline

Case:                 Custom                                              Custom                                               Custom

Link to comment
Share on other sites

Link to post
Share on other sites

is there any reason in particular why you need to do this with an arduino?

Link to comment
Share on other sites

Link to post
Share on other sites

i wanted it to be a  portable thing (similarly to the way a calculator is used) and lader im goin to make it with an lcd screen

 

                           Gaming PC:                                        Server PC:                                         Streaming PC:

Processors:        i9-10900k                                          i5-9600k                                             i7-5820k

Motherboards:    ASUS ROG STRIX Z490-E               ASUS ROG STRIX Z390-E                ASUS ROG STRIX X99

RAM:                  Gskill TridentZ 32 GB @3500mhz    Gskill TridentZ 32 GB @3500mhz      Gskill TridentZ 32 GB @3500mhz

GPU:                  MSI RTX 3080ti                                 Asus ROG 1050ti                               Asus ROG 1060 OC

SSD:                  Samsung 980 Pro                             Samsung 960 Evo                              Samsung 960 Evo

PSU:                  ROG Thor 1200W                             ROG Thor 850W                                 ROG Thor 850W

CPU Cooler:      Corsair hardline                                 Corsair hardline                                  Corsair hardline

Case:                 Custom                                              Custom                                               Custom

Link to comment
Share on other sites

Link to post
Share on other sites

Do your guys know what the code is for making an int be defined by an input from the serial monitor? Ij you guys could let me know that would be great

                           Gaming PC:                                        Server PC:                                         Streaming PC:

Processors:        i9-10900k                                          i5-9600k                                             i7-5820k

Motherboards:    ASUS ROG STRIX Z490-E               ASUS ROG STRIX Z390-E                ASUS ROG STRIX X99

RAM:                  Gskill TridentZ 32 GB @3500mhz    Gskill TridentZ 32 GB @3500mhz      Gskill TridentZ 32 GB @3500mhz

GPU:                  MSI RTX 3080ti                                 Asus ROG 1050ti                               Asus ROG 1060 OC

SSD:                  Samsung 980 Pro                             Samsung 960 Evo                              Samsung 960 Evo

PSU:                  ROG Thor 1200W                             ROG Thor 850W                                 ROG Thor 850W

CPU Cooler:      Corsair hardline                                 Corsair hardline                                  Corsair hardline

Case:                 Custom                                              Custom                                               Custom

Link to comment
Share on other sites

Link to post
Share on other sites

int val = Serial.parseInt()

Or, I think you can do:

int val = Serial.read() - '0' (subtracting the ascii character '0' will give you correct the number). But i would just use parseInt. It returns 0 if you input something not an integer.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Does this work if you have many integers.

And how can i (with the command above) have the serial monitor ask me what number a certain variable should be then have me type the number.

Example pretend this is a serial monitor:

-

- How many <whatevers> did you get?

- <your numerical answer here>

-

                           Gaming PC:                                        Server PC:                                         Streaming PC:

Processors:        i9-10900k                                          i5-9600k                                             i7-5820k

Motherboards:    ASUS ROG STRIX Z490-E               ASUS ROG STRIX Z390-E                ASUS ROG STRIX X99

RAM:                  Gskill TridentZ 32 GB @3500mhz    Gskill TridentZ 32 GB @3500mhz      Gskill TridentZ 32 GB @3500mhz

GPU:                  MSI RTX 3080ti                                 Asus ROG 1050ti                               Asus ROG 1060 OC

SSD:                  Samsung 980 Pro                             Samsung 960 Evo                              Samsung 960 Evo

PSU:                  ROG Thor 1200W                             ROG Thor 850W                                 ROG Thor 850W

CPU Cooler:      Corsair hardline                                 Corsair hardline                                  Corsair hardline

Case:                 Custom                                              Custom                                               Custom

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×