Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18146

Re: Include a python script in sketch folder

$
0
0

Hi X_Y,

 

I apologize for the delay in my response. Take a look at the sketch below, in this way you can create, write, read and execute a python script from an Arduino sketch. I hope you find this helpful.

 

void setup() {  // put your setup code here, to run once:  FILE * fp;  fp = fopen("/home/root/hello.py", "w");  fprintf(fp, "print \"Hello World!\"\n");  fprintf(fp, "print \"This is python script\"\n");  fclose(fp);  delay(5000);  Serial.begin(9600);  system("python /home/root/hello.py > /dev/ttyGS0");
 }
void loop() {  // put your main code here, to run repeatedly:
 }

 

Regards,
  JPMontero_Intel


Viewing all articles
Browse latest Browse all 18146

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>