Skip to content

Commit fdb8490

Browse files
Doug CofflandDoug Coffland
Doug Coffland
authored and
Doug Coffland
committed
corrected bug in oled
1 parent 74abffb commit fdb8490

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

src/avr/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Makefile for the project Bulidbotics firmware
22
PROJECT = bbctrl-avr-firmware
3-
MCU = atxmega256a3u
3+
MCU = atxmega192a3u
44
CLOCK = 32000000
55

66
# SRC

src/avr/src/config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ enum {
142142
#define STEP_TIMER_POLL ((uint16_t)(STEP_TIMER_FREQ * 0.001)) // 1ms
143143
#define STEP_TIMER_ISR TCC0_OVF_vect
144144
#define STEP_LOW_LEVEL_ISR ADCB_CH0_vect
145-
#define STEP_PULSE_WIDTH (F_CPU * 0.000002) // 2uS w/ clk/1
145+
#define STEP_PULSE_WIDTH (F_CPU * 0.000002) // 2uS w/ clk/1 .. modified to 10uS by doug
146146
#define SEGMENT_MS 4
147147
#define SEGMENT_TIME (SEGMENT_MS / 60000.0) // mins
148148

src/boot/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Makefile for the project Bulidbotics bootloader
22
PROJECT = bbctrl-avr-boot
3-
MCU = atxmega256a3u
3+
MCU = atxmega192a3u
44
CLOCK = 32000000
55

66
TARGET = $(PROJECT).elf

src/py/bbctrl/LCD.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import lcd
2929
import atexit
3030

31-
from .oled import *
3231
from .LCDPage import *
32+
from .oled import *
3333

3434
__all__ = ['LCD']
3535

@@ -52,18 +52,18 @@ def __init__(self, ctrl):
5252
self.pages = []
5353
self.current_page = 0
5454
self.screen = self.new_screen()
55+
56+
try:
57+
self.oled = OLED(self.ctrl)
58+
except:
59+
pass
60+
self.wrote_to_oled = False
5561
self.set_message('Loading...')
5662

5763
self._redraw(False)
5864
if not ctrl.args.demo: atexit.register(self.goodbye)
5965

60-
self.oled = OLED(ctrl)
61-
try:
62-
self.oled
63-
except:
64-
self.log.info("oled not present")
65-
self.wrote_to_oled = False
66-
66+
6767
def set_message(self, msg):
6868
try:
6969
self.load_page(LCDPage(self, msg))

src/py/bbctrl/oled.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ def __init__(self,ctrl):
3939
self.log = ctrl.log.get('OLED')
4040
self.device = 0
4141
try:
42-
serial = i2c(port=1, address = 0x3C)
4342
self.device = ssd1306(i2c(port=1, address=0x3c), width = 128, height=64, rotate=0)
4443
self.device.contrast(1)
45-
self.log.info("oled initialization complete")
4644
except:
47-
self.log.info("oled not found")
45+
pass
4846

4947
def write(self,message="hello",col=0,row=0):
5048
with canvas(self.device,dither=True) as draw:

0 commit comments

Comments
 (0)