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.read(); 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:
Name:
Email: (not shown)
Message: (Required)
Math Question: 38 + 77 = ? followed by the letter: Q 



About Me
More Blogs
Main Site
Posts:
2019 (1)
     Electronic dividing head
2018 (1)
     Thoughts on next RC blower
2017 (4)
     Crawl Space Forklift
     Remote Control Snowblower
     Servo control for linear actuator
     Arduino RC motor control
2016 (6)
     Keyboard Emulation
     Arduino w/ win2k
     Arduino Snowblower chute control
     Attic Fan Remote Control
     Robotic Arm
     ATTiny Watchdog
2015 (9)
     ESP-LINK Huzzah
     IoT Humidor v2
     Arduino Bugs
     Arduino INI library
     Arduino Yun
     long watchdog
     Arduino runtime config
     CNC Rotary table
     AutoWater humidifier
2014 (1)
     Humidor AutoWater
2013 (1)
     KeyPad Bruteforcer