Welcome To MyMiniProWorld

විදුසර සිංහල පංති පාඩම.(Vidusara PIC Tutorials)




    Introduction to Microcontrollers


 I. Internal Architecture
     I/O Ports Fetch, Decode, and Execute
     Controlling and processing unit


II. Softwares used for Programming Microcontrollers
    Compilers and Integrated Development Environments
    How to build your own JDM Programmer (I)
    How to build your own JDM Programmer (II)
    Hardware needed for Programming
    Program using ICPROG Software


III. Build your first microcontroller based circuit
    Typical microcontroller assembly circuit diagram
    Special Function registers of the Microcontroller PIC16F84A    
    Creating your first assembly code
    How to write assembly code in MPLAB
    More on MPLAB
    How to simulate using MPLAB SIM


IV. LED Pattern generators
    Assembly code for driving 8 LEDs (I)
    Assembly code for driving 8 LEDs (II)
    Driving 40 LEDs using PORT multiplexing (8x5)
    How to display a Character using 8x5 LED matrix


V. Seven Segment Displays
    Driving segments using PORT-B I/O
    Basic counter circuit (I)
    0 - 100 up counter using two SSD (I)
    0 - 100 up counter using two SSD (II)
    Usage of interrupts
    Practical usage of Interrupts
    External Interrupts


VI. Connecting a microcontroller with the PC
    PC Serial port overview
    Logic level translation using MAX 232 IC
    Assembly code for controlling USART module (I)
    Assembly code for controlling USART module (II)


VII. Analog to Digital conversion
   Temperature Logger using LM35
   Importance of Quantization error and Sampling rate
   PIC16F877A ADCON0 and ADCON1register
   A/D, show results using SSD
   Assembly code for A/D conversion (I)
   Assembly code for A/D conversion (II)
   Send A/D converted data through RS-232


VIII. Liquid Crystal Displays
   Types of LCDs
   Running a LCD module using PIC16F84A (I)
   Running a LCD module using PIC16F84A (II)
   Running a LCD module using PIC16F84A (III)


IX. Number representations
   Introduction to Binary, Octal and Hex number systems
   Logic gates and Boolean algebra
   Boolean algebra and Registers
   Communication using Ascii codes


X. DC Motor controlling
   Controlling a DC motor using H-Bridge IC L298
   Control rotation speed, rotation direction using Microcontroller
   Connecting the DC motor controller to PC
   DC motor control according to the user press buttons
   Pulse Width Modulation (PWM)
   Calculating the DC Motor rotation speed (RPM)
   Dynamic control using feedback loops


XI. Remote controllers numbering
   The electromagnetic spectrum
   Infrared remote controllers
   IR Sensors
   How to capture the IR receiver signal using Microcontroller
   Decoding IR Signals (I)
   Decoding IR Signals (II)
   Decoding IR Signal algorithm


XII. Data transfer between digital circuits
   Serial Peripheral Interface (I)
   Serial Peripheral Interface (II)
   Nokia 3310 LCD Driving using SPI (I)
   Nokia 3310 LCD Driving using SPI (II)
   Connecting a Nokia 3310 LCD to PIC16F877A
   Assembly code for LCD driving (I)
   Assembly code for LCD driving (II)
   Sinhala characters in a Nokia 3310 LCD
   Animation effects with Nokia 3310 LCD


XIII. How to use high level languages
   Introduction
   C code for blinking a LED
   C code for driving 8 LEDs (I)
   Driving 40 LEDs using PORT multiplexing (8x5) (I)
   Driving 40 LEDs using PORT multiplexing (8x5) (II)
   Driving segments using PORT-B I/O
   Basic counter circuit
   0 - 100 up counter using two SSD
   Practical usage of Interrupts
   External Interrupts
   Connecting a microcontroller with the PC
   Driving Liquid Cristal Displays
   End of uC Series


XIV. Global Positioning System (GPS)
   Introduction to Global Positioning
   GPS Receivers
   GPS Errors
   Differential GPS

Size - 11.26 MB
RAR Password :-myminiproworld.blogspot.com

