Display of characters on the LCD display on XBee development board
up vote
0
down vote
favorite
I am working with programmable XBee development board to interface with LCD HD44780 (20x4). I receive a wireless frame on the XBee and display it on the LCD.
It works fine when the length of the is with in 80 characters because I cannot display more than that. For this I want to display the frame character by character so that when the last character is displayed the cursor moves to 0,0 again and then overwrite. This way I could display as much as I can, depending on XBee RAM.
The below code is fine for frame less than or equal to 80 characters. Any tips on how to do the character by character thing for the frame?
#include <xbee_config.h>
#include <types.h>
#include <string.h>
#include <ctype.h>
#define char_lcd_write_str(a) char_lcd_write(a, strlen(a))
static uint8_t test_stage = 0;
static uint8_t test_stage_done = 0;
#if defined(RTC_ENABLE_PERIODIC_TASK)
void rtc_periodic_task(void)
{
test_stage++;
if (test_stage == 8)
test_stage = 0;
test_stage_done = 0;
}
#endif
#ifdef ENABLE_XBEE_HANDLE_RX
int xbee_transparent_rx(const wpan_envelope_t FAR *envelope, void FAR *context)
{
int c,k;
char addrbuf[ADDR64_STRING_LENGTH];
char_lcd_init(CHAR_LCD_CFG);
char_lcd_clear();
addr64_format(addrbuf, &envelope->ieee_address);
sys_watchdog_reset();
char_lcd_write_str(envelope->payload);
delay_ticks(HZ / 10);
return 0;
}
#endif
void main(void)
{
uint8_t i, j;
int data,l;
sys_hw_init();
sys_xbee_init();
sys_app_banner();
char_lcd_init(CHAR_LCD_CFG);
for (;;) {
if (!test_stage_done) {
switch (test_stage) {
case 0:
char_lcd_goto_xy(0, 0);
char_lcd_write_str("All working fine");
break;
}
test_stage_done = 1;
}
sys_watchdog_reset();
sys_xbee_tick();
}
}
pointers character display xbee lcd
add a comment |
up vote
0
down vote
favorite
I am working with programmable XBee development board to interface with LCD HD44780 (20x4). I receive a wireless frame on the XBee and display it on the LCD.
It works fine when the length of the is with in 80 characters because I cannot display more than that. For this I want to display the frame character by character so that when the last character is displayed the cursor moves to 0,0 again and then overwrite. This way I could display as much as I can, depending on XBee RAM.
The below code is fine for frame less than or equal to 80 characters. Any tips on how to do the character by character thing for the frame?
#include <xbee_config.h>
#include <types.h>
#include <string.h>
#include <ctype.h>
#define char_lcd_write_str(a) char_lcd_write(a, strlen(a))
static uint8_t test_stage = 0;
static uint8_t test_stage_done = 0;
#if defined(RTC_ENABLE_PERIODIC_TASK)
void rtc_periodic_task(void)
{
test_stage++;
if (test_stage == 8)
test_stage = 0;
test_stage_done = 0;
}
#endif
#ifdef ENABLE_XBEE_HANDLE_RX
int xbee_transparent_rx(const wpan_envelope_t FAR *envelope, void FAR *context)
{
int c,k;
char addrbuf[ADDR64_STRING_LENGTH];
char_lcd_init(CHAR_LCD_CFG);
char_lcd_clear();
addr64_format(addrbuf, &envelope->ieee_address);
sys_watchdog_reset();
char_lcd_write_str(envelope->payload);
delay_ticks(HZ / 10);
return 0;
}
#endif
void main(void)
{
uint8_t i, j;
int data,l;
sys_hw_init();
sys_xbee_init();
sys_app_banner();
char_lcd_init(CHAR_LCD_CFG);
for (;;) {
if (!test_stage_done) {
switch (test_stage) {
case 0:
char_lcd_goto_xy(0, 0);
char_lcd_write_str("All working fine");
break;
}
test_stage_done = 1;
}
sys_watchdog_reset();
sys_xbee_tick();
}
}
pointers character display xbee lcd
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am working with programmable XBee development board to interface with LCD HD44780 (20x4). I receive a wireless frame on the XBee and display it on the LCD.
It works fine when the length of the is with in 80 characters because I cannot display more than that. For this I want to display the frame character by character so that when the last character is displayed the cursor moves to 0,0 again and then overwrite. This way I could display as much as I can, depending on XBee RAM.
The below code is fine for frame less than or equal to 80 characters. Any tips on how to do the character by character thing for the frame?
#include <xbee_config.h>
#include <types.h>
#include <string.h>
#include <ctype.h>
#define char_lcd_write_str(a) char_lcd_write(a, strlen(a))
static uint8_t test_stage = 0;
static uint8_t test_stage_done = 0;
#if defined(RTC_ENABLE_PERIODIC_TASK)
void rtc_periodic_task(void)
{
test_stage++;
if (test_stage == 8)
test_stage = 0;
test_stage_done = 0;
}
#endif
#ifdef ENABLE_XBEE_HANDLE_RX
int xbee_transparent_rx(const wpan_envelope_t FAR *envelope, void FAR *context)
{
int c,k;
char addrbuf[ADDR64_STRING_LENGTH];
char_lcd_init(CHAR_LCD_CFG);
char_lcd_clear();
addr64_format(addrbuf, &envelope->ieee_address);
sys_watchdog_reset();
char_lcd_write_str(envelope->payload);
delay_ticks(HZ / 10);
return 0;
}
#endif
void main(void)
{
uint8_t i, j;
int data,l;
sys_hw_init();
sys_xbee_init();
sys_app_banner();
char_lcd_init(CHAR_LCD_CFG);
for (;;) {
if (!test_stage_done) {
switch (test_stage) {
case 0:
char_lcd_goto_xy(0, 0);
char_lcd_write_str("All working fine");
break;
}
test_stage_done = 1;
}
sys_watchdog_reset();
sys_xbee_tick();
}
}
pointers character display xbee lcd
I am working with programmable XBee development board to interface with LCD HD44780 (20x4). I receive a wireless frame on the XBee and display it on the LCD.
It works fine when the length of the is with in 80 characters because I cannot display more than that. For this I want to display the frame character by character so that when the last character is displayed the cursor moves to 0,0 again and then overwrite. This way I could display as much as I can, depending on XBee RAM.
The below code is fine for frame less than or equal to 80 characters. Any tips on how to do the character by character thing for the frame?
#include <xbee_config.h>
#include <types.h>
#include <string.h>
#include <ctype.h>
#define char_lcd_write_str(a) char_lcd_write(a, strlen(a))
static uint8_t test_stage = 0;
static uint8_t test_stage_done = 0;
#if defined(RTC_ENABLE_PERIODIC_TASK)
void rtc_periodic_task(void)
{
test_stage++;
if (test_stage == 8)
test_stage = 0;
test_stage_done = 0;
}
#endif
#ifdef ENABLE_XBEE_HANDLE_RX
int xbee_transparent_rx(const wpan_envelope_t FAR *envelope, void FAR *context)
{
int c,k;
char addrbuf[ADDR64_STRING_LENGTH];
char_lcd_init(CHAR_LCD_CFG);
char_lcd_clear();
addr64_format(addrbuf, &envelope->ieee_address);
sys_watchdog_reset();
char_lcd_write_str(envelope->payload);
delay_ticks(HZ / 10);
return 0;
}
#endif
void main(void)
{
uint8_t i, j;
int data,l;
sys_hw_init();
sys_xbee_init();
sys_app_banner();
char_lcd_init(CHAR_LCD_CFG);
for (;;) {
if (!test_stage_done) {
switch (test_stage) {
case 0:
char_lcd_goto_xy(0, 0);
char_lcd_write_str("All working fine");
break;
}
test_stage_done = 1;
}
sys_watchdog_reset();
sys_xbee_tick();
}
}
pointers character display xbee lcd
pointers character display xbee lcd
edited Nov 19 at 18:12
user6910411
32.3k86693
32.3k86693
asked Nov 19 at 15:43
Muhammad Mustafa
85
85
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
The wpan_envelope_t
structure includes a payload length you can make use of.
uint16_t length = envelope->length;
uint16_t offset = 0;
while (offset < length) {
uint16_t write = length - offset;
if (write > 80) write = 80;
char_lcd_goto_xy(0, 0);
char_lcd_write(&envelope->payload[offset], write);
offset += write;
}
Note that this will look a bit odd since the end of your string will overlap the previously printed 80 characters. You would potentially want to write out enough spaces after the final char_lcd_write()
call to clear out that data (or add a special character to indicate the end of the message).
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The wpan_envelope_t
structure includes a payload length you can make use of.
uint16_t length = envelope->length;
uint16_t offset = 0;
while (offset < length) {
uint16_t write = length - offset;
if (write > 80) write = 80;
char_lcd_goto_xy(0, 0);
char_lcd_write(&envelope->payload[offset], write);
offset += write;
}
Note that this will look a bit odd since the end of your string will overlap the previously printed 80 characters. You would potentially want to write out enough spaces after the final char_lcd_write()
call to clear out that data (or add a special character to indicate the end of the message).
add a comment |
up vote
0
down vote
The wpan_envelope_t
structure includes a payload length you can make use of.
uint16_t length = envelope->length;
uint16_t offset = 0;
while (offset < length) {
uint16_t write = length - offset;
if (write > 80) write = 80;
char_lcd_goto_xy(0, 0);
char_lcd_write(&envelope->payload[offset], write);
offset += write;
}
Note that this will look a bit odd since the end of your string will overlap the previously printed 80 characters. You would potentially want to write out enough spaces after the final char_lcd_write()
call to clear out that data (or add a special character to indicate the end of the message).
add a comment |
up vote
0
down vote
up vote
0
down vote
The wpan_envelope_t
structure includes a payload length you can make use of.
uint16_t length = envelope->length;
uint16_t offset = 0;
while (offset < length) {
uint16_t write = length - offset;
if (write > 80) write = 80;
char_lcd_goto_xy(0, 0);
char_lcd_write(&envelope->payload[offset], write);
offset += write;
}
Note that this will look a bit odd since the end of your string will overlap the previously printed 80 characters. You would potentially want to write out enough spaces after the final char_lcd_write()
call to clear out that data (or add a special character to indicate the end of the message).
The wpan_envelope_t
structure includes a payload length you can make use of.
uint16_t length = envelope->length;
uint16_t offset = 0;
while (offset < length) {
uint16_t write = length - offset;
if (write > 80) write = 80;
char_lcd_goto_xy(0, 0);
char_lcd_write(&envelope->payload[offset], write);
offset += write;
}
Note that this will look a bit odd since the end of your string will overlap the previously printed 80 characters. You would potentially want to write out enough spaces after the final char_lcd_write()
call to clear out that data (or add a special character to indicate the end of the message).
answered 2 days ago
tomlogic
8,44022155
8,44022155
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378143%2fdisplay-of-characters-on-the-lcd-display-on-xbee-development-board%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown