Pages

Monday, 2 September 2013

Class C Error in Counter Strike

LAN servers are restricted to local clients (class C).





When Connecting 2 or more Systems in a network for playing Counter Strike, many times we face a Class C Error.To Solve this no need to restart systems or CS game on all the Systems.


Solution:-

Restart the CS (Counter Strike) game of the System which is the "Host" of the game. And again start hosting the game and allow all others systems to connect. Thats it!!

If any other Queries ,please feel free to comment. i will try to respond as soon as possible. :)

Wednesday, 29 May 2013

How to Show Profile Pictures of your Whatsapp contacts in Gallery

For Android Phones---------------

Whatsapp Contacts Profile pictures are actually get Saved when we open it and will remain in phone till that contacts new Pic replace it. So if you want to show them up in Gallery then follow the below steps

1)  Open File Manger or say "my files".

2)  Go into Whatsapp Folder

3)  There will be several folders such as Backups,Media, Profile Pictures etc. Open Profile Pictures folder.

4)  There we can see Contacts Pictures with a one extra file which is " .nomedia " . 

5) Delete that  .nomedia  file.

And thats it. You are Done !!!

Note:-  Deleting .nomedia file is totally safe. If in future you want it back then just restart your Phone. :) 
 

How to Hide Media Files from showing up in Gallery of Android Phones

For Android Phones----------------

Many times we have to give our phone to Friends or Family when they ask for it and in some situations we can't refuse it. But we actually dont want them to see some Media Files( like pictures,vedios or Audios ) which are private.

In that case, u need the below tweak!!! 
Steps as Follows====

1) Open your phone's  File Manager

2) Go To that  Folder which contains your media files.

3) Rename the Folder by putting a dot(.) infront of the folder Name. ( but dont forget to change the  File Manager settings for showing Hidden Files)
                                       OR
3) Paste a " .nomedia " file in that folder.

and thats it. You are Done !!! 


NOTE :- You  dont need to get or create a " .nomedia " file. If you are Whatsapp User then you actually Have it. Its in your "Profile Pictures" Folder. Just Copy it and paste to the folder whichever you want.

If any have Query feel free to Comment here. I would Love to reply it asap.

Thursday, 14 March 2013

8051 Keil code to Rotate a String on LCD screen

/** Code Source :- www.tentuts.com **/

#include<reg51.h>
sbit rw=P2^0;  //read write pin
sbit rs=P2^1;  // data/command pin
sbit en=P2^2; //enable pin

void lcd_init(void );
void lcd_cmd(unsigned char );
void delay(unsigned int );
void lcd_display(unsigned char);
void lcd_clear(void );
const unsigned char text[]={"Welcome to MUFADDAL KAGDA World  Of  Programming!!"};

void main(void ){
 unsigned char i,loc=0x80;
  rw=0;
  lcd_clear();
  lcd_init();
  for(i=0;text[i]!='\0';i++){
   loc++;
   lcd_display(text[i]);
   if(loc>=0x8f)
    lcd_cmd(0x18);
  }

}
void lcd_clear(void){
 
    lcd_cmd(0x01);
 }
void lcd_init(void ){

   lcd_cmd(0x30);
   lcd_cmd(0x0c);
   lcd_cmd(0x06);
 }

void lcd_cmd(unsigned char cmd){

  rs=0;
  P1=cmd;
  en=1;
  delay(75);
  en=0;
 }

void lcd_display(unsigned char text){

 rs=1;
 P1=text;
 en=1;
 delay(1);
 en=0;
 }
void delay(unsigned int time){
unsigned int i,j;
for (i=0;i<time;i++)
 for(j=0;j<1275;j++);
 }

Friday, 8 March 2013

8051 code of Low Cost path Lightening and Presence Detector


/* Author:- Mufaddal Kagda
8051-P89V51RD2 */


#include <reg51.h>
#include <string.h>

sbit rs = P2^7;  // declare P2.7 as rs pin
sbit en = P2^5;  // declare p2.5 as enable pin
sbit rw = P2^6;  // declare p2.6 as read/write pin
sbit b = P0^7;   // busy flag
sbit port = P1^2;  // connected to IR sensor
void writecmd(unsigned char a); // function to send command to LCD
void writedat(unsigned char b);  // function to send data to LCD
void busy();   // function to check LCD is busy or not
void writestr(unsigned char *s); // function to write string on LCD

