XBee Test Sketch

181214KA

Hello again!

Here’s the premise: you hit key on keyboard, robot moves in requested direction.

I initially wanted to use the up/down/right/left arrows on they keyboard to control the robot, but those don’t “send” as commands through XTCU, which is the program I’m using to control the XBee hooked up to the computer (thus, the keyboard). So, I’ve opted to use i/k/j/l, respectively, instead (I’m right handed). (Tip: keep track of caps-lock).

Continue reading “XBee Test Sketch”

XBee Setup

181214KA

Hello!

I’m working with  2 Series 1 actual-antenna XBees and an Arduino MEGA + MEGA sensor shield.

I’ve worked with XBees before, so I was leaning towards using them… but I wasn’t really sure if I’d be able to send packets of data, and received  suggestions to look into something less long-distance for my applications. Turns out it is possible to send packets with XBees! I talked to a couple of people about suggestions for the long-distance thing, and it didn’t seem too big a deal–XBees can be easily programmed to communicate on a different channel, and there are a huge range of options. More on setting up XBees here. I’ve set up the ones I’m using so both can send + receive.

Continue reading “XBee Setup”

Final Roomba Code

181114KA

Hello!

The first goal in this project was to get the neurorobot_reboot to perform a simple autonomous “Roomba” function, ie. move around without bumping into anything. I accomplished this more or less successfully, so the code is pasted in below. One of the main issues is that I hard-coded in timings, so as the battery depletes, the code works less-well; currently (hehe), I’m looking into using motor encoders to solve this problem.

Here’s a video file of it working (will download): 181114KA_NeuralRobot_Progression

Edit 190122KA:  and here’s a document I just typed up that quickly runs over different parts of the code: A Quick Rundown of Roomba

Continue reading “Final Roomba Code”

Simple Ultrasonic Sensor Code

181019KA

Hello!

As a note, I’m using the HC-SR04 Ultrasonic sensors; they’ve got a VIN, GND, TRIG, and ECHO pins. Also, the sensors instantiated here definitely have incorrect pin values… I’ve changed them plenty of times since this code was written, and likely will continue to as this project evolves haha :). Here it is:

Continue reading “Simple Ultrasonic Sensor Code”

Simple Motor Code (useful for debugging)

181017KA

Hellooooo

This actually took a while to get to (had to rebuild and learn some coolio things) but here’s the tested simple-motor-code. It essentially sets motor speed based on what you type into the Serial Monitor… pretty sweet until I realized I wasn’t going to need that function lol.

Continue reading “Simple Motor Code (useful for debugging)”

Original NeuroRobot Code

Good day!

This is the original code that I inherited, and that I’ve been using as a reference as I write code for the neurorobot_reboot. In particular, I really wanted to simplify, simplify, simplify, and use shorter (clearer) variables along with comments so the code as a whole is easier to understand. I hadn’t really done much fancy stuff beyond methods before, though, so inheriting this has taught me some cool new techniques, like how to create classes in Arduino. 😀

So I’m just going to paste it in…

Continue reading “Original NeuroRobot Code”