Introduction
Blank space
Attempt
During my freshman year, I remember participating in a college competition, which was my first exposure to programming concepts.
The competition involved using programmable building blocks and toys provided by the laboratory to create a project. It was somewhat similar to the concept of Mi Bunny Robot, except it was much earlier.
I built a smart car that could follow black tape tracks on the ground and perform corresponding actions. It had the following three functions:
- Following a single line of tape on the ground. This function was implemented using two infrared sensors.
- When encountering obstacles, it could bypass them according to pre-agreed actions. This was implemented with an infrared sensor.
- It could grab ping pong balls from the ground using a claw. This was driven by a motor.
I remember the programming interface was a graphical one, where you could drag different rectangles representing program bodies. Then you used connecting lines to indicate state transitions. After writing the code, it needed to be transmitted to the programmable blocks via an infrared device. The infrared transmission device looked a bit like an upright iron, and the block was quite large. It could be fitted with lithium batteries and had some gear-like objects that could be attached to other wheels or sliding devices. This way, the entire device could move as expected.
I remember that during the judging, except for my own work, none of the other teams’ projects could move (meaning they hadn’t written programs).
When other teams were introducing their robots, they only described the functions, but unfortunately, they couldn’t move.
When it was my turn to present, it truly amazed everyone. The judges were astonished to see my robot move.
In reality, the built-in program would disappear when power was lost, and because the blocks were very old, the lithium batteries inside couldn’t last long. I wrote the program at the base and brought it to the competition venue. To prevent the program from being lost, I found a charger. Because when running, the lithium battery without a charging cable would instantly lose power, causing the program to disappear. So it was also lucky that it could move.
I didn’t really expect anything; I felt like I was just implementing this little project according to my own ideas. Later, when they announced the first prize, surprisingly, it wasn’t me. I didn’t feel very disappointed, as it was fun anyway. But when the person who went up to receive the award wasn’t me, everyone present was quite astonished.
Then the award presenter said there was a mistake, and I ended up winning first place after all.
Failure
The university was holding an electronic design competition open to all students.
I looked at the competition topics and thought I could give it a try. I found similar topics on Baidu. The content required a series of electronic components to be soldered together, and then the required program, which was provided, had to be loaded.
For me at that time, that pile of code was just a bunch of gibberish.
I went to the Hangzhou electronics market and navigated through countless shops, where the shop owners looked at me as if I were an alien.
I awkwardly asked for the electronic components I wanted. A kind shop owner gave me some LED bulbs.
She also said that I should use a flat-head soldering iron, as beginners can’t handle pointed ones well.
They were very curious about what I was trying to do.
After buying the components, I sat on the floor and, following the circuit diagram from that blog, soldered everything together on a chair.
Oh, right, at that time I hadn’t learned about circuit diagrams either, so I was just soldering based on my intuition.
I think I was quite naive then, trying to solder something without any basics. But I don’t have the right to mock him.
Then I started loading the program. I put the single chip into the socket, connected the socket to the power supply, and started trying to download the program provided by that blog to the chip using software.
I actually wanted to tell him, “Hey, are you sure the firmware program provided by this website matches your chip model? The chip is so hot; you actually inserted it backward, did you know? The chip has probably been burned out.”
But I knew nothing. I stupidly took something soldered from unknown components and a chip that was actually burned out to participate in the evaluation. Needless to say, I was despised by the expert judges.
What I didn’t know was that almost no one like me had registered for the competition. The university had an electronic design competition experimental class where you could learn everything you wanted to know about electronic design.
Although the competition was open to the whole university, only those from this experimental class would register.
My First Program
Later, I understood the existence of the electronic design class. I signed up for it in my sophomore year. I remember there was an exam and an interview, and you had to pass to get in.
I remember they asked me several questions, none of which I could answer. Later, they asked what my C language score was, and I said 97, then they said, “Okay, you’ve passed.”
The first week mainly covered basic soldering knowledge. Although it seems the story is just beginning, the story I want to tell in this article is also about to end.
The second week mainly covered knowledge about LED digital tubes. I received the distributed 51 development board. In the evening, I studied in my dorm how to make the digital tubes light up according to my ideas.
I learned how to display numbers that were constantly lit. I understood that I needed to select position first and then segment. I suddenly understood a lot; this was the most primitive time-slicing method.
I suddenly had an idea: I wanted to make the digital tubes achieve a marquee effect, with the outer ring continuously rotating.
I wrote and wrote and wrote.
I wrote it out.
I burned it in, ran it, and amazingly, it was just as I had imagined. The outer ring kept turning and turning, which was really beautiful. I was very happy.
Afterword
Perhaps that wasn’t my first program, after all, before that, the C language course required designing programs, so I should have written programs already.
However, for me, that marquee display was truly my first program in a real sense, completely created by me.
Even if I die someday, if the programs I write can continue to run, I can continue my life in another way.