Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 32 additions & 16 deletions Basic And Demo Codes/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
# PiSquare Demo Codes
* **Led Blink code(led_blink.py)**
* Control on board status led of PiSquare ( blue color led)
# PiSquare Demo Code
* **Blink LEDs (led_blink.py)**
* Control the onboard blue status LED on the PiSquare by running "led_blink.py"

* **pisquare_internal_temp.py**
* Run this code to see PiSquare internal temperature
* **PiSquare Internal Temperature (pisquare_internal_temp.py)**
* See PiSquare internal temperature using "pisquare_internal_temp.py"

* **ldr.py**
* Run this code to see light intensity (connect LDR to pisquare)
* **Light Dependant Resistor (ldr.py)**
* Measure the relative resistance of an LDR connected to the PiSquare, using the circuit shown below. The resistor is 10kOhms. The circuit is known as a 'voltage divider'
<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/img27.jpg" />
<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/img28.png" />

* **Onboard OLED Test**
* Inside this folder there is a file name "oled_test.py "Run this code to use onboard OLED, before this you need to save the library of OLED inside PiSquare(ssd1306.py)
* **Onboard OLED Test (oled_test.py)**

* Before running this script, you need to install the "micropython-ssd1306" MicroPython library. This should be done from Thonny.
* With the PiSquare connected, select Tools->Manage Packages...
* In the search bar, type "micropython-ssd1306", or "adafruit-circuitpython-ssd1306" if you are using Circuit Python.
* Select the appropriate library from the list (it should be the top one) and click on 'Install' to install the latest version.
* Inside the 'Onboard OLED Test' folder load "oled_test.py" in Thonny and run it.

<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/img24.jpg" />

* **servo_motor.py**
* Run this code to test servo motor
<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/img25.jpg" />
* **Servo Motors (servo_motor.py)**
* Connect up a servo motor as shown in the image below:

<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/img25.jpg" />

* Run the server_motor.py code.

* **lcd_display_16x2_demo**
* Inside this folder there is a file name "lcd_16x2_test.py", run this file to use 16x2 I2C Lcd, before this save library of the display(lcd_api.py and pico_i2c_lcd) inside PiSquare
* **16x2 LCD Display (lcd_display_16x2_demo.py)**

* As with the inbuilt OLED screen, you need to install a couple of libraries. These are not currently available from PyPi, so you are going to use the alternative method of installing libraries.
* In Thonny, open both "pico_i2c_lcd.py" and "lcd_api.py", then use File->Save Copy... This will present a dialog box allowing you to choose between saving to your local computer or "Raspberry Pi Pico". Choose the Pico.
* Save the files into the "lib" folder with their current names.
* Load and run "lcd_16x2_test.py"

<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/img26.jpg" />

* **potentiometer_test.py**
* Run this file to test Potentiometer
* **Measuring the relative resistance of a potentiometer (potentiometer_test.py)**

* Use the same circuit as the LDR, but replace the LDR with a potentiometer.
* Run "potentiometer_test.py"
70 changes: 43 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/img.png" />

#### PiSquare is an RP2040 and ESP-12E-based board that allows you to use multiple Raspberry Pi HATs without stacking them on top of one other. PiSquare uses Socket programming to wirelessly communicate multiple Raspberry Pi HATs ("n" numbers of HATs).
#### PiSquare is an RP2040 and ESP-12E-based board that allows you to use multiple Raspberry Pi HATs without stacking them on top of one other. PiSquare uses Socket programming to wirelessly communicate with multiple Raspberry Pi HATs ("n" numbers of HATs).

<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/img2.png" />

#### You can utilise PiSquare in a variety of ways, as we were previously limited to utilising a single HAT on the Raspberry Pi or a maximum of three Raspberry Pi HATs using PiStack, but you can't link the same HATs on it twice (Like more than two UART or SPI based Raspberry Pi HAT at the same time) PiSquare allows you to attach as many HATs as you like to your Raspberry Pi without stacking them, whether they're SPI, I2C, or SPI HATs, and you can control them all wirelessly.
#### You can use the PiSquare in a variety of ways. Previously you were limited to using a single HAT on the Raspberry Pi, or a maximum of three HATs using PiStack or equivalent, but you can't use two of the same HATs on it at once (e.g. two UART or SPI based HATs.). PiSquare allows you to attach as many HATs as you like to your Raspberry Pi without stacking them, whether they're SPI, I2C, or SPI HATs, and you can control them all wirelessly.

## PiSquare pins configuration is same as Raspberry pi pins configuration (like UART, I2C and SPI are in same place, so we can raspberry pi HAT'S in PiSquare)
## The PiSquare pin configuration matches the Raspberry Pi pin configuration (like UART, I2C and SPI).

<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/img3.png" />

Expand All @@ -29,7 +29,7 @@
* Exposes 25 multi-function 3.3V General Purpose I/O (GPIO)
* 21 GPIO are digital-only and 3 are ADC capable

