Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Fixed Import Error on Linux #357

Merged
merged 2 commits into from
Apr 21, 2020
Merged

Conversation

andreamah
Copy link
Contributor

Description:

import board in debug_user_code.py was causing issues on Linux with imports. Minor modifications were made to ensure that it imports correctly.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Limitations:

Please describe limitations of this PR

Testing:

Tested on Windows and Linux:

from adafruit_bitmap_font import bitmap_font
 
from adafruit_clue import clue
from datetime import datetime
import time
 
from adafruit_slideshow import SlideShow, PlayBackDirection, PlayBackOrder
import board
 
    
 
clue_data = clue.simple_text_display(title="Clue Sensor Data!", title_scale=2,)
 
val = 100
for i in range(12):
    val += 1
    clue_data.show_terminal()
    time.sleep(0.5)
    print(val)
    print(f"time {datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]}")
 
    print(clue_data.text_group.hidden)
for i in range(10):
    val += 1
    clue_data[0].text = "Accelerometer:"
    clue_data[1].text = "Gyro:"
    clue_data[2].text = "Magnetic:"
    clue_data[3].text = "Pressure: {:.3f} hPa".format(val)
    clue_data[4].text = "Altitude: {:.1f} m".format(val)
    clue_data[5].text = "Temperature: {:.1f} C".format(val)
    clue_data[6].text = "Humidity: {:.1f} %".format(val)
    clue_data[7].text = "Proximity: {}".format(val)
    clue_data[8].text = "Gesture: {}".format("flip")
    clue_data.text_group.hidden = False
    clue_data[9].text = "Color: R: {} G: {} B: {} C: {}".format(100, 100, 100, 100)
    clue_data[10].text = "Button A: {}".format(False)
    clue_data[11].text = "Button B: {}".format(False)
    clue_data[12].text = "Touch 0: {}".format(False)
    clue_data[13].text = "Touch 1: {}".format(False)
    
    # clue_data.text_group.hidden = False
    clue_data[14].text = "Touch 2: {}".format(False)
    clue_data.show()
    print("shouldn't show until the end")
    time.sleep(0.5)
    print(clue_data.text_group.hidden)

Checklist:

  • My code follows the style guidelines of this project
  • My code has been formatted with npm run format and passes the checks in npm run check
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@andreamah andreamah merged commit 71dc453 into dev Apr 21, 2020
@andreamah andreamah deleted the users/t-anmah/debug-print-fix-linux branch April 21, 2020 23:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants