as a beginner im stumbelling on a early problem.
Im trying to let my arduino uno read a lm35 temperature sensor and make him output the degrees in a led setup.
whats happening now is that it works from degrees 1-9 perfectly, but the second you have 2 digits it doesnt work.
It wil see anything between 10-19 as 1, 20-29 as 2 and so on.
how can i let my arduino send a digital output that is 2 digit in stead of one?
There are guidelines for posting in this forum. Clearly, you haven't read them. Go do so now. When you are done, you'll know what you left out of your post.
Im guessing first post is what a person would read when they read my post for the first time.
that would be the logical place to put the code or am i mistaken.
well i did read them, but im not sure where to paste the code as its a big one.
So, when you read the posting guidelines, you no doubt read the part that said you could attach your code to a post, or you could break the code down to the smallest size that still exhibited the problem.
that would be the logical place to put the code or am i mistaken.
If you put your code in the first post, now, I look like a fool for complaining that you failed to post code. If you try to make me look like a fool, where is my incentive to help you?
It is in no way my intention to make anyone look bad.
Im new and not sure how or what is the way of doing here.
i can understand you guys get tired from people not knowing what they are doing,
but the hostilitie levels are kinda high for a new guy posting here.
void loop()
{
while (Serial.available() == 0);
int val =Serial.read();
Serial.println(val);
switch (val){
I know this part of the code is wrong in all means, but it Does let me use 1-9 digits perfectly.
the seconde i hang a formula on it like this one it fails and its still 1 digit only
But that doesn't display anything, so can't be relevant to the discussion here.
If you're asking "How do I input multi-digit numbers?" that's a different question, but one which comes up here about once a week (more frequently at assignment hand-in time), so a short search will give you your answer.
The 500-odd lines you posted earlier should be about 30 lines of code, with sensible use of loops and arrays.
arduino gets analog input from a temperature sensor.
and for each degree a combination of led will light up.
its has 9 leds. 1/4 have a value of 1, 5 has a value of 5, and 6/7/8 have a value of 10.
The whole problem is that i have used multiple codes before and all have failed.
i get the correct degree on my computer, but sending the info to the corrosponding leds is not working.
This is all a hobby,
so all things i use or see are based on some internet tips or tricks.
Im pretty aware the 500 line thing is a monster for an expert to look at.
but for my simple basic thing programming its the only think i could invent at the moment.