Hi i am new here,
i am trying to send 19 hex values from PC rs232 port to another rfm12b and print there to rs232. Idea is to control atmolight. (packet is = FF 00 00 0F 00 00 00 r1 g1 b1 r2 g2 b2 r3 g3 b3 r4 g4 b4)
so far i am able to send only 11 (?) bytes. how to send more in a packet?
And the second question would be - how to receive not one but several (in my case 19) bytes form serial port, put them somewhere,and then send them via rf.
Please! Someone enlighten me!
Here is code witch works witch sends (and receives) packet of 11 hex.
// Streaming layer demo, transfers different types of data in both directions
// 2009-05-07 <jcw@equi4.com> http://opensource.org/licenses/mit-license.php
// $Id: rf12stream.pde 4727 2009-12-08 21:39:49Z jcw $
#include <Ports.h>
#include <RF12.h>
#include <RF12sio.h>
MilliTimer testTimer;
RF12 RF12;
void setup() {
Serial.begin(38400);
Serial.println("\nrf12stream;
rf12config();
}
void loop() {
if (testTimer.poll(5000) && RF12.ready()) {
static uint8t seq;
Serial.println("T");
RF12 << 0xff << 0x00 << 0x00 << 0x0f << 0x00 << 0x00 << 0x00 << 0xff << 0xff << 0xff << 0xff;
RF12.send(++seq);
}
if (RF12.poll()) {
int a0 = RF12.read();
char a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11;
RF12 >> a1 >> a2 >> a3 >> a4 >> a5 >> a6 >> a7 >> a8 >> a9 >> a10 >> a11;
Serial.print(a1, BYTE);
Serial.print(a2, BYTE);
Serial.print(a3, BYTE);
Serial.print(a4, BYTE);
Serial.print(a5, BYTE);
Serial.print(a6, BYTE);
Serial.print(a7, BYTE);
Serial.print(a8, BYTE);
Serial.print(a9, BYTE);
Serial.print(a10, BYTE);
Serial.print(a11, BYTE);
}
}