Create Translucent Windows in Java/Swing





මන් කියලා දෙන්න යන්නේ කොහොමද ජාවා වලින් එක හැඩයකට තියෙන විනිවිද වින්ඩෝ එකක් හදා ගන්නේ කියලා .

මේක කරන්න අවශ්‍ය වෙන්නේ මෙන්න මේවා ටික විතරයි .

ස්වින් Application සම්බන්දව මුලික දැනුමක්..
JDK 7 , නැති කට්ටිය මෙතනින් ගන්න .
Netbeans IDE ,නැති කට්ටිය මෙතන්න ගිහින් ඩවුන්ලෝඩ් කරගන්න .

මුලින්ම අපි බලන්න ඕනේ අපේ පරිගණකයේ ප්ලැට් ෆෝම එක Translucent (විනිවිද) එකට Support (සහය) කරනවාද කියල බලන එකයි. එකට අපි මුලින්ම Graphic Device ඒකෙන් instance එකක් හදා ගන්න ඕනේ මෙන්න මේ විදියට .
import static java.awt.GraphicsDevice.WindowTranslucency.* 

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = ge.getDefaultScreenDevice();
 


ඔන්න හරි ජාවා වල Transperancy Method ටයිප්ස්‌ 3 තියෙනවා . 

1.gd.isWindowTranslucencySupported(TRANSLUCENT); //for Uniform Transparency
2.gd.isWindowTranslucencySupported(PERPIXEL_TRANSLUCENT);//for per-Pixel Transperancy
3.gd.isWindowTranslucencySupported(PERPIXEL_TRANSPARENT); //for shaped windows


මේ හැම Method එකකින්ම Boolean (True or False) එකක් තමයි Return වෙන්නේ .ලැබෙන ප්‍රතිපලය මත ඇප්ලිකේෂන් එක සාදා ගන්න පුළුවන් .මේ හැම එකක් ගැනම අපි දැන් බලන්න යන්නේ කොහොමද හදා ගන්නේ කියලා .මුලින්ම අපි පලවෙනි එක කරන්නේ කොහොමද කියලා බලමු .


Uniform Transparency(එකීය පාරදෘශ්‍යතාව):

මේ වාගේ ඇප්ලිකේෂන් එකක් හදාගන්න එක හරිම ලේසි මොකද කියනවානම් අපි jframe එකක් හදා ගත්තට පස්සේ "setOpacity()" කියන මෙතඩ් එකට windows class එකේ ඉදලා call කරන්න විතරයි තියෙන්නේ. එක Float අගයක් .පොඩිම අගයේ (ඒ කියන්නේ 0.0 ) ඉදලා ලොකුම අගයට (ඒ කියන්නේ 1.0 ) set කරන්න තියෙන්නේ .1.0 set කරනවා කියන්නේ වින්ඩෝ එක සම්පුර්ණයෙන්ම පාරාන්ධයි .එකේ අනිත් පැත්ත ඒ කියන්නේ 0.0 දැම්මොත් වින්ඩෝ එක සම්පුර්ණයෙන්ම පාරදෘශ්‍යයි.

මේ විදියට තමයි එක කරන්න ඕනේ .

public class MyUniTransperancyWindow extends JFrame {

/*


Extra usage for some method..
*/
MyUniTransperancyWindow myWindow = new MyUniTransperancyWindow ();
myWindow.setLocationRelativeTo(null);
myWindow.setSize(400,300);
myWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

myWindow.setOpacity(0.70f);

myWindow.setVisible(true);

}


මේක හරියට වැඩ කල නම් ඔයාලට 70% විනිවිදභාවයෙන් තියෙන වින්ඩොවක් ලැබෙන්න ඕනේ.ඊලග ලිපියෙන් මන කියලා දෙන්නම් කොහොමද වින්ඩොව් එක අපිට කැමති හැඩය කට හදා ගන්නේ කියලා,ලිපිය කියවපු ඔයාලට බොහොම ස්තුතියි.

SINHALA UNICODE TABLE