void writecmd(unsigned char a)
{
 busy();   // check for LCD is busy or not
 rs = 0;   // clear rs pin for command
 rw = 0;   // clear rw pin to write
 P0 = a;   // send command character
 en = 1;   // strob LCD
 en = 0;

}
void writedat(unsigned char b)
{
 busy();   // check for LCD is busy or not
 rs = 1;   // set rs pin for data
 rw = 0;   // clear rw pin to write
 P0 = b;   // send data character
 en = 1;   // strob LCD
 en = 0;
}
void busy()
{
 en = 0;   // disable display
 P0 = 0xFF;  // configur P0 as input
 rs = 0;   // clear rs pin for command
 rw = 1;   // set rw pin to read
 while(b==1)
 {
  en=0;   // strob LCD till P0.7 is 1
  en=1;
 }
 en=0;
}
void send(unsigned char d)
{
while(!TI);
TI=0;
SBUF=d;
}
void writestr(unsigned char *s)
{
 unsigned char l,i;
 l = strlen(s);               // get the length of string
 for(i=1;i<=l;i++)
 {
  writedat(*s);              // write every char one by one
  s++;
 }
}
 
main()
{
    P0=0x00;                      // P0 and P0 as output ports
    P2=0x00;
port=0;
TMOD=0x20;            //Enable Timer 1
    TH1=0XFD;
    SCON=0x50;
    TR1=1;
TI=1;
        writecmd(0x3C);               // initialize LCD
        writecmd(0x0E);  
        writecmd(0x01);

    writecmd(0x01);
send('0');
writestr("Not Occupied");
while(port==0);

    writecmd(0x01);
send('1');
writestr("Occupied");
        while(port==1);                       // continuous loop

 }

Thursday, 28 February 2013

RFID based Ticketing System DEMO


8051 code of RFID Based Ticketing System


/* Author:-
                  MUFADDAL KAGDA
                  THOMSON AJ
                  TERESA ANTONY

MicroController (keil) code 8051
*/
#include <reg51.h>
#include <string.h>
#define dataport P1 //Port for LCD display
#define keyp P3  // Port for keypad
#define port P2 //control signlas for LCD and Buzzer
#define port0 P0

sbit rs = port^1;//register select
sbit rw = port^0;//read/write
sbit en = port^2;//enable
sbit buzzer = port0^0; //buzzer port
sbit red = port0^2;  //port for Red LED
sbit green=port0^1;  //port for Green LED
unsigned char card[15];
unsigned char c[15];
char READ_SWITCHES(void);
char get_key(void);

sbit mtrop=P0^4;  //port for opening gate (moves motor anticlockwise)
sbit mtrcl=P0^3;   //port for closing gate(moves motor clockwise)
sbit ir=P0^6;         //port connected to IR circuit
sbit RowA = keyp^0;     //RowA
sbit RowB = keyp^1;     //RowB
sbit RowC = keyp^2;     //RowC
sbit RowD = keyp^3;     //RowD

sbit C1   = keyp^4;     //Column1
sbit C2   = keyp^5;     //Column2
sbit C3   = keyp^6;     //Column3
sbit C4   = keyp^7;     //Column 4


void delay(unsigned int time){
   unsigned int i;
   for(i=0;i<time;i++);
 }
void send(unsigned char d)
{
while(!TI);
TI=0;
SBUF=d;
}
unsigned char read()
{
while(!RI);
RI=0;
return SBUF;
}
void lcd_cmd(unsigned char item) //Function to send command to LCD
{
dataport = item;
rs= 0;
rw=0;
en=1;
delay(1);
en=0;
return;
}
void lcd_data(unsigned char item) //Funtion to send data on LCD
{
//send(item);
dataport = item;
rs= 1;
rw=0;
en=1;
delay(1);
en=0;
return;
}
void lcd_data_string(unsigned char *str) // Function to send string on LCD
{
int i=0;
while(str[i]!='\0')
{
 lcd_data(str[i]);
 i++;
 delay(20000);
}
return;
}

void lcd(unsigned char str[15],int r,int p,int c)  // Funtion to Initialize,write,clear LCD
{
  //row1 0x80
  //row2 0xc0
lcd_cmd(0x38);//8bit data bus
lcd_cmd(0x0f);//turn display on,display cursor, blink cursor
//delay(sec);

//---lcd_cmd(0x01);//clear
if(c==1)
lcd_cmd(0x01);
//delay(sec);
if(r==1)
lcd_cmd(0x80+p); //row1 pos
else if(r==2)
lcd_cmd(0xc0+p); //row2 pos

//delay(sec);
lcd_data_string(str);
}
char get_key(void)           //get key from user
{
char key = 'n';              //assume no key pressed

while(key=='n')              //wait untill a key is pressed
key = READ_SWITCHES();   //scan the keys again and again
/* buzzer=1;
delay(20);
buzzer=0;  */
return key;                  //when key pressed then return its value
}

void serial_init()
{
// P0=0x00;                      // P0 and P2 as output ports
    P2=0x00;
TMOD = 0x20;
SCON = 0x50;
    TH1  = 0xFD;
    TL1  = 0xFD;
    TR1  = 1;
}
char READ_SWITCHES(void)
{
RowA = 0; RowB = 1; RowC = 1; RowD = 1; //Test Row A

if (C1 == 0) { delay(10000); while (C1==0); return '*'; }
if (C2 == 0) { delay(10000); while (C2==0); return '*'; }
if (C3 == 0) { delay(10000); while (C3==0); return '*'; }
if (C4 == 0) { delay(10000); while (C4==0); return '*'; }

RowA = 1; RowB = 0; RowC = 1; RowD = 1; //Test Row B

if (C1 == 0) { delay(10000); while (C1==0); return '*'; }
if (C2 == 0) { delay(10000); while (C2==0); return '*'; }
if (C3 == 0) { delay(10000); while (C3==0); return '*'; }
if (C4 == 0) { delay(10000); while (C4==0); return '*'; }

RowA = 1; RowB = 1; RowC = 0; RowD = 1; //Test Row C

if (C1 == 0) { delay(10000); while (C1==0); return '*'; }
if (C2 == 0) { delay(10000); while (C2==0); return '6'; }
if (C3 == 0) { delay(10000); while (C3==0); return '5'; }
if (C4 == 0) { delay(10000); while (C4==0); return '4'; }

RowA = 1; RowB = 1; RowC = 1; RowD = 0; //Test Row D

if (C1 == 0) { delay(10000); while (C1==0); return '*'; }
if (C2 == 0) { delay(10000); while (C2==0); return '3'; }
if (C3 == 0) { delay(10000); while (C3==0); return '2'; }
if (C4 == 0) { delay(10000); while (C4==0); return '1'; }

return 'n';           // Means no key has been pressed
}
void display(char a,int r,int p) //Display functon for LCD
{
switch(a)
{
 case '1':lcd("1",r,p,0);
   break;
 case '2':lcd("2",r,p,0);
   break;
 case '3':lcd("3",r,p,0);
   break;
 case '4':lcd("4",r,p,0);
   break;
 case '5':lcd("5",r,p,0);
   break;
 case '6':lcd("6",r,p,0);
   break;
 case '7':lcd("7",r,p,0);
   break;
 case '8':lcd("8",r,p,0);
   break;
 case '9':lcd("9",r,p,0);
   break;
 case '0':lcd("0",r,p,0);
   break;

}
}
main()
{
char key;
unsigned char i;
ir=0; // Initialize IR circuit to 0

  serial_init();
  TI=1;
RI=1;
while(1)
{
lcd(" Welcome to",1,0,1);
lcd("Ticketing System",2,0,0);

  lcd(" Name:",1,0,1);
for(i=0;i<12;i++) //reading name
  {
    while(RI==0);
    card[i]=SBUF;
    RI=0;
  }

if(card[1]=='#')  //if invalid user
{
red=0;  //redLED ON
   buzzer=0;  //Buzzer ON
   delay(40000);
   red=1;  //redLED OFF
   buzzer=1;  //Buzzer OFF
lcd(" Invalid User",1,0,1);
continue;
}
lcd(card,1,6,0); //if valid user
lcd("Dest:",2,0,0);
   key = get_key();
   display(key,2,7);
buzzer=0;
delay(2000);
buzzer=1;
       send(key);



for(i=0;i<4;i++)  //response to enough or low balance
  {
    while(RI==0);
    c[i]=SBUF;
    RI=0;
  }

if(c[1]=='@')  //if low balance
{

  red=0;   //glow red LED
  buzzer=0;  //start buzzer
  delay(4000);
  red=1;   //stopGlowing
  buzzer=1;  //stop buzzer
  lcd("Low Balance",2,0,0);
}
else   //enough balance then display balance
{
 green=0;  //GreenLED ON
  delay(4000);
  delay(4000);
  delay(4000);
 green=1;  //Green LED OFF
 mtrop = 0; //open gate by moving motor anticlockwise
delay(4000);
delay(3200);
   mtrop = 1; //stop moving
lcd("Bal: ",2,0,0);
  lcd(c,2,5,0);
 while(ir==0); //Wait till IR Circuit Sends 1
 mtrcl=0; //close gate by moving motor clockwise
delay(4000);
 mtrcl=1; //stop moving
 ir=0; //Initialize IR back to 0

}

         }  

}

