Presentation is loading. Please wait.

Presentation is loading. Please wait.

BalloonSat Mini Flight Computer Programming. label: An address, or location for the program to jump to Must end in a colon Can be any name, but not a.

Similar presentations


Presentation on theme: "BalloonSat Mini Flight Computer Programming. label: An address, or location for the program to jump to Must end in a colon Can be any name, but not a."— Presentation transcript:

1 BalloonSat Mini Flight Computer Programming

2 label: An address, or location for the program to jump to Must end in a colon Can be any name, but not a command No spaces allowed, use an underline in place of a space Can’t begin with a number

3 PAUSE time Halts program execution for a number of milliseconds (1/1,000 of a second) Used to prevent the program from finishing in a fraction of a second

4 HIGH C.2 and LOW C.2 Used to trigger the camera HIGH activates the relay which is the camera’s new shutter switch Keep HIGH for about 1 second (PAUSE 1000) LOW turns off the relay (camera needs you to release the shutter)

5 IF PINC.3 = n label Monitors the Commit Pin Conditional jump, only occurs if condition is true Prevents flight computer from recording data until ready for launch n can be either a 0 or a 1 IF PINC.3 = 0 then Commit Pin is in place IF PINC.3 = 1 then Commit Pin is removed

6 READADC i/o,Bx Converts analog sensor voltage to a digital value Linear conversion: 0V = 0 and 5V = 255 Specifies the I/O pin (either C.1 or C.4) to digitize Specifies the RAM memory to store the result (B0 to B27)

7 Write Bn, x Writes a variable from temporary RAM into permanent Data Memory RAM variable can be B0 to B27 Data Memory address runs from 0 to 255

8 READ x,Bn Reads data from permanent Data Memory into temporary RAM Required to send the data via SERTXD Data Memory address runs from 0 to 255 RAM variable can be B0 to B27

9 SERTXD “text”, Bn Writes variable from RAM to the PC Writes text (must enclose text in quotes) Use the PICAXE Terminal program (F8) Set Terminal for 4800 baud

10 GOTO label Jumps program execution to the label Unconditional jump, happens as soon as command is executed

11 FOR Bn = x TO y Loop control, makes program repeat itself Saves program memory, a short program can be repeated many times without writing the program many times (maximum of 255 times) Bn is the RAM variable that monitors how many times the loop of code has been repeated x is the starting number y is the finishing number

12 NEXT Placed at the end of the lines of code repeated by the FOR command Indicates the end of the repeated code Easier to read program if the lines of code between the FOR and NEXT are indented


Download ppt "BalloonSat Mini Flight Computer Programming. label: An address, or location for the program to jump to Must end in a colon Can be any name, but not a."

Similar presentations


Ads by Google