Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Taking a journey with python3

  1. #11

    Re: Taking a journey with python3

    More hints, if the above does not work, then maybe time to add some diagnostics stuff to your code.

    Things like: Maybe have the Arbotix blink led once if it receives what you think is a valid packet and blink multiple times if it receives some invalid data.

    Or maybe have it echo the data back to you, and have your python code print out what data it received back (probably converted to Hex ascii text).

    If it were me, I would hook up logic Analyzer and actually look at the data...

  2. Re: Taking a journey with python3

    That hasnt made any difference either :/

  3. Re: Taking a journey with python3

    That hasnt made any difference :/

  4. Re: Taking a journey with python3

    I mean the LED that shows a connection flashes everytime i try to send so i think its getting there i just dont know whats wrong with what im sending. Ive also been printing stuff as my debug method and i wish i had a logic analyzer lol

  5. #15

    Re: Taking a journey with python3

    Again in all cases like this it would help if you actually show your complete programs and maybe pictures of hook up... As such that maybe someone can replicate your program...

    On my RPI3, I ran the following: $ python3 ./led_on.py

    Where led_on.py is:
    Code:
    #!/usr/bin/env python
    
    import serial
    port = '/dev/ttyUSB0'
    baud = 38400
    
    
    ser = serial.Serial(port, baud)
    ser.flushInput()
    ser.flushOutput()
    
    
    ser.write(b'0xff')
    ser.write(b'0xff')
    ser.write(b'0xfe')
    ser.write(b'0x04')
    ser.write(b'0x03')
    ser.write(b'0x19')
    ser.write(b'0x01')
    ser.write(b'0xe0')
    ser.flush()
    ser.close()
    I then looked at what was output, by simply hooking up my logic analyzer to the FTDI cable.

    Click image for larger version. 

Name:	screenshot.jpg 
Views:	13 
Size:	27.6 KB 
ID:	7113
    What you will see is the lines like: ser.write(b'0xff')
    Actually output the ASCII characters: 0xff
    Not the single byte value 0xff

    Hopefully @jwatte knows more here as I see you are on this thread

  6. #16

    Re: Taking a journey with python3

    You are providing strings to the write() function, so yes, it's writing strings.
    However, you have expressed the string constants wrong -- Python uses \x, not 0x, for escape characters.
    Instead, do this:
    Code:
    ser.write(b'\xff\xff\xfe\x04\x03\x19\x01\xe0')

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dan's ROS Journey
    By TXBDan in forum ROS - Robot Operating System
    Replies: 10
    Last Post: 08-26-2016, 12:52 PM
  2. Question(s) designing board - taking 3.3V from the OPEN CM9?
    By fabrice in forum Arbotix, Microcontrollers, Arduino
    Replies: 1
    Last Post: 04-28-2016, 01:24 PM
  3. Project Project BETH aka Dan's journey into a lot of things.
    By TXBDan in forum Humanoids, Walkers & Crawlers
    Replies: 32
    Last Post: 02-14-2014, 10:15 AM
  4. Big Congrats to lnxfergy for taking Gold on Mech Warfare!
    By DresnerRobotics in forum Mech Warfare
    Replies: 6
    Last Post: 06-16-2009, 11:07 PM
  5. News/Announcement Now taking Pre-Orders on the Bioloid Boomerang Zigbee Controller!
    By DresnerRobotics in forum Humanoids, Walkers & Crawlers
    Replies: 6
    Last Post: 10-25-2008, 10:51 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •