Debugging

pull/1/head
Julius Riegel 7 years ago
parent f82b44397b
commit 56ddd9022d

@ -3,6 +3,8 @@
<component name="ChangeListManager">
<list default="true" id="49388e57-2b9e-468a-b880-1d7fb243112d" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/controllib.py" afterPath="$PROJECT_DIR$/lib/controllib.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/hardwarelib.py" afterPath="$PROJECT_DIR$/lib/hardwarelib.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/main.py" afterPath="$PROJECT_DIR$/main.py" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
@ -29,8 +31,8 @@
<file leaf-file-name="main.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="697">
<caret line="41" column="28" lean-forward="true" selection-start-line="41" selection-start-column="28" selection-end-line="41" selection-end-column="28" />
<state relative-caret-position="321">
<caret line="37" column="30" lean-forward="false" selection-start-line="37" selection-start-column="30" selection-end-line="37" selection-end-column="30" />
<folding>
<element signature="e#0#19#0" expanded="true" />
</folding>
@ -41,7 +43,7 @@
<file leaf-file-name="graphiclib.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/graphiclib.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="389">
<state relative-caret-position="1103">
<caret line="86" column="12" lean-forward="false" selection-start-line="86" selection-start-column="12" selection-end-line="86" selection-end-column="12" />
<folding>
<element signature="e#0#28#0" expanded="true" />
@ -53,13 +55,25 @@
<file leaf-file-name="controllib.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/controllib.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="187">
<caret line="11" column="58" lean-forward="false" selection-start-line="11" selection-start-column="58" selection-end-line="11" selection-end-column="58" />
<state relative-caret-position="493">
<caret line="53" column="38" lean-forward="true" selection-start-line="53" selection-start-column="38" selection-end-line="53" selection-end-column="38" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="hardwarelib.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/hardwarelib.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
<caret line="48" column="35" lean-forward="true" selection-start-line="48" selection-start-column="35" selection-end-line="48" selection-end-column="35" />
<folding>
<element signature="e#0#41#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="update.sh" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/update.sh">
<provider selected="true" editor-type-id="text-editor">
@ -108,9 +122,10 @@
<option value="$PROJECT_DIR$/servo_2.py" />
<option value="$PROJECT_DIR$/thermo.py" />
<option value="$PROJECT_DIR$/update.sh" />
<option value="$PROJECT_DIR$/main.py" />
<option value="$PROJECT_DIR$/lib/graphiclib.py" />
<option value="$PROJECT_DIR$/lib/controllib.py" />
<option value="$PROJECT_DIR$/lib/hardwarelib.py" />
<option value="$PROJECT_DIR$/main.py" />
</list>
</option>
</component>
@ -321,14 +336,6 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/install.sh">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/motors.py" />
<entry file="file://$PROJECT_DIR$/main.py">
<provider selected="true" editor-type-id="text-editor">
@ -496,10 +503,20 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/hardwarelib.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
<caret line="48" column="35" lean-forward="true" selection-start-line="48" selection-start-column="35" selection-end-line="48" selection-end-column="35" />
<folding>
<element signature="e#0#41#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="697">
<caret line="41" column="28" lean-forward="true" selection-start-line="41" selection-start-column="28" selection-end-line="41" selection-end-column="28" />
<state relative-caret-position="321">
<caret line="37" column="30" lean-forward="false" selection-start-line="37" selection-start-column="30" selection-end-line="37" selection-end-column="30" />
<folding>
<element signature="e#0#19#0" expanded="true" />
</folding>
@ -508,7 +525,7 @@
</entry>
<entry file="file://$PROJECT_DIR$/lib/graphiclib.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="389">
<state relative-caret-position="1103">
<caret line="86" column="12" lean-forward="false" selection-start-line="86" selection-start-column="12" selection-end-line="86" selection-end-column="12" />
<folding>
<element signature="e#0#28#0" expanded="true" />
@ -518,8 +535,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/lib/controllib.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="187">
<caret line="11" column="58" lean-forward="false" selection-start-line="11" selection-start-column="58" selection-end-line="11" selection-end-column="58" />
<state relative-caret-position="493">
<caret line="53" column="38" lean-forward="true" selection-start-line="53" selection-start-column="38" selection-end-line="53" selection-end-column="38" />
<folding />
</state>
</provider>

@ -1,7 +1,7 @@
import pygame, os
class Joystick():
class Joystick():
def __init__(self, navigator, light, configuration, camera):
# joystick
pygame.joystick.init()
@ -88,7 +88,6 @@ class Joystick():
dict['Volume'] = self.sound.get_volume()
return dict
def _save_camimg(self):
self.camera.new_frame()
img = self.camera.image

@ -2,6 +2,7 @@ from subprocess import call, check_output
from lib import ultrasonic
import RPi.GPIO as GPIO
class Navigator():
"""Forward Motor with relais, Steering with servo"""
@ -11,29 +12,24 @@ class Navigator():
GPIO.setup(self.mrelpin, GPIO.OUT)
self.stop()
def left(self):
if self.steer != 'left':
call(['python', './lib/servolib.py', 'left'])
self.steer = 'left'
def right(self):
if self.steer != 'right':
call(['python', './lib/servolib.py', 'right'])
self.steer = 'right'
def straight(self):
if self.steer:
call(['python', './lib/servolib.py'])
self.steer = None
def forward(self):
GPIO.output(self.mrelpin, False)
def stop(self):
GPIO.output(self.mrelpin, True)
@ -47,16 +43,14 @@ class Light:
GPIO.output(self.pin, True)
self.shine = False
def switch(self):
print('light switch {}'.format(self.shine))
GPIO.output(self.pin, not self.shine)
self.shine = not self.shine
def switch_on(self):
GPIO.output(self.pin, False)
def switch_of(self):
GPIO.output(self.pin, True)
@ -68,12 +62,10 @@ class Ultrasonic:
self.sensor = ultrasonic.Sensor()
self.sensor.init(trigger, echo)
def get_distance(self):
distance = self.sensor.echo()
return distance
def __del__(self):
self.sensor.clean()
@ -86,7 +78,6 @@ class Temperature:
temp, hum = outp.split('|')
return temp
def get_Humidity(self):
outp = check_output(['python', '-u', './lib/thermolib.py']).decode('ISO-8859-1')
temp, hum = outp.split('|')

@ -36,15 +36,10 @@ def main():
running = False
dict = jstick.handle()
print('joystick handled')
list.set_dict(dict)
print('list has dict')
all_sprites.update()
print('updating sprites')
update_rects = all_sprites.draw(screen.screen)
print('drawing sprites')
screen.refresh(rectangles= update_rects)
print('refreshing screen')
pygame.quit()

Loading…
Cancel
Save