How to connect arduino uno to mysql using the Mysql Connector/Arduino?
-
i want to query a mysql database on my laptop by ethernet using the arduino ethernet shield stacked on my arduino uno (laptop and arduino connected directly by ethernet )... everytime ...show more
-
Answer:
//#include "parsehttp_ino.h"; #include "Scheduler.h"; boolean com=false; void setup() { Serial.begin(115200); Sch.init(); Sch.addTask(led_flash,0,900,1); Sch.addTask(check_end,10,1000,1); Sch.start(); } void loop() { String command=""; if(!com){ command=get_command(); if(command=="on"){ com=true; //command=""; } else{ delay(4000); } } else{ Sch.dispatchTasks(); } } String get_command() { const char request[]="GET http://api.cduino.com/httpsqs/get.php?uid=ycf&sensor_name=LED%22; String response=get_response(request,false,0); //Serial.println("get command"); return response; } void check_end() { String command=get_command(); if(command=="off"){ led_down(); com=false; //command=""; } } void led_flash() { const unsigned int led = 10; pinMode( led,OUTPUT); digitalWrite( led,HIGH); } void led_down() { const unsigned int led = 10; pinMode( led,OUTPUT); digitalWrite( led,LOW); }
57QEEOIMT2AGDOK5BVPID2ZMYE at Yahoo! Answers Visit the source
Related Q & A:
- How To Build Business Directory Using Php Mysql?Best solution by Stack Overflow
- How To Connect Two Different Network Segments Using A Switch And A Router?Best solution by Super User
- How can I communicate Raspberry Pi and Arduino (in both ways) using a 10-15m distance wires?Best solution by Arduino
- How to connect to a Pervasive Database using javascript?Best solution by Stack Overflow
- How to store an image in database using MySQL?Best solution by stackoverflow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.