PositionDecimalNameAppearance
0x0D823458SINHALA SIGN ANUSVARAYA
0x0D833459SINHALA SIGN VISARGAYA
0x0D853461SINHALA LETTER AYANNA
0x0D863462SINHALA LETTER AAYANNA
0x0D873463SINHALA LETTER AEYANNA
0x0D883464SINHALA LETTER AEEYANNA
0x0D893465SINHALA LETTER IYANNA
0x0D8A3466SINHALA LETTER IIYANNA
0x0D8B3467SINHALA LETTER UYANNA
0x0D8C3468SINHALA LETTER UUYANNA
0x0D8D3469SINHALA LETTER IRUYANNA
0x0D8E3470SINHALA LETTER IRUUYANNA
0x0D8F3471SINHALA LETTER ILUYANNA
0x0D903472SINHALA LETTER ILUUYANNA
0x0D913473SINHALA LETTER EYANNA
0x0D923474SINHALA LETTER EEYANNA
0x0D933475SINHALA LETTER AIYANNA
0x0D943476SINHALA LETTER OYANNA
0x0D953477SINHALA LETTER OOYANNA
0x0D963478SINHALA LETTER AUYANNA
0x0D9A3482SINHALA LETTER ALPAPRAANA KAYANNA
0x0D9B3483SINHALA LETTER MAHAAPRAANA KAYANNA
0x0D9C3484SINHALA LETTER ALPAPRAANA GAYANNA
0x0D9D3485SINHALA LETTER MAHAAPRAANA GAYANNA
0x0D9E3486SINHALA LETTER KANTAJA NAASIKYAYA
0x0D9F3487SINHALA LETTER SANYAKA GAYANNA
0x0DA03488SINHALA LETTER ALPAPRAANA CAYANNA
0x0DA13489SINHALA LETTER MAHAAPRAANA CAYANNA
0x0DA23490SINHALA LETTER ALPAPRAANA JAYANNA
0x0DA33491SINHALA LETTER MAHAAPRAANA JAYANNA
0x0DA43492SINHALA LETTER TAALUJA NAASIKYAYA
0x0DA53493SINHALA LETTER TAALUJA SANYOOGA NAAKSIKYAYA
0x0DA63494SINHALA LETTER SANYAKA JAYANNA
0x0DA73495SINHALA LETTER ALPAPRAANA TTAYANNA
0x0DA83496SINHALA LETTER MAHAAPRAANA TTAYANNA
0x0DA93497SINHALA LETTER ALPAPRAANA DDAYANNA
0x0DAA3498SINHALA LETTER MAHAAPRAANA DDAYANNA
0x0DAB3499SINHALA LETTER MUURDHAJA NAYANNA
0x0DAC3500SINHALA LETTER SANYAKA DDAYANNA
0x0DAD3501SINHALA LETTER ALPAPRAANA TAYANNA
0x0DAE3502SINHALA LETTER MAHAAPRAANA TAYANNA
0x0DAF3503SINHALA LETTER ALPAPRAANA DAYANNA
0x0DB03504SINHALA LETTER MAHAAPRAANA DAYANNA
0x0DB13505SINHALA LETTER DANTAJA NAYANNA
0x0DB33507SINHALA LETTER SANYAKA DAYANNA
0x0DB43508SINHALA LETTER ALPAPRAANA PAYANNA
0x0DB53509SINHALA LETTER MAHAAPRAANA PAYANNA
0x0DB63510SINHALA LETTER ALPAPRAANA BAYANNA
0x0DB73511SINHALA LETTER MAHAAPRAANA BAYANNA
0x0DB83512SINHALA LETTER MAYANNA
0x0DB93513SINHALA LETTER AMBA BAYANNA
0x0DBA3514SINHALA LETTER YAYANNA
0x0DBB3515SINHALA LETTER RAYANNA
0x0DBD3517SINHALA LETTER DANTAJA LAYANNA
0x0DC03520SINHALA LETTER VAYANNA
0x0DC13521SINHALA LETTER TAALUJA SAYANNA
0x0DC23522SINHALA LETTER MUURDHAJA SAYANNA
0x0DC33523SINHALA LETTER DANTAJA SAYANNA
0x0DC43524SINHALA LETTER HAYANNA
0x0DC53525SINHALA LETTER MUURDHAJA LAYANNA
0x0DC63526SINHALA LETTER FAYANNA
0x0DCA3530SINHALA SIGN AL-LAKUNA
0x0DCF3535SINHALA VOWEL SIGN AELA-PILLA
0x0DD03536SINHALA VOWEL SIGN KETTI AEDA-PILLA
0x0DD13537SINHALA VOWEL SIGN DIGA AEDA-PILLA
0x0DD23538SINHALA VOWEL SIGN KETTI IS-PILLA
0x0DD33539SINHALA VOWEL SIGN DIGA IS-PILLA
0x0DD43540SINHALA VOWEL SIGN KETTI PAA-PILLA
0x0DD63542SINHALA VOWEL SIGN DIGA PAA-PILLA
0x0DD83544SINHALA VOWEL SIGN GAETTA-PILLA
0x0DD93545SINHALA VOWEL SIGN KOMBUVA
0x0DDA3546SINHALA VOWEL SIGN DIGA KOMBUVA
0x0DDB3547SINHALA VOWEL SIGN KOMBU DEKA
0x0DDC3548SINHALA VOWEL SIGN KOMBUVA HAA AELA-PILLA
0x0DDD3549SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA
0x0DDE3550SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA
0x0DDF3551SINHALA VOWEL SIGN GAYANUKITTA
0x0DF23570SINHALA VOWEL SIGN DIGA GAETTA-PILLA
0x0DF33571SINHALA VOWEL SIGN DIGA GAYANUKITTA
0x0DF43572SINHALA PUNCTUATION KUNDDALIYA



