9 axes motion shield - arduino

I am having some issues getting stock code to compile for my 9 axes motion shield. I have a github repository with all of the motion libraries I have, the example code, and the error messages I am getting.
I am using Arduino 1.7.1 IDE on Windows 7 64-bit.
I have tried using sample code for the sensor instead of for the shield and could not get that to compile either. I have tested example code built into the IDE to ensure that I can compile something and I was even able to interface with my Arduino MEGA 2560 with said code.
I have searched Google and Stack exchange a fair bit and have not managed to come up with any solutions.
The main error I can not figure out is:
"
C:\Users\LJI_eric\Documents\Arduino\sketch_mar20a\sketch_mar20a.ino: In function 'void setup()':
sketch_mar20a:63: error: 'OPERATION_MODE_NDOF' was not declared in this scope
mySensor.setOperationMode(OPERATION_MODE_NDOF);"
OPERATION_MODE_NDOF is a mode that is defined in BNO055.h and is an array of operation modes. I tried several other modes to no avail.
I would appreciate any and all help.

On line 84, 87 and 91 you have made a new line inside a string. You can not do that on the Arduino. If you want to break a string up in more lines you should end the string where you would break it, and start the string again on the new line, like this.
Serial.println("Move the device around and then place it at one position.\n"
"Change the threshold and duration to increase the difficulty level.");
Then you should change OPERATION_MODE_NDOF to BNO055_OPERATION_MODE_NDOF

Related

Initial EEPROM contents in Atmega644

I am working on a project using a Atmega644 and want to include EEPROM data in the initial programming.
I am using MPLAB X and the XC8 compiler (version 2.31) and for programming I am using a PICkit4.
I know that the xc8 compiler for PIC MCUs has the __EEPROM_DATA() macro, that would be pretty much perfect for my usecase. The AVR version of the compiler, however does not appear to have this macro (I tried both with and without CCI syntax...), as it does not recognize the call and just throws an error when trying to compile.
I have looked through the manual for the compiler, but it does not list any macros/functions to do this.
I tried adding the macro myself, by copying it from the PIC compiler to a header in my project, but it seems to contain assembly instructions that do not exist on the atmega and I couldn't even find those in documentation for the PIC (Otherwise I would have tried to find an equivalent instruction and replace them)...
Is there another way to include the initial EEPROM data in the project, so it gets written to the mcu during programming?
__EEPROM_DATA() macro is supported only for 8-bit PIC baseline and mid-range devices. There is also __eeprom qualifier to position variables in EEPROM. But none of these are for AVR chips.
Microchip supports AVR chips in XC8 using avr headers. There is an eeprom header which has some macros defined. One of these macros is EEMEM. You can use it to set EEPROM values at programming time. Here is how you use it:
#include <avr/eeprom.h>
char EEMEM nums[] = { 1, 2, 3, 4, 5 };
There is good information regarding the usage of this macro in this and this SO answers. Make sure to have a look at them.
I also recommend you to take a look at MPLAB XC8 C Compiler User's Guide for AVR MCU in case you didn't know about it.

AT Command to change frame size gives ERROR

I'm using a SIM900A GSM Shield to communicate between an arduino due and an API.
I currently using it's default values in the multiplexer of GSM Shield. But now I'm in need of changing it's frame size to 255. When I check the current frame size, it gives following response which indicates the frame size as 127.
CMUX Read:AT+CMUX?
+CMUX: 0,0,5,127,10,3,30,10,2
OK
Then I used following AT command to change it to 255. But it gives an ERROR.
sim900_send_cmd("AT+CMUX=0[,0[,1[,255[,10[,3[,30[,10[,2]]]]]]]]\r\n");
CMUX Read:AT+CMUX=0[,0[,5[,255[,10[,3[,30[,10[,2]]]]]]]]
ERROR
What am I doing wrong here ? am I missing a step ? Any insight will be much appreciated. Thank you
I'm not an expert in AT commands, but I bet you don't need all the brackets in yours. Brackets are used to indicate parameters which could be omitted. So your command should look like this:
CMUX Read:AT+CMUX=0,0,5,255,10,3,30,10,2
Maybe even a shoter version will work:
CMUX Read:AT+CMUX=0,0,5,255

