software_uart.pde
Hello,
I am trying to compile the software_uart.pde from the example folder. It calls functions such as SwSerial.read()
IDE 11.0 beta 4
I am getting error during compilation.
[OUT] ERROR: 255: Undefined identifier 'PORTBbits'
[OUT] 255: Structure/Union expected left of '.->'
[OUT] 256: Undefined identifier 'PORTBbits'
[OUT] 256: Structure/Union expected left of '.->'
[OUT] 310: Undefined identifier 'PORTBbits'
[OUT] 310: Structure/Union expected left of '.->'
[OUT] 312: Undefined identifier 'PORTBbits'
[OUT] 312: Structure/Union expected left of '.->'
[OUT] 327: Undefined identifier 'PORTBbits'
[OUT] 327: Structure/Union expected left of '.->'
Could some body help me with this errors?
Thanks for your help.
#define SWBAUDRATE 9600// or 57600, 38400, 19200, 9600, 4800
// other baudrates 115200 2400 1200 were tried but did not work perfectly
#define _SW_PORT _PORTB // Transmit pin port and pin
#define TXDpin 4 // or 0, 2, 6
#define RXDpin 5 // or 1, 3, 7
#define SW_PORT_TXDpin PORTBbits.RB4 // or 0, 2, 6
#define SW_TRIS_TXDD TRISBbits.TRISB4 // or 0, 2, 6
#define SW_PORT_RXDpin PORTBbits.RB5 // or 1, 3, 7
#define SW_TRIS_RXDD TRISBbits.TRISB5 // or 1, 3, 7
char buf;
void setup() {
SW_TRIS_TXDD = 0;
SW_PORT_TXDpin = 1;
SW_TRIS_RXDD = 1;
SwSerial.putString("Hello !\n\r");//putString replaceable by printf
SwSerial.printf("Enter your name or everything you want : ");//putsUART
}
void loop() {
buf=SwSerial.read();
// SwSerial.write(buf); //write replaceable by printf :
SwSerial.printf("%c",buf);
}
|