Unit 2 (S) Reflection

`This unit was really fast-paced, unlike unit one, or even last term in the intro to programming the things we learned didn’t require us to pick it up as quickly. This unit, especially with the shaft encoders was very fast paced, we learned it, and applied it almost instantly. Though it was shaft encoders are new to us it did prove useful in this project. For this project we had to create code to that would allow the robot to complete a course set up in the robotics room. We must go along the white tape, and if by chance the robot went off course and wasn’t in the region of the tape it would DQ. Though this task may sound easy and simple it was quite the opposite. So I had two partners in this projects because I had a track meet, so my original partner had to partner up with someone else while I was running. That being said, both of my partners identified challenges in the course, one being the turn degrees, meaning when the robot would stop and turn. The course wasn’t linear so each turn would have a different degree in which the robot needed to turn. The second problem we identified was the actual, we weren’t sure whether to code in shaft encoders or to go for a very basic route. The third problem was where to start the robot. And the last problem we faced was the robot going off course. The course where the robot had to go through was not straight so nine out of ten times the car would go off course. This meant the code to straighten the robot would not work. This proved a definite issue because it meant we kept going off course and having to DQ. The reason why turning the robot was very difficult was because each turn needed to turn in a different degree non was the same and quite a few of the turns were sharp so it this proved to be very annoying more than difficult. This goes same with how far the robot had to go. This was part of the reason which direction to code the robot was hard, both my partner and I weren’t very familiar with shaft encoders but we both really wanted to use it. So at the beginning of the project for maybe a little less than two class periods we were coding in shaft encoders, however like I said we weren’t too familiar with this way of coding so it took a long time. During the second class period we changed and choose to approach it much more basic, and then once we were able to make sense of the course we would come back coding in shaft encoders. A problem that I didn’t mention was an external problem in the form of the scarce amounts of robots. We would code the robot and not have a robot to test our code in. So to tackle the problem, we would test our code in virtual worlds where we were looking in the robot went along the line of the course. Though this was a solution it was not a permanent one, a lot of the time we had trouble with the measurements. The course in virtual worlds is smaller than the actual one so we weren’t able to see the whole function and most of the time we only saw half of it or a third of the function we had coded. I would in the future like to see a course where there is a big space for the robot to roam freely. I would also like the course to have barriers so the robot would not drop out. Maybe there is already a course like this, I wasn’t looking too closely, however, the few layouts I did use were in a rectangle shape so when the robot turned it would always fall out because it is too narrow. Another external problem I had with the robot is that it didn’t have a battery. The was also a lack of battery packs for the robot, and I guess our class was right before the other robotics class so when we plugged of the robot in it didn’t move because there wasn’t any battery. When we went to change the battery pack, we had the same problem again. So we had to share the robot with another group, where we spent more time re-hooking the robot than the actual testing phase. We decided to use the robot wirelessly because of the face a problem where the robot for some reason would always roll over the A to A cable. And also it proved clumsy having to walk around attached to the robot. I wasn’t able to complete the challenge, because I had to miss a few valuable classes to attend other things. I believe we had around five to six classes to work on this project, and I had to miss two of them due to a track event where we were running against other international schools. This was the issfhk finals so this would be the last run of our league. And the other time I missed class was due to a really bad cold, where I felt dizzy and had a very high fever. These classes were sadly the third last class and the last class of the project. I do however believe my partner was able to complete the course. This project was quite similar to the first unit where we completed courses in the virtual world except a lot harder. This was a nice way to look back at our learning, even though we were doing the same thing we had done in the first unit we had learned new things to help us complete the task, such as shaft encoders, being able to straighten the robot, functions such as while loops, void, if statement and finally having a better understanding of how virtual worlds works. This was a very good representation of what we learned. What I learned from this project is that I wasted too much time by not thinking about what to do. I should have spent time thinking about how I was going to approach the project instead of running into the project head first. And the last thing I learned which is along the line of planning it out is to not underestimate the challenge. If I had planned it out I wouldn’t have faced this problem, but I thought the challenge was quite easy I would have quite a long time to finish it but evidently, I didn’t. Unit 2 has to do a lot with the fundamentals, so this means a lot of functions. I am eager for the next project because I know that I will do a lot better knowing what I know now.

Course Track



Function RobotC

So we today we learned about functions

______ (Function name) = (t)

run1m (t) (how to run functions)

Count statements     =   int count = 0 (Set count to 0 to make it more accurate)

int = integer

at the end write count = count+1 (Add count)

To run write at the buttom task main()

{Function name




Shaft Encoder Notes

Shaft Encoder: A digital system that measures the amount of rotation on the axle which passes through the sensor.

-The number of count for one rotation is 360

  • One rotation is around 29-30 cm
  • The box measurements are
    • 126 = 4.26 (revolutions)
    • 147 = 4.98 (revolutions)
    • 131 = 4.44 (revolutions)
    • 150 = 5.08 (revolutions)

-You do not need to touch the Pragma statement

-Sensors names can be named whatever you want as long as it

  1. Doesn’t contain any spaces
  2. No special names such as $, %, &
  3. Not already used by ROBOTC

-Must be plugged into any adjacent DIGITAL ports

  1. Go to motors and sensors setup
  2. Name the dgtl
  3. Select quadratic encoder

-Always clear the encoder values by setting it to zero, this way the encoder can accurately move a certain distance

-The while loop command is used to control when the loop should end and the body of the code that is loop

  • The main purpose of the while loops  > (less than) is that the robot will continue to count until it counts to whatever number you told it to go
  • It checks the condition before it runs the code between the curly braces and then checks it again after each time it runs the code between the curly braces.

Sensor debug window

  • Provides real-time information on the values of all the sensors configured on the robot
  • ROBOTC must have a connection with the robot for the sensor debug window to work, it is the only way to communicate with the computer

-There is no way to change the distance of the robot travels other than changing the number of counts on the encoder








Roboitcs(S)- Unit 1 Reflection

The question we dealt with on the first day of Robotics was, ‘What is a robot?’ ‘Define what a robot is?’ ‘To you what makes a robot a robot?’ Though at first these questions seemed trivial, as soon as we got into the actual discussion of a ‘robot’ it proved necessary. We would later have a presentation on ‘robots.’ The results varied from each person, some people thought a pencil was a robot, something that had no mechanical parts, something that couldn’t be coded a robot. Another one of my classmates presented an idea of a robot that used no electricity. While others had a more streamlined/linear answer, ‘Anything that was AI.’ This once trivial question, `What is a robot?’ Proved to be a much more philosophical one at that. In our first project, we had to make our own Hebocon tournament. For this task, we needed to make a robot from parts we scavaged around our house, to create a robot that was able to fight and be extremely ugly at the same time. So when we had this hebcon tournament, people strayed away from the normal race cars and had boxes instead. Boxes would prove to be much more dominant. While boxes may seem to not be robots, we defined a robot in the first lesson as something that had an input and an output. Something that could be programmed. And something that had a purpose. These boxes would fill out these categories. It has an input and an output, putting things in the box, taking those things out. It is programmed to carry things, which is also the purpose of it. To be able to carry multiple things. This unit, I have finally been able to answer a once futile question, that changed to a more philosophical one. A robot is a shaky definition, just like in biology what we perceive as ‘living’ changes depending on the person, that being said, to be a robot is something that has an input and an output. It needs to have a purpose, whether it be important, or futile. And it must follow the asiimovs three robotic law which I will explain later.So this unit we learned about robots, however, I had some underlying questions to be answered. Why people fear robots? Which was answered when we watched a movie about a scape robot that left a facility and was malfunctioning. This robot, highly armed, roamed the streets of America, though he didn’t do anything the fear of a robot uprising is on our conscious lingering in the back of our minds. With the help of miss Mok, I am fully confident in answering the question about what makes a robot a robot? What must it do to be classified as a robot? And with the help of my classmates, I have a much better understanding of the nick and gears of robots. From things like wired (a fantastic tech website that answers a lot of questions) to movies that helped my grasp on robotics, I am pretty confident that I can answer most questions will confidence. Compared to last semesters, intro to programming this is a much more friendly environment. Last semester we had to have people didn’t speak up as much, which can be attributed to the large class we had. While in this class we have a few fewer people, but we have a much friendlier dynamic. People in this classroom aren’t afraid to talk, and we as a class sit as a group instead of individual students. In seminar class, I learned that we become ‘brave’ when people such as us are in a group. While if we are isolated we prefer to sit down and be quiet. To not speak up. However with this new classroom dynamic, I am not afraid to speak up, rather I am ‘braver’ and I am willing to speak up. I feel as if my understanding is much ‘deeper.’ This classrooms environment is very open, just look at the windows outside, they are very tall and people from the outside can look and watch. In humanities, I learned that we adapt to our surrounding, if our school is messy and full of trash then our view of ourselves is trashy and messy. Everywhere you look in this classroom it would shout out ‘open,’ and in turn out approach to this class is much more open. This mindset is key to a better and happier learning. So if i had to change anything it would be to have a more open dynamic in order to feed the stigma of an open mind. These laws were 1. A robot may not injure a human being or, through inaction, allow a human being to come to harm. 2. A robot must obey orders given it by human beings except where such orders would conflict with the First Law. 3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law. Having said all of this, I do believe the robotic laws are a bit more outdated, I wouldn’t change the first law which is, A robot may not injure a human being or, through inaction, allow a human being to come to harm. Rather I would change the second and third law. I would change it to more acceptable, ‘must have an off switch,’ and it must ‘obey the programmer unless it violates the first two laws.’ Now you might say, “This we already have weapons that we call robots to kill people. And now I say, robots that kill, and robots that help are two different things. Though hard to distinguish, they are inherently not the same. These robots that kill tarnish the good name of other robots. I also would like an off button as having one would make sure that people ‘fear’ of a robot uprising would go down. In humanities, we learned about America’s fear of communism. This lead to a cold war, though no one died to was a heated war. America is built on the illusion of fear, no matter how dire, or how unscary it is. America has to have a say. If America, the strongest power in the world, do fear something like an intelligent robot, then we will have a war on our hands. And this won’t be a war just with America and robots, it will be war including the nations who have signed the doctrine with America to fight with them as allies. In all, it would be paramount to have a robot with an off button. Lastly, it must obey the programmer, if a robot doesn’t do what it is set on to do, then it is a disaster, and that could lead to something atrophic.

