eChook GPT Documentation
  • Welcome to the eChook nano documentation
  • System Overview
  • The eChook Nano Kit
    • Versions
  • Build Instructions (Kit V1.x)
    • Build Steps Photos
    • First Power On
  • Build Instructions (Kit V2+)
  • Programming the Arduino
    • Install Arduino IDE
    • Arduino Drivers
    • Download the eChook Arduino Code
    • Programming the Arduino
  • Setting up the Bluetooth
    • Pairing with a phone
  • Connecting the eChook to the Car
    • Power and Voltage
    • Current Sensor
    • Throttle Input
    • External Buttons and Brake
    • Temperature Sensors
    • Wheel and Motor RPM
    • PWM Output
  • Calibrating the eChook
    • Wheel Speed and Motor RPM
    • Temperature
    • Voltage
    • Current
  • Using the App
    • Pair eChook to Phone
    • Setting up the App
    • Logging Data
    • Lap Counting
  • Telemetry (Live Data)
    • eChook Live Data
    • Node-Red Integration
    • DIY Web Dashboard
  • Using the Data
  • Circuit Schematics
    • 12 and 24v Inputs
    • Temperature Inputs
    • Bluetooth Module
    • Throttle Input
    • Current Input
    • Button Inputs
    • RPM Inputs
    • PWM Output
    • Power Regulator
    • Expansion Port
  • All about the Arduino nano
    • The eChook nano Code
  • Bluetooth Communication
    • Bluetooth Packet Encoding
    • Bluetooth Packet Decoding
  • Experimental Section
    • GUI Calibration
  • eChook Accessories
  • DIY eChook
  • Spare Parts
  • Troubleshooting
  • Contributing
Powered by GitBook
On this page
  • Constants
  • Setup

Was this helpful?

  1. All about the Arduino nano

The eChook nano Code

PreviousAll about the Arduino nanoNextBluetooth Communication

Last updated 6 years ago

Was this helpful?

The Arduino code for the eChook nano has been written with the aim of being as easy to understand as possible with clear comments throughout, however due to the number of things the arduino needs to do, there is a lot of code to sort through. This section aims to break each area of code down into manageable chunks.

N.B. Due to the nature of the project the code may have been updated, and the extracts in this document may not perfectly match.

The code for the eChook nano is available .

Constants

A large section of the code is dedicated to defining constants. The first batch are pin assignments. These give a function related name for each pin, otherwise it would be necessary to remember which pin number is connected to which input and output.

The second batch of constant definitions are values used in timings and calculations.

Setup

The setup function contains the first code run on the arduino after power on. As such it contains all the one-off setup procedures.

here