art
Joined: 21 May 2015 Posts: 181
|
Display problem |
Posted: Tue Jan 17, 2017 2:55 am |
|
|
Hi,
I'm trying to display a result " 1_0_1_0_ " from my code, but when I compile it, it shows message "Code has no effect" and display result is " 0_0_0_0_ "
Kindly please help. Here is my code:
Code: |
#include <18F4550.h>
#fuses HSPLL,NOWDT,PROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
#use delay(clock=48000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7,ERRORS)
#include <string.h>
#include <input.c>
#include <stdio.h>
#include <stdlib.h>
#include <usb_cdc.h>
void main()
{
char c;
int8 i ;
unsigned char d;
unsigned char key;
usb_init_cs();
while (TRUE)
{
usb_task();
if (usb_cdc_kbhit())
{
c=usb_cdc_getc();
if (c=='\n') {putc('\r'); putc('\n');}
if (c=='\r') {putc('\r'); putc('\n');}
while(true)
{
ART:
d = usb_cdc_getc();
if(d=='R') // push U for INPUT BUTTON
{
while (key!=32) // push SPACE BAR to stop
{
if(usb_cdc_kbhit())
{key=usb_cdc_getc();}
int16 a1,a2,a3,a4;
int b1,b2,b3,b4;
a1=10000;
a2=4000;
a3=9500;
a4=5000;
{
if (a1>=9000);
b1=1;
if (a1<9000);
b1=0;
if (a2>=9000);
b2=1;
if (a2<9000);
b2=0;
if (a3>=9000);
b3=1;
if (a3<9000);
b3=0;
if (a4>=9000);
b4=1;
if (a4<9000);
b4=0;
printf(usb_cdc_putc,"%u_%u_%u_%u_" b1,b2,b3,b4 );
}
} key=0; // to initialize 'key' not as SPACE BAR
}
} // For USB format
} // For USB format
} // For USB format
} // For USB format
|
|
|