Java Native Interface-JNI Helloworld






මන් කියලා දෙන්න යන්නේ කොහොමද ජාවා ,සී ප්ලස්‌ භාෂා වලින් Application එකක් හදාගන්නේ කොහොමද කියලා ...


මේක කරන්න අවශ්‍ය වෙන්නේ මෙන්න මේවා ටික විතරයි .


java and c/c++ Application සම්බන්දව මුලික දැනුමක්..
JDK 7 , නැති කට්ටිය මෙතනින් ගන්න .
Dev-Cpp නැති කට්ටිය මෙතනින් ගන්න .
Netbeans IDE ,නැති කට්ටිය මෙතන්න ගිහින් ඩවුන්ලෝඩ් කරගන්න .


දැන් අපි JNI (java native interface) සම්බන්දව කතා කරමු.ඔබ ජාවා පිළිබද උනන්දුවක් දක්වන්නේ නම් ,ජාවා භාෂාව භාවිතා කර නිර්මාණ කරන්නේ නම් ඔබට එහි භාවිතයන් ප්‍රමාණවත් මදි බව ඔබට වැටහෙන බව ඔබ දන්නා කරුණකි.උදාහරණයක් වශයෙන් පරිගණකයේ තොටුපල (Ports ) භාවිතා කර වාහනයක් පාලනය කිරීම.මෙවන් අවසථා සදහා ඔබට වෙනත් භාෂාවක් සමග කටයුතු කරන්නට ඔබට සිදු වේ.(මිට හේතුව වන්නේ මා සිතනා ආකාරයට එහි පවතින cross platform capability එක පවත්වා ගෙන යාම සදහායි.).කෙසේ වෙතත් මෙවන් කටයතු සදහා JNI හදුන්වා දී තිබෙනවා.

ක්‍රමලේකන කිරීම ආරම්භ කිරීමට ප්‍රථම ඉහතින් අප බා ගත් JDK හා Dev-cpp දෙක install කල යුතු වෙනවා.මේ සදහා බා ගත කල ස්ථානයේ එම නමින් පවතින .exe ගොනු මත දෙවරක් එබීමෙන් එය පරිගණකයට ඇතුලත් කල හැක.අනතුරුව පහත සදහන් ආකාරයේ ස්ථානයන් දෙක පරිගණකයේ Path විචල්‍යයට ඇතුලත් කල යුතු වනවා.


