Events in JavaScript – Part 1 – Coding a “Score Keeper Game”

We use JavaScript to control the behaviour of a web page. We do this by adding events to our page. Examples would be to “listen” for a click or for when the mouse hovers over an image or when the user hits a key on their keyboard etc. The process of events is that we assign an event and then “listen” for a desired response from the user. To add an event listener we use the addEventListen method which is...Read more

4 Areas of DOM Manipulation in JavaScript

In my last post, I wrote about the 5 different Document Object methods and in this post I’m going to expand on that and talk about Document Object Manipulation in JavaScript. If HTML is the page structure and CSS is the page styling then JavaScript is there to control the page behaviour. The 4 main areas of DOM manipulation are: Style manipulation Class manipulation Tag manipulation Attribute manipulation Editing an elements style with the “Style” property When we talk about...Read more

5 Document Object Methods in JavaScript (a small DOM cheat sheet)

Document is an object in JavaScript that refers to the entire contents of a web page and this post is going to talk about each of the methods inside this document object. The 5 “Document” Methods are as follows: This area of JavaScript is referred to as “DOM” or Document Object Manipulation and is how we get our JavaScript to interact with or “manipulate” the HTML and CSS in the browser. This is the example HTML code we’re going to...Read more

Getting started with JaveScript and a real basic program

I’m currently following an online course on udemy.com which is teaching me JavaScript. I’ve decided to make some notes along the way to refer back to once all this stuff gets pushed out of my head again when I get back into robotics in September. This post is about how to start up a new JavaScript project using Sublime text editor (3). The first thing to do would be to create a new project folder somewhere on your computer and...Read more
Understanding HTML forms

Understanding HTML forms

For years I’ve constantly found myself struggling (as I come back to it again and again) with HTML forms. Not necessarily because I don’t understand how they work, but more because I’m not exposed to them that often. However, that said, I’ve now got to start building a system that has some forms in it and I’m therefore revisiting my notes to freshen up on the topic. I decided to write a blog post as my own personal “cheat sheet”...Read more

Application of Matrices

Following on from the last couple of posts on the subject, today we’re going to look at the application matrix operations and how they help us in the real world. Below I have constructed the diagram of a network which we can imagine has something flowing through it (like a railway system or water system etc.) and an “ideal system” has input nodes, branches, paths or “arcs” and output nodes. In our diagram we have and input nodes; and ,...Read more
Testing Out an Ultrasonic  Sensor (The Posh Way)

Testing Out an Ultrasonic Sensor (The Posh Way)

This week we’ve got a lesson where we’ve got to test out an ultrasonic sensor using an Arduino Uno board. We’re going to be doing something similar in our lesson to what we did in the post “Tuning The Distance of an IR Sensor Using Arduino” that I wrote last week in class; only this time (because I’m not in class and I can think straight) I want to integrate the sensor with a thermostat using a thermistor (because the...Read more

Matrix Operations

Provided two matrices are the same size we are able to add them together and their sum can be defined as . When adding two vectors together, the numbers in the same position will be added together i.e. and so on. A matrix can also be multiplied by a scalar. So if then . \\ If you already have no idea about what I’m talking about then read Introduction to Matrices first ? Worked examples: Given matrices a) . \\...Read more

Tuning The Distance of an IR Sensor Using Arduino 🧶

This post is going to explore the process of connecting a sensor up to an Arduino circuit, to analyse the data and then come up with a way of calibrating the sensor for a specific task. When using sensors, we need to work out what the sensor values actually mean. In this instance we’re being given numbers (off the sensor) like 570 for a distance of 4cm or 525 at a distance of 26cm. We need to find how to...Read more

Introduction to Matrices 🧮

A matrix is a grid of numbers or mathematical expressions that we use to store vast quantities of data in such a way that allows us to easily identify and manipulate each piece of information in the matrix. Engineering, science and computing all use matrices in a huge number of applications i.e. data analysis, search engines or game theory. The size of the matrices is observed by the number of rows and columns and can be described as an “”...Read more