Hi there Folks
Well, after several days of studying code and samples, I have conceded to the fact that I need help!
Here is a brief run down of what I am trying to do.
I have two ERFs connected to two O8M2 protoboards
I am trying to transmit a numerical value from one to the other and as I have connected a LED to indicate (DTR on the ERF) of transmit and receive I know that they are talking to each other successfully? as if I stop the TX, the LED on DTR stops flashing on the Receiver. I have tied the RX to Ground on the Receiver.
Also on the Receiver I have "serout " going to an OLED screen.
Now if I disable the Serin command line on the receiver code, the chip drives the screen successfully and displays the (output=35) It appears that this line is locking the code somehow? This is without transmitting anything or receiving, so I know the rest of the code is OK. I presume this stops all the code until it receives the correct data?
For some strange reason if I leave this line "SERIN. .. . . ." active, the screen just starts producing strange characters all over the place, I have tried different frequencies, so puzzled. .??
I cannot seem to capture data send and display it successfully. This is the main problem!
I have seen different code examples, some with the #, some without, some data in () some with preamble or "ABC" etc. ..So now stuck after 3 days of studying, hoping someone can point me on the right direction. .?
What I wish to do is simply transmit Numerical data from one ERF to another and display on the OLED!
Any Help would be appreciated.![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Tesla
Code below
Well, after several days of studying code and samples, I have conceded to the fact that I need help!
Here is a brief run down of what I am trying to do.
I have two ERFs connected to two O8M2 protoboards
I am trying to transmit a numerical value from one to the other and as I have connected a LED to indicate (DTR on the ERF) of transmit and receive I know that they are talking to each other successfully? as if I stop the TX, the LED on DTR stops flashing on the Receiver. I have tied the RX to Ground on the Receiver.
Also on the Receiver I have "serout " going to an OLED screen.
Now if I disable the Serin command line on the receiver code, the chip drives the screen successfully and displays the (output=35) It appears that this line is locking the code somehow? This is without transmitting anything or receiving, so I know the rest of the code is OK. I presume this stops all the code until it receives the correct data?
For some strange reason if I leave this line "SERIN. .. . . ." active, the screen just starts producing strange characters all over the place, I have tried different frequencies, so puzzled. .??
I cannot seem to capture data send and display it successfully. This is the main problem!
I have seen different code examples, some with the #, some without, some data in () some with preamble or "ABC" etc. ..So now stuck after 3 days of studying, hoping someone can point me on the right direction. .?
What I wish to do is simply transmit Numerical data from one ERF to another and display on the OLED!
Any Help would be appreciated.
Tesla
Code below
Code:
'Transmit from one pixaxe to another NOTE this is using transmits the number 5
init: low C.0
pause 1000
'seeded value
main: Setfreq M16
serout C.0, N9600_16, (#5,"X") ' x tells the reciever its finished with numerics?
Low C.0 'might mean that it stops sending?
pause 1000
goto main
'RECIEVER Via ERF
'#picaxe 8M2
#terminal 9600
init: 'LOW C.0 ' C.0 port that sends serial out
pause 100
'MOTE THE SERIN line below must recieve data or program cannot proceed
'Receiver Code and output to screen
symbol AR = b6
AR = 35
symbol BR = b7
main: Setfreq M16
pause 100
serin C.5, T9600_16,b6 ' NO "#",captures data from serial in pin 2 (C.5) from RF reciever
'======================================================================
' OUTPUT TO OLED SCREEN
'======================================================================
Setfreq M4 'set frequency for screen out to 4 Mhz so that baud is 2400, if left at 16mhz it defaults to 9600
pause 100
serout C.0, N2400, (254,1) 'clear screen
pause 200
serout C.0, N2400, (254,128) ' move to postion 1 line 1
pause 200
serout C.0, N2400, ("output = ",#AR,CR,LF) 'send value w1 to screen
goto main