Thanks for your speedy and detailed response, I can now see why this exercise might look unusual for an AV program, as you correctly pointed out, this is a learning exercise on the use of if...
Type: Posts; User: droseman
Thanks for your speedy and detailed response, I can now see why this exercise might look unusual for an AV program, as you correctly pointed out, this is a learning exercise on the use of if...
Hello,
I am working through Alex's excellent book, and while doing one of the practice exercises in the 'if statement' chapter which involved modifying a given password checker program
...
Thank you iMalc, that solution worked perfectly, and I now know some more about bit manipulations :)
--dave
thanks for the explanation laserlight, that makes complete sense now.
--dave
Thanks, useful responses as always on here.
I have to congratulate nonoob, that is a concise solution, but I will have to sit down and work the logic through before I understand it fully.
...
Thats a good idea, but I think that it may be a bit large considering I have only 32K for my code, maybe the mapping table could be 32 members,as I am ultimately dealing with 5-bit numbers here.
...
Hi,
I have an embedded application where I read in 5 address lines (AD0-AD4) into 5 I/Os on my microcontroller, and as I seem to want to make life as hard for myself as possible I have connected...
due to looming deadline - the whole function was moved to scope main, choosing with an if...else statement.
Would have been nice to do the other way, since it made main() a bit simpler, but...
hours_array is a global array variable which is also declared extern in a header file
The function EEPROM write calls a function which writes data to an attatched EEPROM device to be read back...
Hi
I have in my application two functions which I call from main, called
void write() and void ArrayFill(), which I can call from main() and operating as expected.
I also have a function...
Hello shifu,
Have you looked in the documentation for your micro, there may be some library functions which can simplify your coding somewhat, there certainly are for the STM32 which I use.
...
Hi Adak,
I have solved it myself, here is the code which worked (I did remember to change the name of the array - I have a few arrays in my code (as you have probably realised, this is a small...
Cheers for that.
Is there any way this can get itself stuck in an infinite loop, since that is what has happened when I put it into my main (embedded) application.
--dave
Thanks Adak, that was indeed what I was trying to do.
Yes, I really should have removed that comment..
Would it be possible to ask why you set up the for loop like that and what tmp2 does,...
and as always, there is another complication...
I have just realised that the array contains ASCII char values, which breaks this code, so I have tried this:
#include <stdio.h>
int...
Thank you very much kermitaner, that was exactly what I was after - have yourself a fine Hannovarian beer !
To laserlight - thanks for pointing out those functions, I had not heard of those...
Cheers, I can see that now. Retesting without that statement gives me -100000...
What I actually want to do is take the calculated value of tmp and add it to the previous value, but I don't know...
Hello,
I am attempting to convert a number from an array of chars into a reconstructed number. For example if I have an array:
char array[5] = {5,4,3,2,1};
How can I convert it into
...
that certainly looks much simpler, but I got the other method working and its integrated into my code, with the correct addresses happily being sent to my serial port, so I am a happy camper all...
thanks to kennedy and mk for your ideas. Both would work for me. In your opinion, which of these approaches is likely to have a smaller code footprint?
I went to put this in a test program, but...
that makes a bit of sense, but why modulo division for the lower nibble?
On microcontrollers, functions like printf are not included in the library since they are too resource hungry. Makes a...
Hi,
In a section of my code I have a number in hex (in the range 0x00 to 0xFE) and I need to get this into an ASCII string. Also, because I don't have printf (or its variations) I can't use...
Thanks for that info Rocky, that sounds like just what I need. Just to clarify, I invoke this function when I am declaring my arrays? Also, can I insert this code into a struct member declaration,...
Hello,
I have some arrays in my code which will contain different messages of varying lengths, so I have sized my arrays to take the longest ones (plus 1 or two elements on the end), but how do I...
Hi,
I am doing my first major project in C for an embedded platform, with many functions and files involved, and I want to use a similar process to UML used in Java programming, but I can't find...