Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem using CDC library under X.3
26-12-2012, 04:38 AM,
#1
problem using CDC library under X.3
Hi Friends,
I', trying to do some tutorials about board pinguino18f4550, and recently I've migrate to X.3, so I was checking my past codes under X.2 to X.3 and see what happens, and in that process I found a problem: CDC library doesn't work.

I have Win7 OS, 64 bit, Pinguino IDE X.3, but this example runs very well under X.2, I would like to know if you need more information in order to solve this issue. Thanks!

The code:
Code:
u16 n=0;
unsigned char receivedbyte;
unsigned char rxstr[64];
int a,b;

void setup()
{
    pinMode(28, OUTPUT);
    digitalWrite(28,LOW);
}

void loop()
{
    do{
        receivedbyte = CDC.read(rxstr);
        delay(250);
    }while(receivedbyte == 0);

    
    a = rxstr[0];//15;
    n = a;
    CDC.printf("%03d\n",a);
    delay(250);
    CDC.printf("%x\n",a);
    delay(250);
    CDC.printf("%c\n",n);
    delay(250);
    CDC.printf("%s\n",rxstr);

    n = 10;
    while(n--)
    {
        toggle(28);
        delay(250);            
    }
    
}
mi Blog MicroEmbebidos (PINGUINO,PIC,STM32F,ATMEL)
http://microembebidos.wordpress.com/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)