Author |
Message |
2001cpx
Regular Member
Joined: 03/10/2013 Location: CanadaPosts: 59 |
Posted: 12:19pm 13 Nov 2013 |
Copy link to clipboard |
Print this post |
|
Hi,
Try to find Doc,Tips,or in forum,How i can send Hex Char EX
7E00192000C0A80166261626160000AAAAAAAAAAAAAAAAAAAAAAAAAAF6
Working on Xbee (APIMODE) receive is Ok
like this
SerialInt:
Print @(130,105) + CLR$(GREEN) "Receiving "
flag2 = 0
DO WHILE INPUT$(1, #1) <> CHR$(&H7E) : LOOP
a$=""
for i = 0 to 33
A$(i)=Input$(1, #1)
if A$(i) = chr$(&H2A) then exit for
if i = 33 then flag2 = 1
next i
flag1 = 1
IReturn
tried many thing with no chance
Thanks in advance!!!
i like MMbasic!!!
(i'm on CGcolormax2)
i don't know how to send hex,all the time before sended as is ASCII
"Color Maximite,(Duinomite-Mega,Mini),CGmmStick,GCmicroboard2b,Micromite + explore 64,100,LCD backpack,Lcd Backpack V2,TFT Backpack,Micromite Extreme,Armmite L,F,H,CMM2" |
|
2001cpx
Regular Member
Joined: 03/10/2013 Location: CanadaPosts: 59 |
Posted: 07:30pm 13 Nov 2013 |
Copy link to clipboard |
Print this post |
|
Here it's a way i found to send this:
String to Wifi Xbee API Mode
7E 00 0D 20 00 C0 A8 01 66 26 16 26 16 00 00 AA EE
and with this work
print #1 , CHR$(&h7e);chr$(&h00);chr$(&h0D);chr$(&h20);chr$(&h00);chr$( &hC0);chr$(&hA8);chr$(&h01);chr$(&h66);chr$(&h26);chr$(&h16) ;chr$(&h26);chr$(&h16);chr$(&h00);chr$(&h00);chr$(&hAA);chr$ (&hEE)
normal it's what i want (HEX)format
there is other way to construct a string and send without this ugly string?,non workable.
tried qbsic forum etc,no luck about construct,send etc to comport (hex)
semi colon is to not send CRLF,but if it's sended after the crc check (EE) not interact,as many chars you can shoot(tested)
"Color Maximite,(Duinomite-Mega,Mini),CGmmStick,GCmicroboard2b,Micromite + explore 64,100,LCD backpack,Lcd Backpack V2,TFT Backpack,Micromite Extreme,Armmite L,F,H,CMM2" |
|
panky
Guru
Joined: 02/10/2012 Location: AustraliaPosts: 1101 |
Posted: 09:07pm 13 Nov 2013 |
Copy link to clipboard |
Print this post |
|
Hi 2001cpx,
With respect, it is very hard to offer you assistance as you have not described what you are trying to do very well.
Maybe some questions may help the forum:
1. Are you trying to send a sequence of byte values from a Maximite to another device via a serial port on the Maximite?
2. Am I correct in assuming that some of the characters are non-printable? For example hex EE
3. Are you waiting for some keyboard input on the Maximite before sending hex data out the serial port?
4. Is the data you are sending out the serial port of the Maximite always the same string or does it vary?
A couple of observations - it is not good programming practise to put a do loop inside an interrupt service routine.
Another way may be to put the data to be sent into an array then output it with a loop indexing through the array?
Regards, Panky.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
|
2001cpx
Regular Member
Joined: 03/10/2013 Location: CanadaPosts: 59 |
Posted: 03:57am 14 Nov 2013 |
Copy link to clipboard |
Print this post |
|
Hi Panky,
thanks for your Reply,
1- yes i'm tying to send via Maximite Hex chars to Xbee Wifi (API mode need to be in HEX) like this : 7E000D2000C0A80166261626160000AAEE
2- Yes Some Chars are not printable
3- To receive Hex chars and convert them. is't not a problem,in my interrupt,no problem
was found,work great.
4-No,I need to Put Different Data inside like C0A80166 ,is 192.168.1.102 For exemple,and some other parameter,and also need to calculated final string to add checksum,i make this with Proton Basic with no Problem,i working with Xbee For over 10 years(before maxstream),But, i can possibly live with already made String,not ideal,i need more than fifty.
5- thanks for observation about the loop inside an Interrupt,i will modify this and
make data in array,sure is better,i will do this.
my problem for now,is to send hex chars to Xbee,tried transparent mode(ASCII), i like more API,very robust,and easy to route DAta etc.
i,m new with basic(learned before 30 years agoes...and i.m very rusty
thanks!!
"Color Maximite,(Duinomite-Mega,Mini),CGmmStick,GCmicroboard2b,Micromite + explore 64,100,LCD backpack,Lcd Backpack V2,TFT Backpack,Micromite Extreme,Armmite L,F,H,CMM2" |
|