Wednesday, 20 February 2013

Vb.net code to read from ComPort and display!!



Public Class Form1
Dim c1 As Char
 

Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived

        Dim str As String
        str = ""
        c1 = Convert.ToChar(SerialPort1.ReadByte())
        If (c1 <> "") Then
            MsgBox(c1)
        End If

    End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With SerialPort1

            .BaudRate = 9600
            .Parity = System.IO.Ports.Parity.None
            .DataBits = 8
            .StopBits = System.IO.Ports.StopBits.One
            .Handshake = System.IO.Ports.Handshake.None
            If .IsOpen = False Then
                .Open()
            End If
        End With

    End Sub
End Class

Keil Code for Reading 4x4 Matrix Keypad and sending to System buffer


#include <reg51.h>
#include <string.h>

char READ_SWITCHES(void);
char get_key(void);
unsigned char i;
sbit RowA = P3^0;     //RowA
sbit RowB = P3^1;     //RowB
sbit RowC = P3^2;     //RowC
sbit RowD = P3^3;     //RowD

sbit C1   = P3^4;     //Column1
sbit C2   = P3^5;     //Column2
sbit C3   = P3^6;     //Column3
sbit C4   = P3^7;
void delay(unsigned int time){
   unsigned int i;
   for(i=0;i<time;i++);
 }
void send(unsigned char d)
{
while(!TI);
TI=0;
SBUF=d;
}
char get_key(void)           //get key from user
{
char key = 'n';              //assume no key pressed

while(key=='n')              //wait untill a key is pressed
key = READ_SWITCHES();   //scan the keys again and again

return key;                  //when key pressed then return its value
}
char READ_SWITCHES(void)
{
RowA = 0; RowB = 1; RowC = 1; RowD = 1; //Test Row A

if (C1 == 0) { delay(10000); while (C1==0); return '7'; }
if (C2 == 0) { delay(10000); while (C2==0); return '8'; }
if (C3 == 0) { delay(10000); while (C3==0); return '9'; }
if (C4 == 0) { delay(10000); while (C4==0); return '/'; }

RowA = 1; RowB = 0; RowC = 1; RowD = 1; //Test Row B

if (C1 == 0) { delay(10000); while (C1==0); return '4'; }
if (C2 == 0) { delay(10000); while (C2==0); return '5'; }
if (C3 == 0) { delay(10000); while (C3==0); return '6'; }
if (C4 == 0) { delay(10000); while (C4==0); return 'x'; }

RowA = 1; RowB = 1; RowC = 0; RowD = 1; //Test Row C

if (C1 == 0) { delay(10000); while (C1==0); return '1'; }
if (C2 == 0) { delay(10000); while (C2==0); return '2'; }
if (C3 == 0) { delay(10000); while (C3==0); return '3'; }
if (C4 == 0) { delay(10000); while (C4==0); return '-'; }

RowA = 1; RowB = 1; RowC = 1; RowD = 0; //Test Row D

if (C1 == 0) { delay(10000); while (C1==0); return 'C'; }
if (C2 == 0) { delay(10000); while (C2==0); return '0'; }
if (C3 == 0) { delay(10000); while (C3==0); return '='; }
if (C4 == 0) { delay(10000); while (C4==0); return '+'; }

return 'n';           // Means no key has been pressed
}
main()
{
    char key;
    P0=0x00;                      // P0 and P2 as output ports
    P2=0x00;
    TMOD=0x20;            //Enable Timer 1
    TH1=0XFD;
    SCON=0x50;
    TR1=1;
    TI=1;
    while(1)
    {
    key = get_key();
   send(key);
    }       // clear memory and home cursor

}

