Skip to content

Commit 265720f

Browse files
committed
Correcting the definition for the arduino uno device.
This has fewer exposed ADC pins.
1 parent feae256 commit 265720f

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Version 0.4.0
1818
* Removing interrupt and bus information from Pin definitions as
1919
this wasn't implemented and likely would need a redesign if it was
2020
added.
21+
* Defining the arduino uno as a separate device to the nano.
22+
Functionally these are equivalent besides the fewer ADC inputs
23+
on the uno.
2124

2225
Version 0.3.0
2326
-------------

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"interface": Interface.STUB,
1414
"loading": Loading.LAZY,
1515
},
16-
"Arduino Nano 3 EAGER": {
17-
"identity": Devices.arduino_nano,
16+
"Arduino Uno 3 EAGER": {
17+
"identity": Devices.arduino_uno,
1818
"address": "/dev/ttyUSB0",
1919
"interface": Interface.STUB,
2020
"loading": Loading.EAGER,

uoshardware/devices/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from dataclasses import dataclass
33

44
from uoshardware.abstractions import Device
5-
from uoshardware.devices._arduino import _ARDUINO_NANO_3
5+
from uoshardware.devices._arduino import _ARDUINO_NANO_3, _ARDUINO_UNO_3
66

77

88
@dataclass(init=False, repr=False, frozen=True)
@@ -17,4 +17,5 @@ class Devices:
1717
# Lookup constants linking devices to importable names
1818
hwid_0: Device = _ARDUINO_NANO_3
1919
arduino_nano: Device = _ARDUINO_NANO_3
20-
arduino_uno: Device = _ARDUINO_NANO_3
20+
hwid_1: Device = _ARDUINO_UNO_3
21+
arduino_uno: Device = _ARDUINO_UNO_3

uoshardware/devices/_arduino.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,21 @@
8989
},
9090
aux_params={"default_baudrate": 115200},
9191
)
92+
93+
94+
_ARDUINO_UNO_3 = Device(
95+
name="Arduino Uno 3",
96+
interfaces=_ARDUINO_NANO_3.interfaces,
97+
functions_enabled=_ARDUINO_NANO_3.functions_enabled,
98+
digital_pins=_ARDUINO_NANO_3.digital_pins,
99+
analog_pins={
100+
0: Pin(adc_in=True, alias=14),
101+
1: Pin(adc_in=True, alias=15),
102+
2: Pin(adc_in=True, alias=16),
103+
3: Pin(adc_in=True, alias=17),
104+
4: Pin(adc_in=True, alias=18),
105+
5: Pin(adc_in=True, alias=19),
106+
# Uno has 2 less ADCs pins than the nano.
107+
},
108+
aux_params={"default_baudrate": 115200},
109+
)

0 commit comments

Comments
 (0)