Programming & Flowcharts
Programming a Programmable System
A programmable component such as a microcontroller does nothing useful until it is given a program — a precise sequence of instructions that tells it how to respond to inputs and control outputs. The specification identifies three types of programming language and system used to write or represent those instructions: text-based languages, block-based editors, and flowchart systems. Each has different characteristics, and the right choice depends on the complexity of the task and the experience of the programmer.
Text-Based Programming Languages
A text-based language requires the programmer to type instructions using the exact keywords and syntax of the chosen language — for example, C, MicroPython, or the Arduino language. Text-based code gives the greatest flexibility and control: any logic, however complex, can be expressed, and the resulting programs run efficiently on a microcontroller's processor. The disadvantage is the learning curve — syntax errors cause the program to fail, and beginners may find it hard to understand code written by others. Text-based code is the standard approach in professional and industrial engineering.
The three programming types are: text-based (written code, most powerful, steepest learning curve), block-based (drag-and-drop visual blocks, easier for beginners, limited for complex programs) and flowchart systems (visual symbols representing the flow of control, easy to plan and communicate, but can become complex to follow on large programs).
Block-Based Editors
Block-based editors such as Scratch or Microsoft MakeCode represent program instructions as graphical blocks that are dragged and snapped together on screen. Each block has a fixed shape that only allows valid connections, so syntax errors are almost impossible. This makes block-based editors highly accessible for beginners and for quickly prototyping simple control logic. The limitation is that complex logic quickly becomes cluttered and hard to follow, and not all programming concepts — particularly low-level hardware control — can be represented easily with pre-defined blocks. Block-based editors are widely used in schools and for rapid concept testing.
Text-based code transfers directly to professional and industrial settings — skills learned in Arduino C or Python are used in real engineering roles. Block-based editors, by contrast, are primarily educational tools. Some platforms such as MakeCode for the micro:bit allow the programmer to switch between block view and the equivalent text-based (Python or JavaScript) view of the same program, which helps learners make the transition. For the OCR exam, you need to understand the relative merits of each type and be able to argue which is more suitable for a given scenario — you are not expected to write actual code.
Flowchart Systems
A flowchart uses standardised shapes connected by arrows to represent the flow of control through a program. The key symbols are: an oval for start/end (terminal), a rectangle for a process step (such as 'turn LED on'), a diamond for a decision (a yes/no question), and a parallelogram for input or output. Flowchart software such as Flowol or PicLogicator can directly interpret a drawn flowchart as a program and run it on a connected programmable system. The advantage of flowcharts is that they make the logic of a program immediately visible, making them easy to plan, communicate, and debug. The disadvantage is that large, complex programs produce sprawling flowcharts that become difficult to read and maintain.
The four standard flowchart symbols are: oval — terminal (start/stop); rectangle — process (an action or calculation); diamond — decision (a yes/no question that creates a branch); parallelogram — input or output (e.g. reading a sensor or switching an output device). Arrows show the direction of flow between each step.
Using a Flowchart to Control a Programmable System
A flowchart directly models how a microcontroller or PLC executes a program. Consider a simple temperature alarm: the flowchart starts (oval), reads the temperature sensor (parallelogram — input), then reaches a decision diamond: 'Is temperature above 30°C?' If yes, an arrow leads to a process rectangle 'Turn on buzzer' and an output parallelogram; if no, an arrow loops back to read the sensor again. This loop continues indefinitely. The flowchart both communicates the design to other engineers and, in systems like Flowol, can be executed directly as the program itself. For the exam, compare the advantages and disadvantages of each programming type for a given application.
The choice of programming method depends on the experience of the programmer and the complexity of the task. For a beginner or for planning and communicating a simple control algorithm, flowcharts and block-based editors are the most accessible. For a complex, high-performance system that needs precise hardware control or efficient code, a text-based language is most appropriate. In an exam scenario question, always link your choice to the programmer's skill level, the complexity of the program required, and whether the code needs to be maintainable by others in a team.