javascript Archives - Raspberry Pi Foundation https://www.raspberrypi.org/blog/tag/javascript/ Teach, learn and make with Raspberry Pi Fri, 28 Apr 2023 09:47:33 +0000 en-GB hourly 1 https://wordpress.org/?v=6.2.2 https://www.raspberrypi.org/app/uploads/2020/06/cropped-raspberrry_pi_logo-100x100.png javascript Archives - Raspberry Pi Foundation https://www.raspberrypi.org/blog/tag/javascript/ 32 32 Kids’ coding languages https://www.raspberrypi.org/blog/kids-coding-languages/ https://www.raspberrypi.org/blog/kids-coding-languages/#comments Fri, 28 Apr 2023 09:47:30 +0000 https://www.raspberrypi.org/?p=83768 Programming is becoming an increasingly useful skill in today’s society. As we continue to rely more and more on software and digital technology, knowing how to code is also more and more valuable. That’s why many parents are looking for ways to introduce their children to programming. You might find it difficult to know where…

The post Kids’ coding languages appeared first on Raspberry Pi Foundation.

]]>
Programming is becoming an increasingly useful skill in today’s society. As we continue to rely more and more on software and digital technology, knowing how to code is also more and more valuable. That’s why many parents are looking for ways to introduce their children to programming. You might find it difficult to know where to begin, with so many different kids’ coding languages and platforms available. In this blog post, we explore how children can progress through different programming languages to realise their potential as proficient coders and creators of digital technology.

Two kids share their Scratch coding project on a laptop.

ScratchJr

Everyone needs to start somewhere, and one great option for children aged 5–7 is ScratchJr (Scratch Junior), a visual programming language with drag-and-drop blocks for creating simple programs. ScratchJr is available for free on Android and iOS mobile devices. It’s great for introducing young children to the basics of programming, and they can use it to create interactive stories and games.

Scratch

Moving on from ScratchJr, there’s its web-based sibling Scratch. Scratch offers drag-and-drop blocks for creating programs and comes with an assortment of graphics, sounds, and music for your child to bring their programs to life. This visual programming language is designed specifically for children to learn programming fundamentals. Scratch is available in multiple spoken languages and is perfect for beginners. It allows kids to create interactive stories, animations, and games with ease.

The Raspberry Pi Foundation has a wealth of free Scratch resources we have created specifically for young people who are beginners, such as the ‘Introduction to Scratch’ project path. And if your child is interested in physical computing to interact with the real world using code, they can also learn how to use electronic components, such as buzzers and LEDs, with Scratch and a Raspberry Pi computer.  

Young person using a laptop to code in Scratch, our favourite of all kids' coding languages.

MakeCode

Another fun option for children who want to explore coding and physical computing is the micro:bit. This is a small programmable device with an LED display, buttons, and sensors, and it can be used to create games, animations, interactive projects, and lots more. To control a micro:bit, a visual programming language called MakeCode can be used. The micro:bit can also be programmed using Scratch or text-based languages such as Python, offering an easy transition for children as their coding skills progress. Have a look at our free collection of micro:bit resources to learn more.

HTML

Everyone is familiar with websites, but fewer people know how they are coded. HTML is a markup language that is used to create the webpages we use every day. It’s a great language for children to learn because they can see the results of their code in real time, in their web browser. They can use HTML and CSS to create simple webpages that include links, videos, pictures, and interactive elements, all the while learning how websites are structured and designed. We have many free web design resources for your child, including a basic ‘Introduction to web development’ project path.

Three kids coding at laptops.

Python 

If your child is becoming confident with Scratch and HTML, then using Python is the recommended next stage in their learning. Python is a high-level text-based programming language that is easy to read and learn. It is a popular choice for beginners as it has a simple syntax that often reads like plain English. Many free Python projects for young people are available on our website, including the ‘Introduction to Python’ path.

A kid coding in Python on a laptop.

The Python community is also really welcoming and has produced a myriad of online tutorials and videos to help learners explore this language. Python can be used to do some very powerful things with ease, which is why it is so popular. For example, it is relatively simple to create Python programs to engage in machine learning and data analysis. If you wanted to explore large language models such as GPT, on which the ChatGPT chatbot is based, then Python would be the language of choice.

JavaScript 

JavaScript is the language of the web, and if your child has become proficient in HTML, then this is the next language for them. JavaScript is used to create interactive websites and web applications. As young people become more comfortable with programming, JavaScript is a useful language to progress to, given how ubiquitous the web is today. It can be tricky to learn, but like Python, it has a vast number of libraries of functions that people have already created for it to achieve things more quickly. These libraries make JavaScript a very powerful language to use.