Hebocon (F)

What is a Hebocon?

A Hebocon is first off, a robot, but more then anything else it has to be ugly.

What parts did you build your Hebocon with? Did you make any improvements to it outside of class?

I didn’t add any improvement outside of class, however, I did add a ‘unicorn horn’ to add some character to my robot.

What worked? and what didn’t work?

Well, I removed all the batteries to the skateboard so that the robot would be lighter and in turn can push this a lot further and faster.

What would you change next time?

Next time I would change my robot completely, as it seemed the bigger robots had more success.

Include an image and a short video to help the audience visuallise the event.

Thursday 18th January – Cover lesson

In today’s class, we watched the first 40 mins of the Short Circuit! This movie gave us an inside look at what would happen if the world had a fully aware robot able to chart EQ. This movie is a good representation of how our world is run by technology.

Quiz: 9/10

Well in today’s day in age technology is so advanced that we program it for minimal tasks such as opening a drawer or shuffling cards, that being said I would have a robot that would do my homework. As a kid this was a dream of mine, it posed too many positives for someone to not create. If someone did create such a robot I wouldn’t have to worry about doing homework such as Chinese that would normally take hours.

So in the movie above a robot does what a robot is programmed, it does not possess a testable EQ. Therefore it would need to have a processor that is able to input ‘inputs’ and ‘outputs.’ This homework robot would probably also need to have a camera so that it can analyze the problems to answer them.

