Custom Menus to Switch things on and off from Android -- No programming at all.
this complete beginners.
the latest version of pfoddesigner lets design custom menus on android mobile , generates arduino code necessary display menus on mobile (via pfodapp) , switch arduino outputs on , off.
absolutely no programming required. no arduino programming , no android programming. done you.
here example design.

see full tutorial @ http://www.forward.com.au/pfod/pfoddesigner/onoffexample/index.html
the steps are:-
step 1) download pfoddesigner app android mobile https://play.google.com/store/apps/details?id=au.com.forward.pfoddesigner
step 2) use pfoddesigner design menu, add prompt, add on/off toggle buttons, choose digital outputs control, set text, font size, colour , background colors. see interactive preview of design go.
step 3) choose serial connection use , baud rate suit hardware
step 4) click write code file button generate all arduino code need show menu , switch arduino outputs when click buttons.
step 5) copy file computer , upload arduino board. add bluetooth shield , connect using pfodapp https://play.google.com/store/apps/details?id=au.com.forward.pfodapp
finished!!
the final design

options changing on/off toggle menu items

more options changing on/off toggle menu items

the pfoddesigner includes each screen , there detailed tutorial, noted above, post here or contact pfoddesigner support if need assistance.
the latest version of pfoddesigner lets design custom menus on android mobile , generates arduino code necessary display menus on mobile (via pfodapp) , switch arduino outputs on , off.
absolutely no programming required. no arduino programming , no android programming. done you.
here example design.

see full tutorial @ http://www.forward.com.au/pfod/pfoddesigner/onoffexample/index.html
the steps are:-
step 1) download pfoddesigner app android mobile https://play.google.com/store/apps/details?id=au.com.forward.pfoddesigner
step 2) use pfoddesigner design menu, add prompt, add on/off toggle buttons, choose digital outputs control, set text, font size, colour , background colors. see interactive preview of design go.
step 3) choose serial connection use , baud rate suit hardware
step 4) click write code file button generate all arduino code need show menu , switch arduino outputs when click buttons.
step 5) copy file computer , upload arduino board. add bluetooth shield , connect using pfodapp https://play.google.com/store/apps/details?id=au.com.forward.pfodapp
finished!!
the final design

options changing on/off toggle menu items

more options changing on/off toggle menu items

the pfoddesigner includes each screen , there detailed tutorial, noted above, post here or contact pfoddesigner support if need assistance.
first, sorry english language, serbia.
yesterday, bought little gem of software via slideme. installed of necessary software, make first example , result on phone:

my code follows:
i using arduino pro mini 3.3v, hc-05 bluetooth module , samsung galaxy note. guess fist line of code place problem hidden, cannot understand characters for.
bluetooth module ok, since other examples net running fine.
hope can me, since there no similar problem described on site.
thanks in advance. best regards serbia.
yesterday, bought little gem of software via slideme. installed of necessary software, make first example , result on phone:

