Variable | A variable is like a labelled box where we store data. This could be a number, a text, or even more complex data. We can change the contents of this box anytime in our program. |
Function | A function is like a mini-program within your program, built to perform a specific task. It can take inputs, process them, and return an output. They are reusable, modular components that can simplify writing and reading code, by breaking it down into smaller, well-structured segments. |
Loop | A loop in programming is like a conveyor belt. It will keep repeating the same set of instructions over and over for a predetermined number of times or until a certain condition is met. |
Conditional Statement | A Conditional Statement acts like a decision-making crossroad in a program. It checks a condition (for example, if a specific variable is set to False) and tells the program how to proceed based on that. |
Comment | A comment is a way to add notes or explanations to the code. They are meant to be read by programmers/humans and are completely ignored by the computer. They start with a # character in CircuitPython. |
Declaration | A declaration in programming informs the system about a variable, function, or other entity before its actual use in the code. |
Class | A class is a blueprint from which objects are created, similar to the blueprint of a car or architectural plans for a house. A class defines specific properties objects created from it can have, such as “model” and “color”, as well as functions (methods) they can perform, like closeDoor() or openWindow() . This allows programmers to create multiple objects, like different cars, that share common behaviors but have varied properties. (For instance, Car would be the class, while “Frank’s blue Hyundai” would be an object created from that class.) |
Object | An object is an entity created from a class, much like a car built using a specific blueprint. It holds unique attributes and performs actions, termed methods, defined by its class (see above). This allows for the creation of varied objects, each with unique data, but all adhering to behaviors and characteristics defined by their class. |
Instance | An instance is like a single product produced from a factory assembly line. The factory is the class and the product is the object. To create an object instance, for example, “Frank’s Car”, we would use the Car class and specify both the model and color. This might look like franks_car = Car("Hyundai", "Blue") . This statement creates a new instance of the Car class named franks_car , representing a blue Hyundai. |
Method | A method is a function attached to an object. It defines the actions that the object can perform and can modify the object’s state, much like real-world objects can perform actions based on their design. For instance, in the context of the Car class, a method might be named openWindow() . When this method is invoked on a car object, such as with franks_car.openWindow() , it would perform the action of opening the car’s window, as defined in the class. |
Library , Module | Libraries and modules contain code written by other people to fulfill specific tasks. Core modules, such as board , digitalio , and time provide functionality essential to working with your board. Therefore, they are already included in CircuitPython. In some cases, you may need to download additional libraries to add functionality, such as drivers for specific sensors, to your code. You can learn more about that subject by reading the chapter on CircuitPython Libraries in Adafruit’s guide. |
API | Application Programming Interfaces (APIs) define how different programs communicate, establishing fixed rules for their interactions. Think of an API as a restaurant menu: it details how one program can request specific actions or data from another, enabling different programs to interact and share capabilities or information. |
MAC Address | A MAC address (Media Access Control address) is a unique hardware address used to identify devices on a network. |