Presentation is loading. Please wait.

Presentation is loading. Please wait.

Arxterra Telemetry Code Example is the Temperature Sensor from ATechTop Here is the setup subroutine of the original code from Sparkfun: #define TRUE 1.

Similar presentations


Presentation on theme: "Arxterra Telemetry Code Example is the Temperature Sensor from ATechTop Here is the setup subroutine of the original code from Sparkfun: #define TRUE 1."— Presentation transcript:

1 Arxterra Telemetry Code Example is the Temperature Sensor from ATechTop Here is the setup subroutine of the original code from Sparkfun: #define TRUE 1 #define FALSE #define debug TRUE #define aTechTop TRUE Temporarily add these four compiler directives at the top of your code. You will comment them out once your code is moved into the Arxterra framework. The delay(100) instruction suspends all processing for 1 second. Within the Arxterra framework which must receive commands, read and transmit sensor values, and control actuators, this delay is unacceptable. In the next slide we will replace the delay(100) instruction

2 Here the compiler directives have been added and the delay(100) instruction replaced by code which is functionally equivalent without delaying any other processes. Verify that your code still runs correctly. Your program is now ready to port to Arxterra Framework

3 Copy the modified.ino file into the arxrobot_firmware folder. The.ino file, in this case is called Temperature, will appear as a new tab. For testing purposes you may want to initially set the debug flag to TRUE. This sends output to the serial monitor. Set back to FALSE once your code is working. Next, open the arxrobot_firmware tab and add in your project’s name In this case the name is aTechTop Next, open the arxrobot_firmware tab and add in your project’s name In this case the name is aTechTop

4 In the Temperature tab, add the sendWordPacket subroutine This Arxterra subroutine can be found under the telemetry tab.

5 Referring to the previous slide and the picture shown here. In the blue box we see that the sendWordPacket subroutine contains two arguments: TEMP_SENSOR_ID temp (explanation is on the next slide) TEMP_SENSOR_ID is one of the telemetry IDs defined under the pinouts_robot.h tab.

6 The Temperature variable was defined in the original SparkFun code as having a data type of float The sendWordPacket subroutine’s second parameter is defined as a signed 2-byte integer. The line of code outlined in red defines temp as an integer and assigns its initial value to temperature cast as an integer. As introduced in the last slide (blue box), the sendWordPacket subroutine contains two arguments. On this slide we look at the second argument ( temp )

7 It is now time to remove the code initially added to make the Sparkfun code emulate the Arxterra framework (slide 1). In the Temperature tab comment out all the code shown in the Blue box. Next, comment out your setup(void) subroutine (brown box)

8 In the Temperature tab, move the code in the loop subroutine (green box) into the last part of the sendData() function, which is under the telemetry tab. As shown on the next slide.

9 Comment out the entire void loop(void) subroutine in the Temperature tab. At this point, the code should compile without any error.


Download ppt "Arxterra Telemetry Code Example is the Temperature Sensor from ATechTop Here is the setup subroutine of the original code from Sparkfun: #define TRUE 1."

Similar presentations


Ads by Google