top of page
Search
  • ncampanelli0

midterm (rc car to bluetooth)

Updated: Oct 16, 2019

Original post (October 15, 1:40am):


The first thing I did was start writing a program to work with the project I had in mind before I even started anything with the hardware. The concept was to make a text based adventure game. I realized I didn't have any way to display a large amount of text so this was changed to a speech based adventure game as I found a library that allowed for speech to be used. I had yet another problem when I realized the microbit's memory is rather quite limited.

The next thing I did was write a program to control motor's via a program with bluetooth. At the time of writing the code I did not have the parts I needed so in the place of events I used stubs to fill in for things I could not work with.


I had a big surprise, Python takes up more memory then JavaScript. The entire code was scrapped and rewritten in JavaScript as the memory was needed for running bluetooth (code 1). Code 1 did not work no matter what I tried.

Frustrated, starting from scratch I wrote an entirely new program, this time all the hardware I needed was finally in my hands (remote control car, kitronik, screwdriver, microbit, wire stripper, wire cutter and phone). I looked at the kitronik and noted that the different connections were labelled in the format of pin#. I wrote a code that is based on switching power on and off to the different wired connections (code 2). I had quite a lot of trouble with getting bluetooth connected and even after getting it connected, it is quite finicky to connect every time I reset the microbit (requires me to in order and every single time I change something, unpair the devices, turn off bluetooth on my phone, turn off the app I am working with fully, reset the microbit, turn on microbit's bluetooth, turn on my phone's bluetooth, reconnect the devices, open up the app and finally reconnect the devices via the app which has about a 50% chance of working and on failure requires a repeat of the entire process). After all that, I still couldn't get anything to work, except a show string i added for debugging purposes which indicates that the microbit is indeed connected to bluetooth.


Code 3, this was a quick code made with info I found on the app itself under the help section. I had a lot of hope that this would work and no longer cared about trying to go left or right, just forward (If I can get one working adapting the logic for the other directions shouldn't be to far off). There isn't much to say here, I wish I could say I got it to work but I can't. The only thing I can think of is I've done the wiring incorrectly or broke something internally and don't realize it.


As far as the hardware side of things go I pulled apart an rc car, clipped the wires off the control board and attached them to the kitronik (it is a sodorless control board designed to interface with a microbit). The way I wired was by stripping the plastic off the wires of the rc car, placing them into the kitronik and screwing the metal connection tight on top of each of the connections I wanted to make.


side note (in case this is being read prior to class): images will be added before class (October 15) and possibly some more text as I will be making a final attempt at this before class.

link to codes (the start of each code is denoted by //code #, they have to be copy and pasted to makecode in order to generate a .hex file and thus were kept in one file for convenience): https://repl.it/@ncampanelli0/midterm-ccag


Edit (October 15, 3:20pm):


I can't upload my pictures from my phone to Wix directly (I just get a screen telling me to go to a browser on a computer regardless of accessing from the web or the official app) and I don't have a wire to connect my phone to the school computer I am working on. When I get home (around 8:00pm) I will upload the images as I will have a wire to connect my phone to the computer.


I still can't get the rc car to work, however I did find one more problem (I think). The switch to turn the rc car on and off was set to off. I am unsure if that was one such problem because to me it stands to reason that would cut the power off from where the batteries would normally be and more importantly flicking the switch and retesting everything yielded the same results. In this case power is coming through the microbit into the kitronik, not the originally intended location of the batteries. At this point I am debating if the issue is having fried something, having cut something I shouldn't have without realizing it or wiring something up incorrectly thinking it's correct (my thoughts are more towards having cut something by accident). I don't believe it's an issue with the code as I have gone over the codes several times manually and no compile errors either.




14 views0 comments

Recent Posts

See All

Final assignment (trivia project)

How I came to this idea for a project was simple. Back when I was in high school I made a trivia style game. This game was written for Windows Command Line (.bat file). The original program was quite

Assignment 9 (drawing program)

I made a drawing program with multiple colors that can be selected (with black being used as the eraser color as the background is black). I used an array to keep track of all the colors and used a fo

Assignment 8 (bug fixes)

change log: 1. Revised collision for ball to bounce off paddles properly (instead of requiring perfect pixel alignment with a sweet spot, which was the original collision detection. I figured out it w

bottom of page