STEM Coding – Simple codes

Today, I went onto code.org. I signed up to a class pin which will help my app developing skills. In the lesson I finished the coding lesson 4 and 5 and are half way through 6.

Some of the challenges I encountered were not having a turn right block which I could use. As a compromise I used 3 turn lefts then later, when I learned about making and defining functions, I made a function called turn right which has 3 turn left block. This will make it easier for me to turn right as if I need to, I can just use that function as a shortcut.

Functions are coding blocks that you can define to make your code more efficient. For example the turn right function that I created saved me from using the turn left block 3 times. This is a new skill that I learned today.

I also learned that you cannot duplicate a block. To solve this problem, I changed the code from block to text and copied and pasted the code I needed more than once. This saved time and helped this time be more efficient.

Today I learned about how much you can do with a limited amount of blocks. When I was coding, the only blocks I were given were:

penUp

penDown

moveForward

turnLeft

I also learned that small errors can change the whole code. An example of this is when my friend told me that her code was not working as she programmed the turtle to do a function 4 times, but the code only worked 3 times. I then pointed out that she forgot the brackets after her function name.

At the moment I am really excited to see what I will be learning next.

With my solar power traffic lights. I did some research on Monday. I found out that they did exist but they were not common in the world. I also found a list of solar power objects and this helped me understand how common they are in the world.

So far, I have found some videos on YouTube about circuits and how to DIY build a traffic light. With DIY build a traffic light video, I am instead planning on attaching the wires to the solar panels instead of the battery. I was also brainstorming ideas of the shape of the traffic light, I thought that it would be good to build it out of a non flammable material to ensure the safety of overheating. I am thinking of not building it out of wood, but maybe 3D print it. I’m not exactly sure what shape the final product will turn up as so I am trying to be flexible. I am aiming to go for a simple large box design, but I need to make sure that the circuit fits in the box.

My idea to extend myself if I finish, is to make a sequence algorithm for the traffic lights. I will need to find out how to attach it to the traffic light and how to make a sequence itself. I did find a video on YouTube using soldering on a circuit board. It is very complicated but I am inquisitive to give it a try.

I hope that my project succeeds and that I will learn a lot from my coding journey.

That’s all for now, next week you will be updated with a new post!

One thought on “STEM Coding – Simple codes

  1. Dear Olivia, thanks for yet another thoughtful blog post. It sounds like you were able to use logical thinking and problem solving to overcome your coding challenges. Your solar panel traffic light idea, is a fabulous idea and I am really looking forward to watching this grow 🙂 Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *