Shop OBEX P1 Docs P2 Docs Learn Events
Sensors readings in variables — Parallax Forums

Sensors readings in variables

GiaGia Posts: 6
edited 2012-02-21 22:25 in Robotics
Hi,

I'd like to buy Scribbler 2 for my 11 year old son.
I played a little with GUI. Maybe I missed something,
but is it possible to keep the robot's sensors readings in
some kind of variables for later reference and decision
making with GUI.

I suppose with PBASIC probably it is possible.

For kids it takes time to start programing directly in PBASIC without GUI.

Regards,

gia

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-02-21 07:06
    I haven't used the GUI a lot with the Scribbler 2 but I don't think you'd use a number value for your sensor reading, instead you'd set a flag if the reading was above or below some threshold.

    Some of the sensors (line following sensors) don't have a number value to use even in when using Spin to program the bot. Many of the sensors do have numbers associated with them but I dont' know if you can access these values (other than above or below some threshold) with the GUI.

    The Scribbler 2 does not use PBASIC as a programming option. It would probably be easiest to use Spin if you wanted to take advantage of all the features of the S2.spin object (sub program). I think 11 is probably old enough to learn to program in Spin.

    And you or your son are always welcome to ask questions here or in the Propeller forum if Spin is presenting a challenge.

    Edit: When you order a S2 don't order a Ping sensor. The Ping does not work with the S2 (at least mine doesn't). I used a Maxbotix ultrasound sensor with my S2. Here's a link to the thread.

    Edit Again: I mainly use the GUI to program sounds for the S2. After creating the sound I want with the GUI, I use the "show code" feature and cut the code that produces the sounds from the GUI generated program and paste the code into my "typed in" program.
  • GiaGia Posts: 6
    edited 2012-02-21 07:28
    Thank you Duane.
    I am completely newbie for robotics.
    I have some software programming background.
    As I understand Scribbler can make a real-time
    decision with sensors but can it learn something
    and keep some knowledge.
    I think to use 'variables' for this purpose.
    Regards
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-02-21 07:44
    On the S2 downloads page there is a link to a video of Jessica's "S2 Messenger Robots" video. Five minutes into the video she uses the GUI "Flags" to remember which way the robot had turned. This is the only example of the S2 remembering "variables" with the GUI I can think of. Again, I'm not a GUI expert. I found it much easier to program the S2 in Spin.

    With Spin you can add lots of variables to keep track of. The S2 also has some additional EEPROM where data can be stored that will be retained when the S2 is turned off. It's also possible to have the variable values stored in EEPROM so they retain their previous values when the S2 is turn off and back on.
  • GiaGia Posts: 6
    edited 2012-02-21 22:25
    Thank you for useful information.
Sign In or Register to comment.