inviare con bluetooth un byte


ciao tutti,
devo creare un programma che mi invia tramite bluetooth un byte composto da una serie di codici.
questo è il programma che ho ipotizzato :
code: [select]
#include <softwareserial.h>
byte msg[] ={ 0x00,0x09,0x00,'a',0x02}; //byte da inviare
const int rxpin=12;
const int txpin=13;


softwareserial bluetooth(rxpin, txpin);
void setup()
{
 
bluetooth.begin(9600);
serial.begin(9600);
}

void loop()
{serial.println(msg);
delay(1000);
 
bluetooth.println(msg);
}


ma il compilatore mi restituisce errori :
code: [select]


inviare_byte.ino: in function 'void loop()':
inviare_byte:28: error: call of overloaded 'println(byte [5])' ambiguous
c:\users\simone\desktop\arduino-1.0.5-r2\hardware\arduino\cores\arduino/print.h:68: note: candidates are: size_t print::println(const string&) <near match>
c:\users\simone\desktop\arduino-1.0.5-r2\hardware\arduino\cores\arduino/print.h:69: note:                 size_t print::println(const char*) <near match>
c:\users\simone\desktop\arduino-1.0.5-r2\hardware\arduino\cores\arduino/print.h:70: note:                 size_t print::println(char) <near match>
c:\users\simone\desktop\arduino-1.0.5-r2\hardware\arduino\cores\arduino/print.h:71: note:                 size_t print::println(unsigned char, int) <near match>
c:\users\simone\desktop\arduino-1.0.5-r2\hardware\arduino\cores\arduino/print.h:72: note:                 size_t print::println(int, int) <near match>
c:\users\simone\desktop\arduino-1.0.5-r2\hardware\arduino\cores\arduino/print.h:73: note:                 size_t print::println(unsigned int, int) <near match>
c:\users\simone\desktop\arduino-1.0.5-r2\hardware\arduino\cores\arduino/print.h:74: note:                 size_t print::println(long int, int) <near match>
c:\users\simone\desktop\arduino-1.0.5-r2\hardware\arduino\cores\arduino/print.h:75: note:                 size_t print::println(long unsigned int, int) <near match>

mi sapreste aiutare?
grazie

tu dici di voler inviare un byte ma crei e cerchi di spedire un array di byte.


Arduino Forum > International > Italiano > Generale (Moderator: leo72) > inviare con bluetooth un byte


arduino

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support