Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

finnweiler/mm-sorting-machine-simulation

Repository files navigation

mm-sorting-machine-simulation

This application simulates a physical device to sort M&Ms by their color. It receives input through the GPIO pins to control a browser-based physics simulation of the device. It was utilized during the development of a project within a low-level programming lecture.

Installation

update & upgrade:

  1. sudo apt-get update
  2. sudo apt-get dist-upgrade

install node:

  1. curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
  2. sudo apt-get install -y nodejs

check if node is installed:

  1. node -v

clone the github repo:

  1. git clone [email protected]:finnweiler/mm-sorting-machine-simulation.git

install npm dependencies:

  1. npm install

Run

To run the simulation:

sudo node index.js

You can now open your browser and enter your Raspberry Pi's hostname (for example: http://raspberry-pi-zero/)

Demo

demo image demo image2

Notes

If your are running the simulation of the sorting machine and your code to control it on the same pi, you need to configure the inputs to be outputs within your code. Otherwise the simulation will not be able to set the GPIO pins. Remember to change this back when you connect a physical machine.

@ REVERSED INPUTS
            @Pins 9  8  7  6  5  4  3  2  1  0
ldr     r0, =#0b001001001001001001001001000000
str     r0, [GPIOREG] @Function Select Register 0 (Pin 0 - 9)

            @    19 18 17 16 15 14 13 12 11 10
ldr     r0, =#0b001000001001000000001001001001
str     r0, [GPIOREG, #4] @Function Select Register 1 (Pin 10 - 19) 

            @          27 26 25 24 23 22 21 20
ldr     r0, =#0b000000001001000001001001001001
str     r0, [GPIOREG, #8] @Function Select Register 1 (Pin 20 - 29)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published