my code follows:
code: [select]
/* ===== pfod command arcade control ====
{.<l><+2><b>arcade control|p~<r><+1><b>power `0~~off\on|l~<w><+1><b>lights `0~~off\on|s~<l><+1><b>sound `0~~off\on|z~<y><+1><b>*****|c~<a><+1><b>insert coin}
*/
// using uart serial running @ 9600 send , receive
// serial d0 (rx) , d1 (tx) on arduino uno, micro, promicro, due, mega, mini, nano, pro , ethernet
/* code generated pfoddesigner v1.2.521
* (c)2014 forward computing , control pty. ltd.
* nsw australia, www.forward.com.au
* generated code may freely used both private , commerical use
*/
// ======================
// pfodparser.h file comments, constants , un-used methods removed
class pfodparser {
public:
pfodparser();
void init();
byte parse(byte in);
byte* getcmd();
byte* getfirstarg();
byte getargscount();
byte* parselong(byte* idxptr, long *result);
private:
byte argscount; byte argsidx; byte parserstate; byte args[255];
};
//============= end of pfodparser.h
pfodparser parser; // create parser handle pfod messages
// give board pins names, if change pin number here change pin controlled
int cmd_p_pin = 4; // name output pin 'power '
int cmd_l_pin = 5; // name output pin 'lights '
int cmd_s_pin = 6; // name output pin 'sound '
// setup routine runs once on reset:
void setup() {
serial.begin(9600);
(int i=3; i>0; i--) {
// wait few secs see if being programmed
delay(1000);
}
//pinmode(cmd_p_pin, input_pullup);
pinmode(cmd_p_pin, output); // output 'power ' low, uncomment line above if want high
//pinmode(cmd_l_pin, input_pullup);
pinmode(cmd_l_pin, output); // output 'lights ' low, uncomment line above if want high
//pinmode(cmd_s_pin, input_pullup);
pinmode(cmd_s_pin, output); // output 'sound ' low, uncomment line above if want high
// <<<<<<<<< setup code goes here
}
// loop routine runs on , on again forever:
void loop() {
if (serial.available()) {
byte in = serial.read(); // read next char
byte cmd = parser.parse(in); // pass parser
// parser returns non-zero when pfod command parsed
if (cmd != 0) { // have parsed complete msg { }
byte* pfodfirstarg = parser.getfirstarg(); // may point \0 if no arguments in msg.
long pfodlongrtn; // used parsing long return arguments, if any
if ('.' == cmd) {
// pfodapp has connected , sent {.} , asking main menu
// send menu designed
sendmainmenu();
// handle commands returned button/sliders
} else if('p'==cmd) { // user moved slider -- 'power '
// set output based on slider 0 == low, 1 == high
parser.parselong(pfodfirstarg,&pfodlongrtn); // parse first arg long
digitalwrite(cmd_p_pin,pfodlongrtn); // set output
sendmainmenuupdate(); // send pfod msg otherwise pfodapp disconnect.
} else if('l'==cmd) { // user moved slider -- 'lights '
// set output based on slider 0 == low, 1 == high
parser.parselong(pfodfirstarg,&pfodlongrtn); // parse first arg long
digitalwrite(cmd_l_pin,pfodlongrtn); // set output
sendmainmenuupdate(); // send pfod msg otherwise pfodapp disconnect.
} else if('s'==cmd) { // user moved slider -- 'sound '
// set output based on slider 0 == low, 1 == high
parser.parselong(pfodfirstarg,&pfodlongrtn); // parse first arg long
digitalwrite(cmd_s_pin,pfodlongrtn); // set output
sendmainmenuupdate(); // send pfod msg otherwise pfodapp disconnect.
} else if('z'==cmd) { // user pressed -- '*****'
// << add action code here button
sendmainmenuupdate(); // send pfod msg otherwise pfodapp disconnect.
} else if('c'==cmd) { // user pressed -- 'insert coin'
// << add action code here button
sendmainmenuupdate(); // send pfod msg otherwise pfodapp disconnect.
} else {
// unknown command
serial.print(f("{}")); // send pfod msg otherwise pfodapp disconnect.
}
}
}
}
void sendmainmenu() {
serial.print(f("{.")); // start menu screen pfod message
send_menucontents(); // send menu contents
serial.print(f("}")); // close pfod message
}
void sendmainmenuupdate() {
serial.print(f("{:")); // start update menu pfod message
send_menucontents(); // send menu contents
serial.print(f("}")); // close pfod message
}
// modify method if need update menu reflect state changes
void send_menucontents() {
// send menu prompt
serial.print(f("<l><+2><b>arcade control"));
// send menu items
serial.print(f("|p~<r><+1><b>power `"));
serial.print(digitalread(cmd_p_pin)); // read current output state 0 low or 1 high
serial.print(f("~~off\\on")); // note \\ inside "'s send \
serial.print(f("|l~<w><+1><b>lights `"));
serial.print(digitalread(cmd_l_pin)); // read current output state 0 low or 1 high
serial.print(f("~~off\\on")); // note \\ inside "'s send \
serial.print(f("|s~<l><+1><b>sound `"));
serial.print(digitalread(cmd_s_pin)); // read current output state 0 low or 1 high
serial.print(f("~~off\\on")); // note \\ inside "'s send \
serial.print(f("|z~<y><+1><b>*****"));
serial.print(f("|c~<a><+1><b>insert coin"));
// ============ end of menu item ===========
}
//============================ can remove here on if have pfodparser library installed
// , use #include <pfodparser.h> @ top of file
// pfodparser.cpp file comments, constants , un-used methods removed
pfodparser::pfodparser() {
init();
}
void pfodparser::init() {
argscount = 0;
argsidx = 0;
args[0] = 0;
args[1] = 0;
parserstate = ((byte)0xff);
}
byte* pfodparser::getcmd() {
return args;
}
byte* pfodparser::getfirstarg() {
byte* idxptr = args;
while( *idxptr != 0) {
++idxptr;
}
if (argscount > 0) {
++idxptr;
}
return idxptr;
}
byte pfodparser::getargscount() {
return argscount;
}
byte pfodparser::parse(byte in) {
if ((parserstate == ((byte)0xff)) || (parserstate == ((byte)'}'))) {
parserstate = ((byte)0xff);
if (in == ((byte)'{')) {
init();
parserstate = ((byte)'{');
}
return 0;
}
if ((argsidx >= (255-2)) &&
(in != ((byte)'}'))) {
init();
return 0;
}
if (parserstate == ((byte)'{')) {
parserstate = ((byte)0);
}
if ((in == ((byte)'}')) || (in == ((byte)'|')) || (in == ((byte)'~')) || (in == ((byte)'`'))) {
args[argsidx++] = 0;
if (parserstate == ((byte)0xfe)) {
argscount++;
}
if (in == ((byte)'}')) {
parserstate = ((byte)'}'); // reset state
return args[0];
} else {
parserstate = ((byte)0xfe);
}
return 0;
}
args[argsidx++] = in;
return 0;
}
byte* pfodparser::parselong(byte* idxptr, long *result) {
long rtn = 0;
boolean neg = false;
while ( *idxptr != 0) {
if (*idxptr == '-') {
neg = true;
} else {
rtn = (rtn<<3) + (rtn<<1);
rtn = rtn + (*idxptr-'0');
}
++idxptr;
}
if (neg) {
rtn = -rtn;
}
*result = rtn;
return ++idxptr;
}
// ============= end generated code =========
i using arduino pro mini 3.3v, hc-05 bluetooth module , samsung galaxy note. guess fist line of code place problem hidden, cannot understand characters for.
bluetooth module ok, since other examples net running fine.
hope can me, since there no similar problem described on site.
thanks in advance. best regards serbia.
Arduino Forum > Topics > Home Automation and Networked Objects > Custom Menus to Switch things on and off from Android -- No programming at all.
arduino
Comments
Post a Comment