<commit_before># Raspberry Pi Nodebots

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

by the Mozilla Campus Club Birmingham (mozccbham.org).

![University of Birmingham](/images/uob_logo.png?raw=true)


This set of lessons will show you some of the basics of Node.js and Raspberry Pi for robotics and IoT.

## Setup: Checking everything works

Collect a robot and setup the pi-top and robot as shown below.  Make sure the Raspberry Pi in the pi-top has an SD card. You may find the SD card in the robot.

![Pi-top and robot setup](/images/CEEDsetup.jpg?raw=true)

To turn on the pi-top, press the green power button on the back (below the power cable) for 3 seconds.  After the pi powers up, you should see the desktop screen. It should look like the picture below.

![Pi-top desktop](/images/PiDesktop.jpg?raw=true)

## Example 1: Switching on an LED with the GPIO pins

In your kit, you will find a circuit board with an LED and a resistor.

![LED circuit](/images/Circuit.jpg?raw=true)

First, we need to connect an LED to the Pi. You need to connect the wires to pins 5 and 6. You might find the pin diagram below useful.

![GPIO pin layout](/images/GPIO_PinLayout.png?raw=true)

The starting code for the example is on the desktop in the nodebots folder. Open this folder and open example 1. In this folder, you will find a file called `index.js`.<commit_msg>Add reference to CamJam EduKit 3<commit_after># Raspberry Pi Nodebots

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

by the Mozilla Campus Club Birmingham (mozccbham.org).

![University of Birmingham](/images/uob_logo.png?raw=true)

This set of lessons will show you some of the basics of Node.js and Raspberry Pi for robotics and IoT. 

We use the excellent robotics kit from Cambridge Raspberry Jam - ![CamJam EduKit 3](http://camjam.me/?page_id=618).

## Setup: Checking everything works

Collect a robot and setup the pi-top and robot as shown below.  Make sure the Raspberry Pi in the pi-top has an SD card. You may find the SD card in the robot.

![Pi-top and robot setup](/images/CEEDsetup.jpg?raw=true)

To turn on the pi-top, press the green power button on the back (below the power cable) for 3 seconds.  After the pi powers up, you should see the desktop screen. It should look like the picture below.

![Pi-top desktop](/images/PiDesktop.jpg?raw=true)

## Example 1: Switching on an LED with the GPIO pins

In your kit, you will find a circuit board with an LED and a resistor.

![LED circuit](/images/Circuit.jpg?raw=true)

First, we need to connect an LED to the Pi. You need to connect the wires to pins 5 and 6. You might find the pin diagram below useful.

![GPIO pin layout](/images/GPIO_PinLayout.png?raw=true)

The starting code for the example is on the desktop in the nodebots folder. Open this folder and open example 1. In this folder, you will find a file called `index.js`.
{'fraction_non_alphanumeric': 0.08494983277591973, 'fraction_numerical': 0.005016722408026756, 'mean_word_length': 4.130360205831904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6449130', 'n_tokens_mistral': 929, 'n_tokens_neox': 870, 'n_words': 431}