Adding Distance Sensors and Radio

To keep each robot from running into each other and off the canvas we are using distance sensors. The code for it is actually pretty simple and yields this outcome:

Since this pretty much works, I then add in my code for the pattern and make it flash red when the sensor is set off. This is the result:


Now to add in the radio. For the robot I set the channel that the radio is going over and I determined what would happen if the remote were to send “HelloHello” over channel 56.

Screen Shot 2018-12-09 at 1.12.03 PM

As for the code on the remote. I set the channel to 56 and made it send the string “HelloHello” when button A is pressed.

Screen Shot 2018-12-09 at 1.12.35 PM

Here are the results when testing out the radio part of the code. (1).gif

We plan to use the radio to control the direction of the robot in a more creative way than just pressing a button.

Well, that’s it for now!

-Arva Syed



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.