Try out kids’ coding languages

There are many different programming languages, and each one has its own strengths and weaknesses. Some are easy to learn and use, some are really fast, and some are very secure.

Two kids coding together on Code Club World.

Starting with visual languages such as Scratch or MakeCode allows your child to begin to understand the basic concepts of programming without needing any developed reading and keyboard skills. Once their understanding and skills have improved, they can try out text-based languages, find the one that they are comfortable with, and then continue to learn. It’s fairly common for people who are proficient in one programming language to learn other languages quite quickly, so don’t worry about which programming language your child starts with.

Whether your child is interested in working in software development or just wants to learn a valuable — and creative — skill, helping them learn to code and try out different kids’ coding languages is a great way for you to open up new opportunities for them.

The post Kids’ coding languages appeared first on Raspberry Pi Foundation.

]]>
https://www.raspberrypi.org/blog/kids-coding-languages/feed/ 5
Make your own game with CoderDojo’s new book https://www.raspberrypi.org/blog/coderdojo-nano/ https://www.raspberrypi.org/blog/coderdojo-nano/#comments Thu, 07 Sep 2017 12:04:21 +0000 https://www.raspberrypi.org/?p=36384 The first official CoderDojo book, CoderDojo Nano: Build Your Own Website, was a resounding success: thousands of copies have been bought by aspiring CoderDojo Ninjas, and it‘s available in ten languages, including Bulgarian, Czech, Dutch, Lithuanian, Latvian, Portuguese, Spanish, and Slovakian. Now we are delighted to announce the release of the second book in our…

The post Make your own game with CoderDojo’s new book appeared first on Raspberry Pi Foundation.

]]>
The first official CoderDojo book, CoderDojo Nano: Build Your Own Website, was a resounding success: thousands of copies have been bought by aspiring CoderDojo Ninjas, and it‘s available in ten languages, including Bulgarian, Czech, Dutch, Lithuanian, Latvian, Portuguese, Spanish, and Slovakian. Now we are delighted to announce the release of the second book in our Create with Code trilogy, titled CoderDojo Nano: Make Your Own Game.

Cover of CoderDojo Nano Make your own game

The paperback book will be available in English from Thursday 7 September (with English flexibound and Dutch versions scheduled to follow in the coming months), enabling young people and adults to learn creative and fun coding skills!

What will you learn?

The new book explains the fundamentals of the JavaScript language in a clear, logical way while supporting you to create your very own computer game.

Pixel image of laptop displaying a jump-and-run game

You will learn how to animate characters, create a world for your game, and use the physics of movement within it. The book is full of clear step-by-step instructions and illustrated screenshots to make reviewing your code easy. Additionally, challenges and open-ended prompts at the end of each section will encourage you to get creative while making your game.

This book is the perfect first step towards understanding game development, particularly for those of you who do not (yet) have a local Dojo. Regardless of where you live, using our books you too can learn to ‘Create with Code’!

Tried and tested

As always, CoderDojo Ninjas from all around the world tested our book, and their reactions have been hugely positive. Here is a selection of their thoughts:

“The book is brilliant. The [game] is simple yet innovative. I personally love it, and want to get stuck in making it right away!”

“What I really like is that, unlike most books on coding, this one properly explains what’s happening, and what each piece of code does and where it comes from.”

“I found the book most enjoyable. The layout is great, with lots of colour, and I found the information very easy to follow. The Ninja Tips are a great help in case you get a bit stuck. I liked that the book represents a mix of boy and girl Ninjas — it really makes coding fun for all.”

“The book is a great guide for both beginners and people who want to do something creative with their knowledge of code. Even people who cannot go to a CoderDojo can learn code using this book!”

Writer Jurie Horneman

Author of CoderDojo Nano: Make Your Own Game Jurie Horneman has been working in the game development industry for more than 15 years.

stuffed toy rabbit wearing glasses

Jurie would get on well with Babbage, I think.

He shares how he got into coding, and what he has learnt while creating this awesome book:

“I’ve been designing and programming games since 1991, starting with ancient home computers, and now I’m working with PCs and consoles. As a game designer, it’s my job to teach players the rules of the game in a fun and playful manner — that gave me some useful experience for writing the book.

