its been 4 days need help :( COS\ SIN for meter needle

because that is what they are x0, y0, x1, y1, in relation to the screen and the linked tutorial.
its very confusing to talk about things outside of the raw code with personal names.
it may be good practise in your own code but i am talking mostly when giving examples.

for example

anologRead(LEDpin)
should be:
anologRead(0)

I don't want scroll though code to know the line i am reading it regarding pin 0, because this will then be subjective to the comment quality of the person coding and it being clear and well laid out

also like
sensor = map(analogRead(0), 0, 1024, 0, 180);
not
sensor = map(potread1), 0, 1024, x, y);

from a beginners perspective its very hard to process all the functions and then decipher the values of made up names, again from a example code.

anyway thank again for your help

septillion:
Why call them confusing x0 and x1 again :confused: And the constness of length...

But note, sin and cos are terrible slow. Fine if it's quick enough but don't look weird if your loop() turns out to be slow.

g43q654wutrjh:
I don't want scroll though code to know the line i am reading it regarding pin 0, because this will then be subjective to the comment quality of the person coding and it being clear and well laid out

That's the most stupid thing I read today :wink: The whole idea of using variables is so code makes sens. Variables are a tool for you. You want to read the InputPin don't you? You just define it once after which it's just a set and forget.

It may seems hard for you now, but your logic is reversed :wink: If you have multiple inputs and output remembering which is connected to which pin is a lot harder then a simple set and forget at the top of the program. Bonus, if you later change your mind and change it to a different pin (or even to a different micro!) you just change it at the top and you're all set.

And as for as the x0 and x1, the example you linked is just stupid :wink: Just because some random example does it doesn't make it right or best practice. Like I said, variables are a tool for you to make the code understandable. Reading:

drawLine(XStart, YStart, XEnd, YEnd, WHITE)

directly tells all you need to know to understand what it does. Where as with

drawLine(5, 13, 43, 7, 0)

you need to check the reference of drawLine(). Quick to do indeed, but I will guarantee you, you will forget the meaning pretty quick again if you move on. And if you later come back to change stuff you will find yourself digging in the reference again :wink:

Aka, try to use variable names as a tool to make code easy to understand. I think it's fully understandable it's hard for a newbie to see what code does if you just use random variable names.

yes I know that.
I said when giving example of code.

people don't need to decode a individual persons personal preference of a variable means and then go back and forth in the code when its not needed.

its much simpler and reduces confusion from unknowns.

I understand the concept. but this is most confusing for a beginner understanding what is function and was is not.

helping beginners not coders, think from their perspective. simple code

septillion:
That's the most stupid thing I read today :wink: The whole idea of using variables is so code makes sens. Variables are a tool for you. You want to read the InputPin don't you? You just define it once after which it's just a set and forget.

It may seems hard for you now, but your logic is reversed :wink: If you have multiple inputs and output remembering which is connected to which pin is a lot harder then a simple set and forget at the top of the program. Bonus, if you later change your mind and change it to a different pin (or even to a different micro!) you just change it at the top and you're all set.

And as for as the x0 and x1, the example you linked is just stupid :wink: Just because some random example does it doesn't make it right or best practice. Like I said, variables are a tool for you to make the code understandable. Reading:

drawLine(XStart, YStart, XEnd, YEnd, WHITE)

directly tells all you need to know to understand what it does. Where as with

drawLine(5, 13, 43, 7, 0)

you need to check the reference of drawLine(). Quick to do indeed, but I will guarantee you, you will forget the meaning pretty quick again if you move on. And if you later come back to change stuff you will find yourself digging in the reference again :wink:

Aka, try to use variable names as a tool to make code easy to understand. I think it's fully understandable it's hard for a newbie to see what code does if you just use random variable names.

banana**()** ← function
apple ← not a function

And no, it’s NOT a preference. It’s just trowing the tools you’re given to make stuff understandable right out of the window :wink: