Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pip3 install note-python
```

For use with MicroPython or CircuitPython, copy the contents of the `notecard`
directory into the `lib` directory of your device.
directory into the `lib/notecard` directory of your device.

## Usage

Expand Down
5 changes: 2 additions & 3 deletions examples/notecard-basics/mpy_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import sys
import time
import notecard
import board

if sys.implementation.name != "micropython":
raise Exception("Please run this example in a MicroPython environment.")
Expand Down Expand Up @@ -52,11 +51,11 @@ def run_example(product_uid, use_uart=True):
"""Connect to Notcard and run a transaction test."""
print("Opening port...")
if use_uart:
port = UART(board.UART, 9600)
port = UART(1, 115200)
port.init(9600, bits=8, parity=None, stop=1,
timeout=3000, timeout_char=100)
else:
port = I2C(board.I2C_ID, scl=Pin(board.SCL), sda=Pin(board.SDA))
port = I2C(1, freq=100000)

print("Opening Notecard...")
if use_uart:
Expand Down
4 changes: 2 additions & 2 deletions notecard/binary_helpers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Helper methods for doing binary transfers to/from a Notecard."""

import sys
from .cobs import cobs_encode, cobs_decode
from .notecard import Notecard, CARD_INTRA_TRANSACTION_TIMEOUT_SEC
from notecard.cobs import cobs_encode, cobs_decode
from notecard.notecard import Notecard, CARD_INTRA_TRANSACTION_TIMEOUT_SEC

BINARY_RETRIES = 2

Expand Down
2 changes: 1 addition & 1 deletion notecard/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# This module is optional and not required for use with the Notecard.

import notecard
from .validators import validate_card_object
from notecard.validators import validate_card_object


@validate_card_object
Expand Down
2 changes: 1 addition & 1 deletion notecard/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# This module is optional and not required for use with the Notecard.

import notecard
from .validators import validate_card_object
from notecard.validators import validate_card_object


@validate_card_object
Expand Down
2 changes: 1 addition & 1 deletion notecard/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# This module is optional and not required for use with the Notecard.

import notecard
from .validators import validate_card_object
from notecard.validators import validate_card_object


@validate_card_object
Expand Down
2 changes: 1 addition & 1 deletion notecard/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# This module is optional and not required for use with the Notecard.

import notecard
from .validators import validate_card_object
from notecard.validators import validate_card_object


@validate_card_object
Expand Down
2 changes: 1 addition & 1 deletion notecard/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# This module is optional and not required for use with the Notecard.

import notecard
from .validators import validate_card_object
from notecard.validators import validate_card_object


@validate_card_object
Expand Down
8 changes: 4 additions & 4 deletions notecard/notecard.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
import os
import json
import time
from .timeout import start_timeout, has_timed_out
from .transaction_manager import TransactionManager, NoOpTransactionManager
from .crc32 import crc32
from notecard.timeout import start_timeout, has_timed_out
from notecard.transaction_manager import TransactionManager, NoOpTransactionManager
from notecard.crc32 import crc32

use_periphery = False
use_serial_lock = False

if sys.implementation.name == 'cpython' and (sys.platform == 'linux' or sys.platform == 'linux2'):
if sys.implementation.name == 'cpython' and (sys.platform == 'linux' or sys.platform == 'linux2' or sys.platform == 'darwin'):
use_periphery = True
from periphery import I2C

Expand Down
4 changes: 2 additions & 2 deletions notecard/transaction_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import sys
import time

from .timeout import start_timeout, has_timed_out
from .gpio import GPIO
from notecard.timeout import start_timeout, has_timed_out
from notecard.gpio import GPIO


class TransactionManager:
Expand Down