Shop OBEX P1 Docs P2 Docs Learn Events
BS2 Laser Scanner — Parallax Forums

BS2 Laser Scanner

ercoerco Posts: 20,256
edited 2017-01-13 22:21 in Robotics
Armed with my new high-tech Waveshare laser sensor, it was time to update my 6 year old BS1 scanner project.

Edit: Attached BS2 code, although servo values are hard-coded and will certainly require tweaking. YCMV.



832 x 981 - 233K
900 x 700 - 142K

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2017-01-13 21:17
    Very cool! Nice work, as usual! :nerd:
  • That is really cool, nice work!

  • You can't do that with a BS1. Fake News!

    Kiddin'. Great application.

    And why are you not on the Parallax payroll?....
  • ercoerco Posts: 20,256
    Thanks guys.
    Publison wrote: »
    And why are you not on the Parallax payroll?....

    I am getting paid, this is for SERVO magazine. Nice product placement, huh?

    Besides, Ken takes good care of all of us.
    Very cool! Nice work, as usual! :nerd:

    Too bad my high-visibility projects are all lasers & fire. If they were safer, Parallax would be welcome to distribute kits. :)



  • Publison wrote: »
    You can't do that with a BS1.

    Hard to believe isn't it, and people keep whining for more power and complexity.

    The BS1 and BS2 should be required study for anyone wanting to get into the robotics hobby.

    Erco keeps proving their merits and validity, in this crowded world of microcontroller choices.
  • ercoerco Posts: 20,256
    I'm sure a BS1 would work identically well, processor speed and program size are a good fit, the tiny BS2 code attached here would only fill 1/3 of the BS1 memory. The editor (IDE) supports both Stamps and has nice fullscreen DEBUG screens which work perfectly for this type of display.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    init:
    FOR B0=1 TO 15   '    move servos to top left
    PULSOUT 0,820    '    850=left   750=center 650=right
    PULSOUT 1,716    '    850=down   750=level  650=up
    PAUSE 20
    NEXT
    
    main:
    FOR W1=716 TO 760 STEP 2     'top to bottom
    FOR W0=820 TO 600 STEP 2     ' left to right
    IF W0<>820 THEN scan
    
    FOR B4=1 TO 7
    PULSOUT 0,W0:PULSOUT 1,W1    ' pause to transit left
    PAUSE 20
    NEXT
    
    scan:
    PULSOUT 0,W0:PULSOUT 1,W1    ' move
    PAUSE 10
    PULSOUT 0,W0:PULSOUT 1,W1    ' move
    IF IN15=0 THEN DEBUG " "
    IF IN15=1 THEN DEBUG "W"
    NEXT
    DEBUG CR
    NEXT
    

  • WhitWhit Posts: 4,191
    Amazing!
  • KeithEKeithE Posts: 957
    edited 2017-01-18 18:23
    erco - after I saw your post I ran across a reference to a fish-verifying machine which uses a laser to singe samples and release the magic fish smoke for analysis. Can you make one to attach to smartphones? ;-)

    https://www.ft.com/content/42985f40-f148-11e5-aff5-19b4e253664a
  • ercoerco Posts: 20,256
    Good call, but something smells fishy here. Verified.
Sign In or Register to comment.