Editing BoostC Forum Extracts 2007
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 241: | Line 241: | ||
Yes, this one bit me too! I wrote the following routine that you can use for any ms value from 1 to 65535. I timed it at 60,000 and it seems to be pretty much on the money. | Yes, this one bit me too! I wrote the following routine that you can use for any ms value from 1 to 65535. I timed it at 60,000 and it seems to be pretty much on the money. | ||
− | + | void delayMs(unsigned int ms){ | |
− | + | char i; | |
− | + | char high = ms >> 8; | |
− | + | char low = ms & 0x00ff; | |
− | + | for(i = 0; i < high; i++){ | |
− | + | delay_ms(255); | |
− | + | } | |
− | + | delay_ms(low); | |
− | + | } | |
You might think that it needs another delay_ms(1) in the loop but I got the most accurate time without it. | You might think that it needs another delay_ms(1) in the loop but I got the most accurate time without it. | ||
Line 263: | Line 263: | ||
+ | Use | ||
+ | CODE | ||
+ | ... | ||
+ | lcd_datamode(); | ||
+ | char c, i; | ||
+ | for( i = 0; i < 16; i++ ) | ||
+ | { | ||
+ | c = buffer[i]; | ||
+ | if( c == 0 ) | ||
+ | break; | ||
+ | lcd_write( c ); | ||
+ | } | ||
+ | ... | ||
− | + | Regards | |
− | + | Dave | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
------------- | ------------- | ||
− | * From: http://forum.sourceboost.com/index.php?showtopic=3367&pid=12653&mode=threaded&start=#entry12653 | + | *From: http://forum.sourceboost.com/index.php?showtopic=3367&pid=12653&mode=threaded&start=#entry12653 |
+ | @Pavel: | ||
That's it. Adding -d DEBUG to the compiler options does exactly what I want. | That's it. Adding -d DEBUG to the compiler options does exactly what I want. |