Shop OBEX P1 Docs P2 Docs Learn Events
Back at it, again! — Parallax Forums

Back at it, again!

So, I got my new P2 setup, connected to mi RPi 4, and I am having a hard time talking to the RPi 4.
My P2 is the 32MB, version, not sure how flexbasic will be able to handle that, but that is another discussion.

The main problem is getting the P2 setup to talk to the RPi 4. I tried FullDuplexSerial, jm_fullduplexserial, ... etc, and none seem to work. Not sure what my proplem is. I have the latest flexprop version setup on the RPi 4.

This should be a simple and straight forward setup, but it is turning out to be something else. I hope programming skils have deteriorated over the last few months.

Ray

'' m2_sta.bas
'' Nov 18, 2023
'' Controller between RPi 4 and Prop WX board.


dim rpi4 as class using "spin/SmartSerial.spin"
''         Rx,Tx,  BAUD
rpi4.startx(63,62,0,115_200)
open SendRecvDevice(@rpi4.tx,@rpi4.rx) as #3


'' Variables
dim inBuff as string

print "Type help for menu."
print ""
print ""

'' Main sub

do
    print "> ";
    input inBuff
    if inBuff = "quit" then
        exit
    else if inBuff = "help" then
        menu()
    else if inBuff = "sendx" then
        do
            print #3, "A"  '' Opens local terminal and prints "A", not to rpi4
            ''rpi4.tx("A") '' Same thing here.
            pausems 4000
        loop
    else
        print "??"
    end if

loop

print "Program Ended!"
print "0"
_reboot
end

'' End of Main ''
'''''''''''''''''''''''''

'' Subroutines ''
sub menu()
    print "          Menu"
    print "help - Show the Menu"
    print "quit - End the program."
end sub
''''''''''


'' End of Subroutines ''
'''''''''''''''''''''''''

Comments

  • Wait, you're trying to open a SmartSerial object on pins 62/63 while also using the flexbasic print statement that uses the same pins? What are you trying to achieve with that?

Sign In or Register to comment.