Let the future tell the truth and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I really worked, is mine. (Nikola Tesla)

23/08/2010


●Displaying Constant Scripts on 2x16 LCD

Here is the program written by using CCS C.



#include <16f628.h>
#fuses NOPROTECT, NOWDT, NOLVP, NOMCLR, INTRC_IO
#use delay(clock=4M)
#include //It is essential for using LCD in our program

void main(){

lcd_init(); //Must be called before any other function
while(1){
lcd_gotoxy(1,2); //To set write position on LCD
lcd_putc("Sezgin Secil"); //Displaying script on the next position of the LCD
}
}



Note: For using LCD in our designs, we should use lcd.c file. It is used for both Port B and D. So, if we want to use it for Port B, we need a modification in the lcd.c file:
Find LCD.C file in drivers, open it, find the line that consists of "//define use_portb_lcd TRUE" and change that as "define use_portb_lcd TRUE". All you need to do is removing the the double slash at the beginning of the command.



15/08/2010


●Counting from 9 to 0 on 7-Segment Display

Here is the program written by using CCS C.



#include <16f628.h>
#fuses NOPROTECT, NOWDT, NOLVP, NOMCLR, INTRC_IO //Adding internal oscillator with INTRC_IO and MCLR makes possible to reset but with NOMCLR there is no need to connect anything that pin
#use delay(clock=4M) //To define the delay time correctly

void main(){
char series[]={63,6,91,79,102,109,125,7,127,111}; //Defining the decimal values of total logic values on 7-segment display
char x=9; //To start the loop from 9nd value
while(1){
do{
output_b(series[x]); //To show the desired value on 7-segment display
delay_ms(250); //Delay for observation
x--;
}while((x+1)); //To end the loop
x=9;
}
}



●Flashing LED Controlled by a Button

Here is the program written by using CCS C.


#include <16f628.h>
#fuses NOPROTECT, NOWDT, NOLVP, NOMCLR INTRC_IO //Adding internal oscillator with INTRC_IO and MCLR makes possible to reset but with NOMCLR there is no need to connect anything that pin
#use delay(clock=4M) //To define the delay time correctly

void main(){
while(1){ // For an endless loop
if(!input(pin_a0)) //Checking the input of the first pin of port A
output_high(pin_b0); //If input is low, LED flashes
else output_low(pin_b0); //If input is high, LED doesn't flash
}
}


31/07/2010

●Flashing LEDs from Right to Left

Here is the program written by using CCS C.



#include <16f628.h>
#fuses NOPROTECT, NOWDT, NOLVP, NOMCLR INTRC_IO //Adding internal oscillator with INTRC_IO and MCLR makes possible to reset but with NOMCLR there is no need to connect anything that pin
#use delay(clock=4M)

void main(){
char a=128; //To define the first flashing LED
while(1){ // For an endless loop

output_b(a); // Defines which output's pin is going high and flashes the LED
delay_ms(250); //Delay the process to see the flash of a LED
if(a) a=a>>1; //To get high level at the output of the next pin
else a=128; //To start again from the first LED

}

}

28/06/2010

Text-to-Speech

If you want to have your text spoken by a human, this site offers you a program which is called as "Expressivo" copyrighted by IVO Software. Actually, it is a program that reads written text in a human voice. You can use it online at http://say.expressivo.com and even share the spoken text with your friends. Of course, there is a limitation and you can't enter more than 200 characters. But if you want to use it to listen to books, e-mails or RSS feeds, you can also buy it.

For instance;
You can listen the text typed as "Sezgin".

26/06/2010

● Alt Code Characters

You can type alternative characters which are not available in your current keyboard layout on a computer running Windows OS. By using the Alt key, you can enter any alt code which belongs to desired characterwith the keyboard's numeric keypad. Now, I will explain how you can do it:

1. Because of using the keyboard's numeric keypad, you should have your "Num Lock" opened.
2. You should press and hold down the "Alt" key.
3. Then, you should type the code which belongs to desired character.

For instance;

If we want to type symbol of degree sign (°), we should do the following.
The code for symbol of degree sign is ALT 248. So, we should press and hold down the "Alt" key. Then, type 248 using the numeric keypad. As you see, you will get the symbol of degree sign °.

21/06/2010

●Unit Conversion

http://www.unitconversion.org presents unit converters among different units of measurement. It is useful if your works mostly require unit conversions. It is free to use and also offer wide range of units of measurements differs from data storage conversion to frequency wavelenghts conversion. You can find all you want that you need during your working life or education. Bookmarking this site may be helpful. ;)

ShareThis