Giter Site home page Giter Site logo

karmakamikaze / step Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 32.95 MB

STEP is an imperative and type-safe programming language for Arduino. It is beginner friendly and targets students in the range of 8 to 16 years. It promotes structured programming, and supports simple single-run terminal programs and continuous Arduino programs.

License: MIT License

ANTLR 1.31% C# 98.44% C++ 0.26%
arduino arduino-uno compiler compiler-design programming-language step

step's Introduction

STEP (Step Towards Effective Programming)

STEP is an imperative and type-safe programming language for Arduino. It is beginner friendly and targets students in the range of 8 to 16 years. It promotes structured programming, and supports simple single-run terminal programs and continuous Arduino programs.

Writing your first program

  1. Familiarize yourself with the structure of a STEP program

An empty STEP program might look like this:

variables

end variables

setup

end setup

loop

end loop

functions

end functions

There are four main scopes. It is mandatory to provide either setup or loop - the rest are optional.

  1. Understand the scopes
Scope name Description
variables Contains global variable declarations 1
setup Contains code that should be run at initialization of program
loop Contains code that will run repeatedly until Arduino device is turned off
functions Contains function definitions 2
  1. Understand the keywords, statements and control structures

STEP is formally documented in the development journal.

  1. Hello, world!
setup
    Print("Hello, world!")
end setup

Getting started

To get a local copy up and running, follow these steps.

Dependencies

The project is dependant on the Arduino-CLI.

Installation

  1. Clone the repository
git clone https://github.com/KarmaKamikaze/STEP.git
  1. Navigate to the root folder and create a new ArduinoCLI directory, then enter it
cd STEP/STEP/ && mkdir ArduinoCLI && cd ArduinoCLI/
  1. Download the Arduino-CLI for your preferred operating system from this source and place it inside the new folder:

Linux:

wget https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz

Windows:

wget https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Windows_64bit.zip

macOS:

wget https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_macOS_64bit.tar.gz
  1. Extract the zipped folder to attain the arduino-cli executable

Linux:

tar –xvzf arduino-cli_latest_Linux_64bit.tar.gz

Windows:

tar –xvzf arduino-cli_latest_Windows_64bit.zip

macOS:

tar –xvzf arduino-cli_latest_macOS_64bit.tar.gz
  1. Install the arduino avr-gcc compiler
./arduino-cli.exe core install arduino:avr
  1. ??? Profit

Using the compiler

  1. Familiarize yourself with the compiler arguments
Argument Description
-print Prints the source code in the terminal
-upload [port] Uploads the compiled code to the arduino device 3
-output [port] Displays arduino serial output in terminal 3 4
-ports Displays what devices are connected to which ports
  1. Run the compiler

Linux & macOS:

./STEP [sourcefile] [args]

Windows:

./STEP.exe [sourcefile] [args]

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Project Link: https://github.com/KarmaKamikaze/STEP

Footnotes

  1. A global variable is accessible from anywhere in the program

  2. A procedure that can be executed from anywhere in the program

  3. If no port is supplied, the compiler attempts to guess the correct port 2

  4. The output argument can be used seperately to display the output of an already uploaded program on the arduino. It can also be specified in combination with the upload argument to enter monitor mode immediately after porting the program to the arduino.

step's People

Contributors

karmakamikaze avatar damniko avatar sarmisuper avatar mirakst avatar wassawroki avatar selectionator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.