Line calibration fixed
This commit is contained in:
parent
9dd690c5f4
commit
594ca5d54b
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@
|
||||
esp32*.bin
|
||||
# ignore the development config file
|
||||
config-dev.json
|
||||
nginx-nchan/
|
||||
|
4
Makefile
4
Makefile
@ -6,6 +6,7 @@ SERIAL_PORT=/dev/ttyUSB0
|
||||
|
||||
all: flash delay libs config update reset
|
||||
upload: config update reset console
|
||||
files: delete libs update config delay reset
|
||||
|
||||
delay:
|
||||
sleep 3
|
||||
@ -23,6 +24,9 @@ update:
|
||||
ampy -p $(SERIAL_PORT) put main.py
|
||||
ampy -p $(SERIAL_PORT) put boot.py
|
||||
|
||||
delete:
|
||||
ampy -p $(SERIAL_PORT) rm main.py
|
||||
|
||||
config:
|
||||
ampy -p $(SERIAL_PORT) put config.json
|
||||
|
||||
|
@ -17,9 +17,9 @@
|
||||
"left_line_threshold": 4500,
|
||||
"middle_line_threshold": 4500,
|
||||
"right_line_threshold": 4500,
|
||||
"motors_reverse": 1,
|
||||
"motors_reverse": 0,
|
||||
"sumo_server": "sumo.koodur.com:80",
|
||||
"wifis": {
|
||||
"SSID": "PAROOL"
|
||||
"sumo": ""
|
||||
}
|
||||
}
|
||||
|
4
hal.py
4
hal.py
@ -49,7 +49,7 @@ class Sumorobot(object):
|
||||
self.playStop = Pin(self.config["paly/stop_button_pin"], Pin.IN, Pin.PULL_UP)
|
||||
|
||||
|
||||
self.led_power.value(0)
|
||||
self.led_power.value(1)
|
||||
|
||||
self.adc_line_left = ADC(Pin(32))
|
||||
self.adc_line_middle = ADC(Pin(35))
|
||||
@ -126,7 +126,7 @@ class Sumorobot(object):
|
||||
self.config["middle_line_threshold"] = self.adc_line_middle.read()
|
||||
# Update the config file
|
||||
with open("config.part", "w") as config_file:
|
||||
config_file.write(ujson.dumps(config))
|
||||
config_file.write(ujson.dumps(self.config))
|
||||
os.rename("config.part", "config.json")
|
||||
|
||||
# Function to get light inensity from the phototransistors
|
||||
|
Loading…
Reference in New Issue
Block a user