I believe that, if you want to understand something properly, you have to teach it to others. Therefore, writing this book was very educational for me, as I hope reading it will be for learners.”

Asked what his favorite thing about the book is, Jurie said he loves the incredible pixel art design: “The artist (Gary J Lucken, Army of Trolls) did a great job to help explain some of the abstract concepts in the book.”

Pixel image of a landscape with an East Asian temple on a lonely mountain

Gary’s art is also just gorgeous.

How can you get your copy?

You can pre-order CoderDojo Nano: Make Your Own Game here. Its initial pricing is £9.99 (around €11), and discounted copies with free international delivery are available here.

The post Make your own game with CoderDojo’s new book appeared first on Raspberry Pi Foundation.

]]>
https://www.raspberrypi.org/blog/coderdojo-nano/feed/ 4
Hour of Code 2016 https://www.raspberrypi.org/blog/hour-of-code-2016/ https://www.raspberrypi.org/blog/hour-of-code-2016/#comments Thu, 01 Dec 2016 12:09:20 +0000 https://www.raspberrypi.org/?p=26801 What could you do in an hour? Perhaps you could watch an episode of a TV show, have a luxurious bath, or even tidy the house a bit! But what if you could spend an hour learning a skill that might influence the future of your career, and perhaps your whole life? The Hour of…

The post Hour of Code 2016 appeared first on Raspberry Pi Foundation.

]]>
What could you do in an hour? Perhaps you could watch an episode of a TV show, have a luxurious bath, or even tidy the house a bit! But what if you could spend an hour learning a skill that might influence the future of your career, and perhaps your whole life?

hour-of-code-header

The Hour of Code is a worldwide initiative which aims to get as many people as possible to have a go at programming computers. Our aim is to put digital making into the hands of as many people as possible, so here at Pi Towers we have cooked up some exciting projects for you to try, all of which can be completed in an hour.

Have a go at making a version of a whoopee cushion (a favourite Christmas cracker toy in my house) using physical computing, invent your own lyrics for The Twelve Days of Christmas, or simulate your cat floating in space. Many of the projects don’t even require a Raspberry Pi: you can get started with Scratch just by visiting a website.

Physical computing projects

Physical computing projects

Scratch projects

Ada's Poetry Generator

Astro Pi projects

Sense HAT Random Sparkles

Programming projects



We are also holding a digital making event at Pi Towers on Wednesday 7 December: if you can travel to Cambridge, then register, join in and achieve your hour of code!

Whether you are a child or an adult, it is never too late to start learning to code. When I was a teacher, I always loved participating in the Hour of Code: the students couldn’t quite believe they were given an hour to do something they would willingly do for fun. What they didn’t know is that the teachers secretly had a lot of fun testing out the projects too, although some of the resulting sounds did cause a few raised eyebrows in the staff room!

Once you’ve started coding, you might not want to stop, so head over to our resources section for more inspirational projects to tackle. Intrepid teachers can download the second issue of the MagPi Educator’s Edition to find out how to take things further in the classroom. The sky’s the limit! Well, actually, if you’re doing one of our Astro Pi projects, space is the limit…

The post Hour of Code 2016 appeared first on Raspberry Pi Foundation.

]]>
https://www.raspberrypi.org/blog/hour-of-code-2016/feed/ 6
Raspberry Pi Weather Station for schools https://www.raspberrypi.org/blog/school-weather-station-project/ https://www.raspberrypi.org/blog/school-weather-station-project/#comments Tue, 10 Feb 2015 12:17:32 +0000 http://www.raspberrypi.org/?p=11626 When I first joined the Raspberry Pi Foundation, over a year ago now, one of my first assignments was to build a weather station around the Raspberry Pi. Thanks to our friends at Oracle (the large US database company), the Foundation received a grant not only to design and build a Raspberry Pi weather station…

The post Raspberry Pi Weather Station for schools appeared first on Raspberry Pi Foundation.

]]>
When I first joined the Raspberry Pi Foundation, over a year ago now, one of my first assignments was to build a weather station around the Raspberry Pi. Thanks to our friends at Oracle (the large US database company), the Foundation received a grant not only to design and build a Raspberry Pi weather station for schools, but also to put together a whole education programme to go with it. Oracle were keen to support a programme where kids get the opportunity to partake in cross-curricular computing and science projects that cover everything from embedded IoT, through networking protocols and databases, to big data. The goals of the project was ambitious. Between us we wanted to create a weather experiment where schools could gather and access weather data from over 1000 weather stations from around the globe. To quote the original project proposal, students participating in the program will get the opportunity to:

  • Use a predefined Raspberry Pi hardware kit to build their own weather station and write application code that logs a range of weather data including wind speed, direction, temperature, pressure, and humidity;
  • Write applications to interrogate their weather station and record data in a cloud-hosted Oracle Application Express database;
  • Interrogate the database via SQL to enable macro level data analysis;
  • Develop a website on the Raspberry Pi to display local weather conditions that can be accessed by other participating schools; and
  • Access a Weather Station for Schools program website to see the geographical location of all weather stations in the program, locate the websites of other participating schools, interact with other participants about their experiences, blog, and get online technical support.