## Operating Condition
## Operating Conditions
* Operating Temp Max 85°C (including self-heating)
* Operating Temp Min -20°C
* VBUS 5V ± 10%.
Expand All @@ -38,7 +38,7 @@

## Parts specification
1. **ESP-12E(ESP8266MOD)**
* Wi-Fi 2.4 GHz, support WPA/WPA2
* Wi-Fi 2.4 GHz, support for WPA/WPA2
* Integrated low power 32-bit MCU
* Operating Current: 80mA
* 802.11 b/g/n
Expand Down Expand Up @@ -67,51 +67,67 @@
* Boot button (Boot button of RP2040)
* ESP Reset button (Reset button of ESP-12E module)

### With PiSquare you can do these things :-
### Example PiSquare scenarios:

* **Create the server from Raspberry Pi and PiSquare as client, run multiple HAT , vice-versa**
* **Create a server on the Raspberry Pi with one or more PiSquares as clients with multiple HATs**
<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/gif1.gif" />

* **Make the PiSquare client and other all PiSquare as server, vice-versa**
* **Create a server on a PiSquare with one or more PiSquare clients**
<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/gif2.gif" />

* **Make Moble phone as server and other PiSquare as clients, vice-versa and Run any HAT on single PiSquare and control it via your phone**
* **Use a Moble phone as the server with one or more PiSquare clients**
<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/gif3.gif" />

* **Create Hotspot on Raspberry Pi and connect PiSquares to raspberry pi (without router)**
* **Create a hotspot on a Raspberry Pi and connect one or more PiSquares to the Raspberry Pi (without using a router)**
<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/gif4.gif" />

* **Create hotspot on PiSquare and connect PiSquare to other PiSquares (without router)**
* **Create a hotspot on a PiSquare and connect one or more PiSquares (without using a router)**
<img src = "https://github.com/sbcshop/PiSquare/blob/main/images/gif5.gif" />

## Setup PiSquare
### It Support C/C++, MicroPython and circuitpython
1. Download Thonny IDE
## Setting up the PiSquare
### The PiSquare support C/C++, MicroPython and CircuitPython

For MicroPython/CircuitPython

1. Download the Thonny IDE

https://thonny.org/

<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img.JPG" />

2. In PiSquare we can use both MicroPython and CircuitPython, but we use micropython ( **use micropython** * )
* Install **Micropython** in PiSquare
first you need to press the boot button of PiSquare, then connect the USB, don,t release the button until you connect the USB to the laptop. then you see a new device named "RPI-RP2".
2. The PiSquare we can use both MicroPython and CircuitPython, but in these instructions we use MicroPython

* Installing **MicroPython** on the PiSquare

Before connecting the PiSquare to your PC, press and hold the Boot button, then connect the USB. Don't release the button until you connect the USB your PC. Release the Boot button once you see a new 'drive' named "RPI-RP2".

<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img13.png" />

After this go to run->select interpreter,choose device,port and install micropython (install firmware)
In Thonny, select Run->Select Interpreter. Choose the 'MicroPython (Raspberry Pi Pico)' interpreter, the port the PiSquare is attached to, and click on 'Install or update firmware'.

<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img2.png" />
<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img3.png" />
<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img4.png" />

* Install **CircuitPython** in PiSquare
Insert the circuit python to the PiSquare(it is circuit python firmware "adafruit-circuitpython-raspberry_pi_pico-en_US-7.1.1.uf2"). for this first you need to press the boot button then connect the USB, don,t release the button until you connect the USB to the laptop. then you see a new device named "RPI-RP2" drag this file "adafruit-circuitpython- raspberry_pi_pico-en_US-7.1.1.uf2" to this device as shown in figure:
this is the official website, or you can download from here https://circuitpython.org/board/raspberry_pi_pico/
* Installing **CircuitPython** on the PiSquare

Download the AdaFruit CircuitPython firmware from here: https://circuitpython.org/board/raspberry_pi_pico/

Before connecting the PiSquare to your PC, press and hold the Boot button, then connect the USB. Don't release the button until you connect the USB your PC. Release the Boot button once you see a new 'drive' named "RPI-RP2".

Drag the UF2 file (e.g. "adafruit-circuitpython- raspberry_pi_pico-en_US-7.1.1.uf2") to this drive as shown below:

<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img13.png" />

The PiSquare will restart and a new 'drive' connected:

<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img13.png" />
When you properly insert the circuitpython then you see a new device that looks like the below image:-
<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img11.png" />

After this go to run->select interpreter,choose device and port
<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img18.png" />
<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img19.png" />
<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img20.png" />
In Thonny, select Run->Select Interpreter. Choose the 'CircuitPython (generic)' interpreter and the port the PiSquare is attached to.

<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img18.png" />

<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img19.png" />

<img src= "https://github.com/sbcshop/RoundyPi/blob/main/images/img20.png" />