Hi I am using a FEZ Cerb40 II to control a RF433 wireless module.
This module needs 5v power and can be controlled by UART.
I use a 3.7V 18650 Utrafire 3000mAh Li Battery, convert it to 5V by using a LM2577 DC-DC Converter. Then supply 5V to FEZ Cerb40 II and RF433 wireless module.
The sending end is FEZ Cerb40 II +RF433 wireless module and the receiving end is a Spider+ Extender Module+ RF433 wireless module.
The code in FEZ Cerb40 II end is simple :
public static void Main()
{
SerialPort UART = new SerialPort("COM3", 9600);
int counter = 0;
UART.Open();
while (true)
{
string counter_string = counter.ToString() + "\r\n";
// convert the string to bytes
byte[] buffer = Encoding.UTF8.GetBytes(counter_string);
UART.Write(buffer, 0, buffer.Length);
// increment the counter;
counter = counter + 1;
//wait...
Debug.Print("Send:" + counter_string.ToString());
Thread.Sleep(1000);
}
}
The code in Spider:
void rf433_DataReceived(GT.Interfaces.Serial sender, SerialData data)
{
var font = Resources.GetFont(Resources.FontResources.NinaB);
int read_count = 0;
//rf433.
int btr = rf433.BytesToRead;
byte[] bytes = new byte[btr];
read_count = rf433.Read(bytes, 0, bytes.Length);
string Text = new string(System.Text.Encoding.UTF8.GetChars(bytes));
Debug.Print(btr.ToString());
Debug.Print(Text.ToString());
display_T35.SimpleGraphics.Clear();
display_T35.SimpleGraphics.DisplayText("Date Receiving....", font, GT.Color.White, 50, 50);
display_T35.SimpleGraphics.DisplayText("Date Receivingbyte:" + btr.ToString(), font, GT.Color.White, 50, 80);
display_T35.SimpleGraphics.DisplayText("Node:" + Text, font, GT.Color.Orange, 50, 100);
// Debug.Print(bytes.Length.ToString());
}
The test application is simple but FEZ Cerb40 II seems not work well.
The display_T35 should display the the data every second. But it is not and twinkling.
So I deploy the same code to FEZ Cerbuino Bee+ RF433 wireless module.
It works well. So I don;t know what problem in the FEZ Cerb40 II.
Could any one help me ? I have fallen in this problem last 2 weeks.
Couldn’t find the solve.
Thanks.