Shop OBEX P1 Docs P2 Docs Learn Events
S2 on Sale for under $90 - Page 2 — Parallax Forums

S2 on Sale for under $90

2»

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-05 12:38
    Duane, 4.7µs is the RC time constant for the pullup, combined with the 1nF caps. It applies to the rise time only, since the output is not driven high. Since the output is driven low, the fall time will be much shorter. A smaller pullup, effected by adding another pullup in parallel, can shorten the rise time considerably, depending upon its value.

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-12-06 18:12
    @Phil, Thanks for explaining the RC stuff. You brought it back to the understanding side of my "edge of understanding".

    I incorrectly assumed if the Propeller could communicate with the Nordic device it could also use the Nordic device to communicate with other Propellers. It turns out I had to tweak the driver a bit more to get two Nordic devices to communicate with each other.

    I think it would be cool to use two of the $3 transceivers and a QuickStart board to made a radio controlled interface for the S2.

    As part of the interface, I'd like the QS board to display various S2 parameters with the Parallax Serial Terminal. I've figured out how to read the motor speeds, light sensor data, battery voltage and a few other parameters on the S2 but I don't see a way of retrieving the obstacle sensor data. All I can see if the ability to check if a certain threshold has been met.
    PUB obstacle(side, threshold)
      '' Return the value of the obstacle detection: `true = obstacle; `false = no obstacle.
      '' 
      '' `side (LEFT or RIGHT): Select the side to check.
      '' `threshold (0 - 100): Set the threshold of the  detection. At high threshold values,
      ''     only very close objects will be detected. At low values, farther objects (and possibly
      ''     the rolling surface itself) will be detected. If `threshold == 0 the default (or
      ''     calibration) threshold setting will be used. 
      ''
      '' `Example: obstacle_both := s2.obstacle(s2#LEFT, 0) and s2.obstacle(s2#RIGHT, 0)
      ''
      ''     Obstacle_both is set on left AND right obstacles, using the default sensitivity.
      ifnot (threshold)
        threshold := Obstacle_thld
      threshold := threshold #> 1 <# 100
      frqa := 14000 * threshold + 20607 * (100 - threshold)
      if (side == LEFT)
        ctra := %00100 << 26 | OBS_TX_LEFT
        dira[OBS_TX_LEFT]~~
      elseif (side == RIGHT)
        ctra := %00100 << 26 | OBS_TX_RIGHT
        dira[OBS_TX_RIGHT]~~
      waitcnt(cnt + 24000)
      result := ina[OBS_RX] == 0
      dira[OBS_TX_LEFT]~
      dira[OBS_TX_RIGHT]~
      ctra~
      waitcnt(cnt + clkfreq / 1000)
    
    

    I suppose a true or false obstacle indicator would be okay (like the cool "Observation Deck" has), but I'd prefer to be able to read the values of these sensors.

    I still don't understand much (okay, most) of the Propeller's counter features. Is there a way (and hopefully a hint or two how to do so) of having the above method return a numeric value rather than just TRUE or FALSE?

    I'd also like to be able to retrieve a number from the line sensors too.

    While I decided against preforming a level-shifterectomy, I did have to preform by-pass surgery on the S2. One of the wires, I had soldered directly to the Propeller chip's pins, pulled up (as in "ripped out" not "raised its voltage") the pin's solder pad. I had to use a piece of wire-wrap wire to reconnect the Propeller pin to the level shifter pin. The S2 seems to be recovering well.

    I've been having a lot of fun exploring the S2.spin object. Very cool stuff.

    The S2 is sure a lot of robot for $89 (it's even a lot of robot for $130).
Sign In or Register to comment.