Final Project (S)


So for our final project, we wanted decided to make a taxi calculator. I sporadically see my self-questioning if I have enough money to pay for the taxi and still have leftover money for food. With this taxi calculator, it can finally answer the question of how much it will cost for a certain distance covered by the taxi. My partner and I will be using python to code this taxi calculator program. Taxis in Hong Kong is very easy to access and is extremely helpful if you want to go certain places in hong kong. However, before all of this, we used our knowledge with design thinking and learned that this app needs to be tailored to the user, and not the programmer. We created ten questions that will give us a good first step into how to code this. With these questions, we were able to better understand the user’s needs and how to meet them as programmers.

  1. Do you use Taxis often?
  2. Do you like Taxis?
  3. Would you want a taxi calculator?
  4. Do you prefer taxis or other forms of public transport?
  5. Would you want your measurements to be in meters (M) or Kilometers (KM)
  6. Do you like math?
  7. Do you use the red, blue, or green taxis more often?
  8. Would you want to know beforehand how much your taxi costs?
  9. Do you feel that taxi’s sometimes overcharged you?
  10. How would you like the interface to work?

Psuedo Code and Flow Chart 

So when making our pseudocode and flowchart we tried to tailor it to the user’s needs. The questions above really helped make the flowchart extremely easy, because we knew exactly what the user’s wanted and needed. With the 20 responses we got, most of them wanted a clear, precise, and wanted it to get to the point.

