Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Getting Energia to run another program with command line

$
0
0

Hi there,

 

I'm trying to get Energia to run another program using command line. The idea is that it sends data based on readings the chip makes through microphones, and sends it to another program.

 

(The other program is able to then analyse the data more easily)

 

Ive written code in C which is able to run the other program from within Energia's project folder, but when I run exactly the same code by compiling and uploading to the chip (tiva c series tm4c1294),

the code does absolutely nothing.

 

***********Main .INO***********

#include "EnergiaC.c"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
void setup()
{
  Serial.begin(9600);  
}
 
void loop()
{
  run();
  return;
}
 
 
********ENERGIAC.c***********
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
int run()
  char command[100];  
  strcpy(command, "cd..&CtoPython.exe triangulation main 5");
  system(command);
  return 0;
}
 
 
When switching EnergiaC.c's run function to main and compiling with visual studio's compiler, this works perfectly, which means that the root of the problem probably lies with the location Energia puts its compiled code. 
 
Any ideas on where this is and how to navigate from it to the folder outside the project folder?
 

Viewing all articles
Browse latest Browse all 2077

Trending Articles