mirror of
https://github.com/brendanhaines/ECEN5458_Project.git
synced 2025-01-29 11:07:40 -07:00
move some stuff around
This commit is contained in:
parent
7f2e8498a6
commit
fa6a1b1d30
|
@ -42,13 +42,6 @@ servos[2].throttle = 0
|
|||
white_cal = [0]*8
|
||||
black_cal = [5]*8
|
||||
|
||||
# Initialize Brightness
|
||||
brightness_idx = np.arange(8)
|
||||
brightness = [get_normalized_reflectivity(c) for c in range(8)]
|
||||
|
||||
# Initialize Log
|
||||
time_data = np.empty((0, 3)) # [[t, e, c]]
|
||||
|
||||
def get_reflectivity(chan):
|
||||
global mux_io
|
||||
global adc_mux
|
||||
|
@ -67,6 +60,13 @@ def get_normalized_reflectivity(chan):
|
|||
global black_cal
|
||||
return (get_reflectivity(chan) - black_cal[chan]) / (white_cal[chan] - black_cal[chan])
|
||||
|
||||
# Initialize brightness data
|
||||
brightness_idx = np.arange(8)
|
||||
brightness = [get_normalized_reflectivity(c) for c in range(8)]
|
||||
|
||||
# Initialize time data
|
||||
time_data = np.empty((0, 3)) # [[t, e, c]]
|
||||
|
||||
# Create sources for plots
|
||||
brightness_plot_source = ColumnDataSource(data=dict(sensor=brightness_idx, brightness=brightness))
|
||||
time_plot_source = ColumnDataSource(data=dict(t=time_data[:,0], e=time_data[:,1], c=time_data[:,2]))
|
||||
|
|
Loading…
Reference in New Issue
Block a user