Discussion in "Project Doubts" started by    redzs08    Dec 13, 2010.
Sat Jun 18 2011, 01:37 am
#21
MSDN is just an addon software to show help regarding functions etc. you will be able to run VB without MSDN installed. keep in mind code is for VB6 not other versions.
Sat Jun 18 2011, 01:46 am
#22
thanks ajay for the reply...
how about matlab gui can the interface be done with matlab... just asking for infomation....if can i want to try....
Sat Jun 18 2011, 02:48 am
#23
yes i believe. you can make UI in matlab too. But dont ask me how coz i have no idea
Sat Jun 18 2011, 10:27 am
#24
@ redzs08
u can make GUI and also can interfaced it with serial port
there are many sample codes in matlab
seee it on net
algo will be same as in vb6
Sat Jun 18 2011, 07:03 pm
#25
thanks for the info ajay and majoka i will try on both if possible....
Sat Jul 02 2011, 09:04 pm
#26
i dont understand this function on the code ......
i bode the function (syntax) that i need some explanation..

void main()
{

unsigned char sensor=0,reading;
P1=0;
initSerial();
usDelay(50);
while(1)
{
if(sensor==4)
sensor=0;
if(sensor==0)
sendChar('N');
P1=(P1&0xf8)+sensor; // what this syntax doing?
latch();
startConv();
wait();
get();
reading=P2;
sendReading(reading);
sensor++;

}
}

i hope someone help me.....


Sun Jul 03 2011, 04:27 pm
#27
unsigned char sensor=0,reading; // general variables
P1=0; // making port1=0
initSerial(); // initilizing serial port @ 9600 bps with 11.0592 Mhz
usDelay(50); // some delay
while(1) // forever loop
{
if(sensor==4) // it means ur using 4 sensors only
sensor=0;
if(sensor==0) // send 'N' to pc for understanding of GUI
sendChar('N'); // sending character to pc
P1=(P1&0xf8)+sensor; //relays are also on port 1 so we need only to change 4 bits of address pin not relay so
// doing a AND logic here with 0xf8 and then add it with sensor now port1 low4 bits has sensor value from 0 to 3
latch(); // latch enable with address
startConv(); // start conversion
wait(); // waiting for end of conversion
get(); // reading data
reading=P2;
sendReading(reading);
sensor++; // next sensor
Sun Jul 03 2011, 10:01 pm
#28
thank majoka the explanation was good....

Sun Jul 03 2011, 10:08 pm
#29
i got problem on this code....

void serialRoutine() interrupt 4
{
if(RI==1)
{
temp=SBUF;
switch(temp)
{
case('a'):
relay1=1;
break;
case('b'):
relay1=0;
break;
case('c'):
relay2=1;
break;
case('d'):
relay2=0;
break;
case('e'):
relay3=1;
break;
case('f'):
relay3=0;
break;
case('g'):
relay4=1;
break;
case('h'):
relay4=0;
}
RI=0;
}
}
void sendReading(unsigned char val)
{
unsigned char l,m;
l=val%10;
m=(val/10)%10;
sendChar(aray[m]);
sendChar(aray[l]);
sendChar(',');
}

i will need someone explanation..... hope not asking much...
Sun Jul 03 2011, 11:27 pm
#30
this is interrupt function for serial port
when data is received from pc this function call automatically
sbuf has that data
here case is used to on and off the suitable relay
when reception occur RI flag become high an d generate interrupt

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am
ArnoldDiant
Fri Apr 26 2024, 03:53 am
RodneyKnorb
Thu Apr 25 2024, 07:08 pm
Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am