pseudo code

  1. Ask for current location (if there is no way to sense the user’s location)
  2. Ask for destination
  3. Ask which taxi to use (red, green, blue)
  4. Calculate price
  5. Display Price

Flow Chart

Design Thinking Sentence

This is targetted to people who use taxi’s regularly but want to know the price of the taxi beforehand.



import math
def RedTaxiCounter(meters):
    if meters <= 2000:
        return (24)

def BlueTaxiCounter(meters):
    if meters <= 2000:
        return (18.5)

def GreenTaxiCounter(meters):
    if meters <= 2000:
        return (17)
while math:
    choice = input('what color taxi are you taking today?'
          '1 = red'
          '2 = blue'
          '3 = green')
    if choice == '1':
        global meter
        length=float(input("How long was your trip in km?"))
        print('The price of your taxi will be around')
        print ("$" + str(RedTaxiCounter(length)))
    if choice == '2':
        global meter
        length=float(input("How long was your trip in km?"))
        print('The price of your taxi will be around')
        print ("$" + str(BlueTaxiCounter(length)))
    if choice == '3':
        global meter
        length=float(input("How long was your trip in km?"))
        print('The price of your taxi will be around')
        print ("$" + str(GreenTaxiCounter(length)))
        print('Try again')


from tkinter import *
from tkinter import ttk

root = Tk()

frame = Frame(root)

labelText = StringVar()

def Text():
    print("Micah is fat")

label = Label(frame, text="Welcome to the Taxi Program!")
Calculate = Button(frame, text="Calculate Fare", command= Text)
RedTaxi= Button(frame, text="Red Taxi", fg="orange red")
BlueTaxi= Button(frame, text="Blue Taxi", fg="navy")
GreenTaxi= Button(frame, text="Green Taxi", fg="forest green")
Quit= Button(frame, text="Quit", command=quit)



This project has really propelled my understanding of python, in this project I was able to use functions, if statements, and while loops. Compared to my first project I where I only used If and while loops. I can now use functions easily, in addition, able to use global functions, and now import maths.

Makey Makey with Balance Board Challenge

So for this project, we were meant to code from scratch first, and by using the basis from scratch we would code to it back to pycharm either using Tkinter or pygame. In short, my partner and I were not able to complete this task as it proved much too difficult. Even so, we learned valuable lessons on the way. Even though we rarely use this form of block coding, its efficacy was known, scratch really helps when you are trying to get your thoughts down on paper. Instead of having to code it all and spending hours to see if it works, scratch is a much easier way to code and it very straightforward. Once your scratch code works, you can use that as your pseudo code.



As I said before we weren’t able to code it into python, but I gained new knowledge. The first is what GUI is, it stands for Graphical User Interface, basically, it lets creates the image that the coder needs it to show. This will prove important later on in the future as its instead of just texts showing up I can have an image show up on my screen. And just like the block codes above, you can assign certain functions to certain keyboard sequences.