After a year of grafting on hardware prototypes and software development I’m pleased to announce that the final PCB design has been committed to manufacture and we are ready to start pre-registering schools who’d be interested in participating in the programme. We have 1000 weather station kits to give away for free so to find out how your school can be part of this read the rest of this post below, but first some background on the project.

If you’ve been on Twitter a lot you’ll have noticed me teasing this since about March last year. Below is a photo of the very first version.

I did a lot of testing to ensure that the components were reliable and wouldn’t become problematic on the software side after a long period of uptime. The goal was to have the Pi controlling everything, so that we could leverage learning opportunity: helping kids to learn about writing code to interface directly with the sensors, as well as displaying and analysing collected data. I settled on the following set of sensor measurements for the weather station:

  • Rainfall
  • Wind speed
  • Wind gust speed
  • Wind direction
  • Ambient temperature
  • Soil temperature
  • Barometric pressure
  • Relative humidity
  • Air Quality
  • Real Time Clock (for data logging purposes)

This seemed like a good enough spread of data. I’m sure some people will ask why not this measurement or why not that. It was important for us to keep the cost of the kit under control; although there is nothing to stop you from augmenting it further yourself.

Once that was nailed down I wrote a few lessons plans, and Lance and I trialled them with with two schools in Kent (Bonus Pastor Catholic College and Langley Park School for Boys).

BBC News School Report were on site and recorded a short feature about the day here.

We gave the kids one lesson from the scheme of work, showing them how to interface with the anemometer (wind speed sensor) in code. One thing that was clearly apparent was how engaged they were. Once their code was up and running, and was able to measure wind speed correctly, they had a lot of fun seeing who could get the fastest movement out of the sensor by blowing on it (current record is 32 kph, held by Clive “Lungs” Beale). Warning: there is a fainting risk if you let your kids do this too much!

We went away from this feeling we were very much on the right track, so we continued to design the scheme of work. In addition to developing schemes of work covering commissioning of the weather station and computing aspects we are working with partners to produce the learning resources that will cover understanding how weather systems work and interpreting patterns in the data.

The scheme has been broken down into three main phases of learning resources:

  1. Collection
    Here you’ll learn about interfacing with the sensors, understanding how they work and writing Python code to talk to them. You’ll finish off by recording the measurements in a MySQL database hosted on the Pi and deploying your weather station in an outdoor location in the grounds of your school.
  2. Display
    This will involve creating an Apache, PHP 5 and JavaScript website to display the measurements being collected by your weather station. You will have the opportunity to upload your measurements to the Oracle cloud database so that they can be used by other schools. Whether or not you choose to upload your data, you’ll still pull down measurements from other schools and use them to produce integrated weather maps.
  3. Interpretation of Weather
    Here you’ll learn how to discern patterns in weather data, analyse them and use them to inform predictions about future weather. This will be done for both local weather (using your own data) and national weather (using data from the Oracle cloud database online).

My next task was to take the breadboard prototype and create a PCB test version that we could use in a small trial of 20 or so units. I had not done any PCB design before this. So over the course of a couple of days I learnt how to use a free, open source, PCB design tool called KiCAD. I used a brilliant series of YouTube videos called Getting To Blinky by Contextual Electronics to get to grips with it.

Below is my second attempt. This board is what most hardware designers would call a sombrero. The Pi goes in upside down so it’s like a HAT that’s too big!

Weather Prototype KiCAD

I was aware that it was a huge waste of PCB real-estate. However, for the small volume run we were making, it was a convenient way to mount the board inside a cheap IP65 junction box that I wanted to use as the case. Below is the PCB prototype when first assembled. The little silk screen rain cloud graphic was borrowed from BBC Weather (thanks guys).