Wednesday, 23 January 2013

C# Code as drivers for interfacing LCD display with 8051

// Author :- ** Mufaddal Kagda **

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;
using System.Threading;

namespace WindowsFormsApplication1
{
         public partial class Form1 : Form
        {
              public Form1()
             {
                   InitializeComponent();
             }

     
             SerialPort SP = new SerialPort("COM35");
     

             private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
            {
                 SP.BaudRate = 9600;
                 SP.Parity = Parity.None;
                 SP.DataBits = 8;
                 SP.StopBits = StopBits.One;
                 SP.RtsEnable = true;
                 SP.DtrEnable = true;
                 SP.Encoding.GetEncoder();
                 SP.ReceivedBytesThreshold = 1;
                 SP.NewLine = Environment.NewLine;
         
                 try
                {
                     SP.Open();
                     SP.Write((e.KeyChar).ToString());
                     Thread.Sleep(10);
                     SP.Close();
                }
                catch (Exception ex)
               {
                    MessageBox.Show(ex.Message);
               }
         
         }
     }
}

Sunday, 20 January 2013

8051 Program to take input from COM port and Display on LCD


// Author :- ** Mufaddal Kagda **
//Embeded C program ( keil Program)
// 8051 Microcontroller

/*This Program is made to display Characters on LCD screen  typed From PC Keyboard --interfaced with 8051 */

#include <reg51.h>
#include <string.h>

sbit rw=P2^0;  //read write pin
sbit rs=P2^1;  // data/command pin
sbit en=P2^2;   // declare p2.2 as read/write pin
sbit b = P1^7;   // busy flag
unsigned char card[12];

void writecmd(unsigned char a); // function to send command to LCD
void writedat(unsigned char b);  // function to send data to LCD
void busy();   // function to check LCD is busy or not
void writestr(unsigned char *s); // function to write string on LCD

void writecmd(unsigned char a)
{
 busy();   // check for LCD is busy or not
 rs = 0;   // clear rs pin for command
 rw = 0;   // clear rw pin to write
 P1 = a;   // send command character
 en = 1;   // strob LCD
 en = 0;
}
void writedat(unsigned char b)
{
 busy();   // check for LCD is busy or not
 rs = 1;   // set rs pin for data
 rw = 0;   // clear rw pin to write
 P1 = b;   // send data character
 en = 1;   // strob LCD
 en = 0;
}
void busy()
{
         en = 0;   // disable display
         P1 = 0xFF;  // configur P0 as input
         rs = 0;   // clear rs pin for command
         rw = 1;   // set rw pin to read
         while(b==1)
        {
               en=0;   // strob LCD till P1.7 is 1
               en=1;
        }
        en=0;
}
void writestr(unsigned char *s)
{
      unsigned char l,i;
      l = strlen(s);               // get the length of string
      for(i=1;i<=l;i++)
      {
           writedat(*s);              // write every char one by one
           s++;
      }
}
 
main()
{

    P0=0x00;                      // P0 and P2 as output ports
    P2=0x00;
    TMOD=0x20;            //Enable Timer 1
    TH1=0XFD;
    SCON=0x50;
    TR1=1;
 
    writecmd(0x3C);               // initialize LCD
    writecmd(0x0E);  
    writecmd(0x01);              // clear memory and home cursor

while(1)
{
while(RI==0);
card[0]=SBUF;
RI=0;
writestr(card);
  }
   }