getting value from Timer0 AVR [closed] - timer

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am currently writing a program in AVR Studio 4 in which i would like to use the Timer to get a random number.
I can get the timer to run, however i do not know how to get the current value of the timer. In general can the value be stored in a register or is it not accessible.
Thanks

Don't worry got it sorted. I managed to figure out that my program never got past 1 and managed to figure out how to store the values.

Related

How to store value of a variable in c after closing [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am doing a project on railway reservation system, my program is working fine, but when I close the program and then again start booking tickets,seat no again takes the previous value, I'm doing the project in c.
You'll need to write all of the data to a file before the program closes, and then read the data from the file when the program starts again.
That's right.

C programming - loop [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Hello I am starting to learn programming and I would like to know this if someone could help me out.
If we know how many times will loop be done whats the easiest one to use?
You should use as a rule of thumb.
If know iterations --> for
If unknown iterations --> while
If at least one iteration (but not known) --> repeat

How i use current system time to Genrate the random numbers in C [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
i have to make my random function to generate through the current system time generate between 0 to 9
You can use the modulus operator:
milliseconds % 10;
See here: http://www.cprogramming.com/tutorial/modulus.html

C: recognize variable type [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm learning C. I wonder whether there is an instruction or command to recognize the type of the variable.
To be more practical: I have a program which works with integers, I want to show an error message if the user inserts a real number when running the program.
Hope you can help!
This is not part of the C standard, but GCC has the typeof keyword.
You have to be using the GCC compiler for it though.

Compressing an array of integers in C using zlib [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I need an urgent help about compressing an array of integers using zlib,and that will be in c language.
i have: uint16_t arrayOfData[120] and i want to compress it so that i get the compressed version and use it in the same program (i don't want to read from and write to streams).
please i am waiting for any help, if sample code is available it will be great!
Thanks in advance
There is an example at http://zlib.net/zlib_how.html .

Resources