You’ll notice there are two boards. The small board marked AIR holds the pressure, humidity and air quality sensors. Since these must be exposed to the air they are at risk of atmospheric corrosion, especially in coastal environments. I wanted to avoid this risk to the Pi and the main board so this is why I split those sensors off to a separate smaller board. Below is how they look inside their respective cases.

The Pi sits inside the water-tight box on the left with M20 grommets to seal the cables going in and out. The AIR board on the right has conformal coating (a spray on protective layer), and is connected to the main board by a short length of cable. There are three large holes on the base of its case to allow the air in.

The weather station also needs a reliable network connection for remote monitoring, further code changes, to allow it to upload to Oracle, and to make sure that other computers on your school network can load its web pages.

Most importantly it also needs power. So instead of considering large batteries or solar panels I decided to kill two birds with one stone and use power over Ethernet. This allows power and network connectivity to be supplied through a single cable, reducing the number of cable grommets needed. You might be thinking that WiFi is an option for this; however, school WiFi networks are notoriously overloaded with many mobile devices competing for service.

So, if you go the same way as me, your school will need a long cable to run from the school building out to the location that you choose for the weather station. This basically means you never have to worry about its power or network connectivity. You are welcome to solve these challenges in your own way though, and this can actually be a very engaging and fun activity for the students to do themselves.

Once I had the PCB prototype working I had to get twenty more made and tested. This involved spending hours (it seemed longer) on the Farnell website building up a massive basket of electronic components. When the new boards and components were in my possession we took them down to a local company, EFS Manufacturing, in Cambridge for assembly.

Here are the twenty assembled and tested boards:

And here is another layer of the conformal coating spray going onto the AIR boards in the Pi Towers car park. It was a bit smelly and I didn’t want to gas out the office!

You’ll notice there are small bits of sticky tape on there. This is because the conformal coating needs to protect the solder joints on the board, but not block up the air holes on the sensors. This was a bit of a delicate job involving cutting the tape into tiny shapes, waiting for the coating to dry, and peeling it off using a scalpel.

So then it was just a matter of assembling the 20 kits with everything required to build a weather station. From the power bricks, rain gauges and wind vanes right down to grommets, screws and rubber washers. The trial participants were chosen by us to give us a coverage of field-trial users, schools and promotional partners. We kept one back to put on the roof of Pi Towers, and the rest were shipped at the end of November last year.

Slowly but surely reports have been coming in about these prototype kits being used in schools and code clubs.

Dan Aldred of Thirsk School & Sixth Form College has introduced Weather Wednesdays.

Matthew Manning, who runs the awesome YouTube channel RaspberryPiIVBeginners, made this video about setting his one up:

Andrew Mulholland, of Raspi-LTSP fame, has been using one at a Raspberry Jam where he volunteers in Northern Ireland.

James Robinson’s year 10 pupils from Soham Village College have been working through the scheme of work too.

OCR are putting one on their roof, and we’re still trying to acquire permission from the building owners at Pi Towers so we can put ours up on the roof. (Right now it’s operating from an outside window ledge.) Meanwhile, now that I was confident about it, I handed over the electrical schematic of the prototype to our engineering team. They imported it into the professional CAD package that the Raspberry Pi was designed in, and proceeded to make the Weather Board into an official HAT.

They have gone through it and essentially reworked everything to the same standard that you would expect from our products. So here it is, feast your eyes. You snap off the one side, and that is the equivalent of the small AIR board on the prototype.

Weather HAT labels

If you join our weather station scheme, this is what you will get, along with all the wind vanes, screws and other bits you’ll need. The plan is to mount the HAT onto the Pi using standard 11 mm stand-offs. Those will then mount onto a perspex sheet, and that sheet will screw into the electrical junction box. Nice and cheap.

The Raspberry Pi Weather Station kit is a great way to get your pupils involved in a wide range of computing activities whilst undertaking a practical science experiment. There is lots of opportunity for cross-curricular discussion on the science of meteorology, geography and global climate change. You will also get to participate in a global programme with other schools around the world. We have 1000 weather station units to give away to schools that sign up. The supporting educational resources are written in the English language and targeted at students aged around 15-16 years old; however we’re anticipating participation from pupils both younger and older than this. If your school would like to be one of this thousand then please sign up on THIS PAGE.

People we would like to thank:

In case you missed it above, here’s the School Sign Up again.

The post Raspberry Pi Weather Station for schools appeared first on Raspberry Pi Foundation.

]]>
https://www.raspberrypi.org/blog/school-weather-station-project/feed/ 227