G510 FIBOCOM some at commands return ERROR in some commands

I use two FIBOCOM G510 GSM modems but one of them returns ERROR in some commands like:
AT+CMGF=1\r, AT+CPIN=? returns ERROR.
But some like ATE0\r, AT+CLIP=1\r, AT+CBAUD?\r returns OK.
I use baudrate 115200.
Q1:ATE0\r
R1:\r\nOK\r\n
Q2:AT+CBAUD?\r
R2:\r\n+CBAUD: 115200\r\n\r\nOK\r\n
Q3:AT+CPIN=?
R3:\r\nERROR\r\n
Q4:AT+CMGF=1
R4:\r\nERROR\r\n
Is there something I should set first or is it simcard issue or modem fault?
My other unit works good but I tested it 3 months ago and I think I would use some additional commands to prepare.
I am confuse what's its wrong?
I checked sim card wiring for 3rd time and I found cardinal mistake. Socket was upside down and even wires was connected to the "right place" it did not comunicate.
After rewiring modem starts to work well.
Q5:AT+CPIN?\r
R5:\r\n+CPIN: READY\r\n\r\nOK\r\n

Coding errors between the Arduino Uno and SDI-12 interface on Decagon Devices

I have been working on a project recently using a sensor for electrical conductivity in soil (A 5TE sensor from Decagon Devices) with my Arduino Uno. I am ready to code, and found this example code on GitHub (the example code is there when you scroll down the page). When trying to run it on the latest version of Arduino, it gave me these compilation errors:
sketch_dec15a:7: error: expected initializer before 'void'
sketch_dec15a:4: error: 'SDISerial' does not name a type
sketch_dec15a:9: error: expected initializer before 'void'
sketch_dec15a.ino: In function 'void loop()':
sketch_dec15a:22: error: 'connection' was not declared in this scope
NOTE: I believe I installed the library correctly, but am not 100% certain...more like 85%.
What's wrong with the code and how can it be made to work?
The example code is wrong. Look at the compilation errors. The first thing it says is:
sketch_dec15a:7: error: expected initializer before 'void'
So what it's saying is that it found something that said void and expected to see something else first. void occurs only twice in your code, so we can't be far. Let's take a look at the code immediately surrounding it the first void:
char tmp_buffer[4];
char sensor_info[]
//initialize variables
void setup(){
connection.begin();
Serial.begin(9600);//so we can print to standard uart
//small delay to let the sensor do its startup stuff
delay(3000);//3 seconds should be more than enough
}
Right before the void setup(){ is //initialize variables. That's just a comment, and not code, so it doesn't relly count. Looking back one more line we see:
char sensor_info[]
Something is wrong with that line. Work on it and see if you can figure it out (check the other lines for "hints"). If you can't figure it out, the answer is right below (put your mouse over it to see it):
It needs a semicolon ";" at the end to complete the statement. Because the semicolon is missing, it thinks "void setup(){" is part of the previous statement.

abap runtime error program line too long

Good day. The programs function is to take an equipment number (or none), display that number with a description (or all) in alv, and then run IE03 should the user double click on
Program worked fine in client 110, but in 150 a runtime error happens. This morning I tried to make a new program with a shorter name (only lead I had), activated it (window popped up asking me to activate the previous version as well). That didn't work and now the original doesn't work in either.
The program "SAPLSKBH" is terminating because program line is too long, being 78 chars wide which is too much for the internal table "\FUNCTION=K_KKB_FIELDCAT_MERGE\DATA=L_ABAP_SOURCE[]"
It sounds like you are using REUSE_ALV_GRID_DISPLAY for output, is that correct?
Check you source code; somewhere you have a line that is more than 78 characters. The function K_KKB_FIELDCAT_MERGE takes the source code of your program to produce a structure that corresponds to the table/structure you give it. (In the old days, there was a limit of 78 characters width for a line of ABAP code, and this is an old function module).
You can alternatively build a field catalog yourself in code, rather than use this function.

Resources