C:\Program Files\Java\jdk1.6.0_16\bin;
C\Dev-Cpp\bin;
දැන් පහත වැඩසටහන දෙස බලන්න.එය ටයිප් කරගන්න.අනතුරුව එය Compile කර ගන්න.

public class HelloWorld {
public native void Hello();
static {
System.load("C:/jana/HelloWorld.dll");
System.out.println("Loaded");
}
public static void main(String[] args) {
new HelloWorld().Hello();
}
}





Dos භාවිතා කරන්නේ නම්  javac Helloworld.java මගින් එය සිදු කර ගත.Compile කර ගත් පසු ඔබට HelloWorld.class file එකක් දැක ගත හැක.අනතුරුව පහත සදහන් විදානය ලබා දෙන්න.









එවිට ඔබට මෙය  HelloWorld.h file එක ලැබේ.
.





දැන් අලුත් C++ වැඩසටහන පහත ආකාරයට සකස් කරගන්න

HelloWorld.c
#include
#include
#include "HelloWorld.h"

JNIEXPORT void JNICALL
Java_HelloWorld_print(JNIEnv *env, jobject obj)
{
printf("HelloWorld...!\n");
return 0;
}

 .o file එකක් සදා ඇනීමට පහත විදානය දෙන්න.


gcc -c -I"include" -I"\include\win32" -o HelloWorld.o HelloWorld.c


ex:- gcc -c -I"C:\Program Files\Java\jdk1.6.0_16\include" -I"C:\Program Files\Java\jdk1.6.0_16\include\win32" -o HelloWorld.o HelloWorld.c


.o file එක සාදා ගත් පසු අපට def file අවශ්‍ය වේ.එය පහත පරිදි සකස් කර ගන්න.
(rename its extention to .def)


EXPORTS
Java_HelloWorld_Hello


දැන් අවශ්‍ය කරන සියල්ල සදා ගෙන අවසානය .දන ඔබට .dll file එක සදා ගැනීමට හැකි වේ.ඒ සදහා පහත විදානය භාවුතා කරන්න.


gcc -shared -o HelloWorld.dll HelloWorld.o HelloWorld.def

java HelloWorld විදානය භාවිතා කිරීමෙන් ඔබ දැන් සාදා ගත් පරිගණක වැඩටහන ධාවනය කර ගත හැකි වනු ඇත.එවිට ඔබට පහත දැක්වෙන පරිදි Window එකක් ලැබෙනු ඇත.

















END.

Java-File deletion & openning a file











ජාවා වලින් ෆයිල් එකක් ඩිලීට් කරන්නේ මෙහෙමයි

import java.io.*;
public class DeleteFile { 

 public static void main(String[] args) {
 File newfile = new File("c:\\test.txt"); 
 newfile.delete(); 
 }
}


 
exe ෆයිල් එකක් ජාවා වලින් ඕපන් කරන්නේ කොහොමද ?


public class exeරunner {
public static void main(String[] args) {
try {
Runtime.getRuntime().exec("FileName.exe");
} catch (Exception e) {
e.printStackTrace();
}
}
}

ෆයිල් නේම් එක වෙනුවට වෙන නමක් පාවිච්චි කරනවානම් .exe ෆයිල් එකට අදාළ සම්පුර්ණ ලිපිනය(path) ඇතුලත් කරන්න ඕනේ..සමහර Games exe ( ex :need for speed ) මේ ක්‍රමයට සහය දක්වන්නේ නෑ.නමුත් ගොඩක් Software මේ විදියට වැඩ කරනවා .


මේ විදියට තමා ක්‍රියාවලිය අවසාන කරන්න වෙන්නේ ......

Process pp = Runtime.getRuntime().exec("calc.exe");
pp.destroy();



ලිපිය කියවපු ඔයාලට බොහොම ස්තුතියි. ....



 
Copyright © ~~~MyMiniProWorld~~~ මුදිත ධර්මසේන