Tag: programming

  • Arduino: Understanding the Structure of C

    Arduino uses a variant of the programming language called “C”. This post discusses the very basics of understanding the rules of C in order to get started understanding an Arduino program and being able to modify it. Comments Comments are included in a program to help people understand the code. The computer completely ignores the…

  • Converting HEIC to PNG

    I discuss the problem of converting HEIC image files to PNG and explain two solutions: manual conversion and writing a Python program using Pillow-HEIF. I share my Python code and discuss the installation and features of the pillow-heif package.

  • Writing more complex code

    When you first start learning to program, you are often motivated by a desire to create a specific program, like a game. But writing larger programs can be frustrating due to the number of errors and your lack of progress. I discuss how to develop you code step-by-step in order to achieve early success and…

  • If statements

    In JavaScript, if statements are written like this: This is one of the main ways that we use to get a program to make a decision based on input and do something different than it would otherwise do. When the program reaches the if statement, it will determine if the condition is true or false.…

  • Troubleshooting your webpage

    This code troubleshooting guide emphasizes the importance of clear formatting, comments, and variable names. It also highlights common HTML and JavaScript errors to watch out for and suggests using the browser console for error messages and variable value checks. Proper formatting and console usage can greatly facilitate code troubleshooting.

  • setInterval()

    setInterval is a JavaScript command which takes two parameters. The first is the name of a function and the second is the time interval, in milliseconds, that this function should be repeatedly called. For example: In this code, setInterval calls the function ‘update’ every 10 milliseconds. The function increases the variable i by 1 and…

  • Arrays

    An array in JavaScript is a variable containing multiple values. Arrays are indexed from 0 to n-1. By using a for loop, you can iterate through the array’s values without needing to list each value individually. Proper formatting makes an array’s structure easier to understand. Arrays are fundamental in JavaScript programming.

  • G-code

    What is G-code? G-code is the most widely used CNC and 3D printing programming language. It is used to provide commands for controlling the movement of tools as well as controlling the temperature of the 3D printer. The discussion below will focus mostly on using G-code for 3D printing. Syntax Each line of G-code contains…

  • Spirographs 2

    This is part 2 of a multi-part series. If you haven’t read the first part, it may be helpful to review it first. The problem with the standard formulas The standard formula for an epitrochoid is: The problem with this formula is that adjusting r or d to form new designs changes the overall size…