Understanding the language, error messages, etc.
by jackB » Sat Aug 09, 2014 12:48 pm
Why it doesn' t work ?
- Code: Select all
#define load_game (*((void(*)(const char* filename))(0x7ffc/2)))
void setup() {
Serial.begin(9600);
Serial.println("Send a char to start...");
char name[]="BLINK";
}
void loop() {
if (Serial.available()) {
Serial.read();
load_game(name);
}
}
-
jackB
-
- Posts: 4
- Joined: Wed Jul 23, 2014 7:31 pm
by rodot » Sat Aug 09, 2014 12:51 pm
Probably because you don't have a program named BLINK.HEX on your micro SD card?
-
rodot
- Site Admin
-
- Posts: 1290
- Joined: Mon Nov 19, 2012 11:54 pm
- Location: France
-
by jackB » Mon Aug 11, 2014 1:29 pm
When i write this it works..
- Code: Select all
#define load_game (*((void(*)(const char* filename))(0x7ffc/2)))
void setup() {
Serial.begin(9600);
Serial.println("Send a char to start...");
}
void loop() {
if (Serial.available()) {
Serial.read();
load_game("BLINK");
}
}
But when i write this it doesn' t work
- Code: Select all
#define load_game (*((void(*)(const char* filename))(0x7ffc/2)))
void setup() {
Serial.begin(9600);
Serial.println("Send a char to start...");
}
char name[]="BLINK";
void loop() {
if (Serial.available()) {
Serial.read();
load_game(name);
}
}
Why?
-
jackB
-
- Posts: 4
- Joined: Wed Jul 23, 2014 7:31 pm
by ripper121 » Mon Aug 11, 2014 1:49 pm
do you have test String name = "BLINK"; ?
-
ripper121
-
- Posts: 224
- Joined: Fri Apr 04, 2014 2:02 pm
- Location: Germany
by Myndale » Tue Aug 12, 2014 7:51 pm
jackB wrote:But when i write this it doesn' t work
Are you sure you're using the latest version of the Arduino IDE and compiler? You're not using a compiler that's placing the global char[] in PROGMEM by any chance?
-
Myndale
-
- Posts: 507
- Joined: Sat Mar 01, 2014 1:25 am
Return to Programming Questions
Who is online
Users browsing this forum: No registered users and 66 guests