Arduino runtime config

Author: Dave
Date: 02.28.15 - 10:28am

let's say you have an Arduino sketch you want to distribute without hard coding in certain variables that are user configurable. You want to have the user just upload a sketch without needing to edit it, and you have some type of persistent storage such as an SD card or EEprom memory.

So how do you let user configure the sketchat runtime? below is some example code that will start you in the right direction. When the Arduino is first started it will go into a wait loop looking for serial input. If found it will enter a configuration screen allowing the user to set variables. These can then be saved.

you can also find an example of how to use a vb6 GUI app to configure and Arduino at runtime in my Rotary table Project.

int debug = 0;

void setup() { Serial.begin(9600); Serial.println("press any key to enter config..."); while(!Serial.available() && millis() < 4000) ; if( Serial.available() ){ while( Serial.available() ); Serial.print("entering config:\n debug value = "); while(debug==0){ debug = Serial.parseInt(); delay(200); } Serial.println(debug); } Serial.println("starting..."); }

Comments: (0)

Leave Comment:
Email: (not shown)
Message: (Required)
Math Question: 99 + 27 = ? followed by the letter: U 

About Me
More Blogs
Main Site
Electronic dividing head
Thoughts on next RC blower
Crawl Space Forklift
Remote Control Snowblower
Servo control for linear actuator
Arduino RC motor control
Keyboard Emulation
Arduino w/ win2k
Arduino Snowblower chute control
Attic Fan Remote Control
Robotic Arm
ATTiny Watchdog
IoT Humidor v2
Arduino Bugs
Arduino INI library
Arduino Yun
long watchdog
Arduino runtime config
CNC Rotary table
AutoWater humidifier
Humidor AutoWater
KeyPad Bruteforcer