Updated tracking to changes made in refactor-patch
This commit is contained in:
parent
2a50ecf864
commit
1a67ff7e33
@ -1,31 +1,38 @@
|
|||||||
# This code assumes the following:
|
|
||||||
# Daylight Sensor data-port points north
|
|
||||||
# Solar Panel data-port points east
|
|
||||||
|
|
||||||
alias sensor d0
|
alias sensor d0
|
||||||
alias v_angle r0
|
|
||||||
alias h_angle r1
|
|
||||||
|
|
||||||
define solar_panel_hash -539224550
|
alias angle_v r0
|
||||||
define heavy_solar_panel_hash -1545574413
|
alias angle_h r1
|
||||||
|
alias corr_angle r2
|
||||||
|
|
||||||
|
# define directions of sensor and panel power ports
|
||||||
|
define sensor_data_angle 0
|
||||||
|
define panel_power_angle 90
|
||||||
|
|
||||||
|
# define panel hashes
|
||||||
|
define basic_1_panel -2045627372
|
||||||
|
define basic_2_panel -539224550
|
||||||
|
define heavy_1_panel -934345724
|
||||||
|
define heavy_2_panel -1545574413
|
||||||
|
|
||||||
|
# calculate horizontal correction
|
||||||
|
sub corr_angle sensor_data_angle panel_power_angle
|
||||||
|
sub corr_angle corr_angle 90
|
||||||
|
|
||||||
start:
|
start:
|
||||||
# Calculate vertical angle
|
|
||||||
l v_angle sensor Vertical
|
|
||||||
div v_angle v_angle 1.5
|
|
||||||
sub v_angle 50 v_angle
|
|
||||||
|
|
||||||
# Write vertical angle to all solar panels
|
|
||||||
sb solar_panel_hash Vertical v_angle
|
|
||||||
sb heavy_solar_panel_hash Vertical v_angle
|
|
||||||
|
|
||||||
# Obtain horizontal angle
|
|
||||||
l h_angle sensor Horizontal
|
|
||||||
|
|
||||||
# Write vertical angle to all solar panels
|
|
||||||
sb solar_panel_hash Horizontal h_angle
|
|
||||||
sb heavy_solar_panel_hash Horizontal h_angle
|
|
||||||
|
|
||||||
# Go to start again
|
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
l angle_v sensor Vertical
|
||||||
|
sub angle_v 90 angle_v
|
||||||
|
l angle_h sensor Horizontal
|
||||||
|
add angle_h angle_h corr_angle
|
||||||
|
|
||||||
|
sb basic_1_panel Vertical angle_v
|
||||||
|
sb basic_2_panel Vertical angle_v
|
||||||
|
sb heavy_1_panel Vertical angle_v
|
||||||
|
sb heavy_2_panel Vertical angle_v
|
||||||
|
sb basic_1_panel Horizontal angle_h
|
||||||
|
sb basic_2_panel Horizontal angle_h
|
||||||
|
sb heavy_1_panel Horizontal angle_h
|
||||||
|
sb heavy_2_panel Horizontal angle_h
|
||||||
|
|
||||||
j start
|
j start
|
Loading…
Reference in New Issue
Block a user