Skip to content

Commit 80e6656

Browse files
authored
Merge pull request #21 from arduino/dev
ver 1.0.1
2 parents 66054ca + 8a33b46 commit 80e6656

File tree

4 files changed

+62
-11
lines changed

4 files changed

+62
-11
lines changed

README.md

+28-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99

1010

1111

12-
## How to Install Micropython library
12+
## How to Install the Micropython library
1313

1414
### 1. install mpremote
1515

1616
[mpremote](https://docs.micropython.org/en/latest/reference/mpremote.html) is needed to upload files on the [Arduino® Nano ESP32](https://store.arduino.cc/products/nano-esp32?gad_source=1&gclid=Cj0KCQiA2KitBhCIARIsAPPMEhLtIxV_s7KyLJO4-69RdR1UeFTdgGK_XmI8w7xdbur4gs1oJU4Jl68aAhbaEALw_wcB).
17+
Minimum suggested mpremote release is 1.22.0
1718

1819
```shell
1920
(venv)$ pip install mpremote
@@ -34,13 +35,26 @@ Windows
3435
***Note: The -p parameter is optional***
3536

3637

37-
__NOTE: DO NOT USE LAB FOR MICROPYTHON TO UPLOAD BIN FILES__
38+
__WARNING: do not open bin files with Arduino Lab for Micropython 0.8.0 because they will be corrupted__
39+
40+
### 2.1 mip (MicroPython Package Manager)
41+
This is the recommended method for boards which can connect to Internet. Make sure your board is connected to the Internet and
42+
run the following MicroPython script using your favourite editor:
43+
44+
```py
45+
import mip
46+
47+
mip.install('github:arduino/arduino-alvik-mpy')
48+
49+
```
3850

3951
<br>
4052
<br>
4153

4254
### 3. Update firmware on your Arduino® Alvik
4355

56+
Download the latest [Arduino Alvik Carrier Firmware code](https://github.com/arduino-libraries/Arduino_AlvikCarrier) (to compile the firmware using Arduino IDE) or the [pre-compiled firmware](https://github.com/arduino-libraries/Arduino_AlvikCarrier/releases/latest)
57+
4458
Go into `utilities` folder and run:
4559
```shell
4660
Linux
@@ -142,4 +156,15 @@ It is possible to stop the robot at any time by pressing the `CANCEL touch butto
142156
<br>
143157
<br>
144158

145-
__Note: not open bin files with Arduino Lab for Micropython because they will be corrupted__
159+
__WARNING: do not open bin files with Arduino Lab for Micropython 0.8.0 because they will be corrupted__
160+
161+
162+
<br>
163+
<br>
164+
<br>
165+
166+
167+
## Useful links
168+
- [Arduino_Alvik](https://github.com/arduino-libraries/Arduino_Alvik): Arduino library required to program Alvik
169+
- [Arduino_AlvikCarrier](https://github.com/arduino-libraries/Arduino_AlvikCarrier): Arduino library required to build the firmware
170+
- [Arduino Alvik product page](https://store.arduino.cc/pages/alvik)

arduino_alvik/__init__.py

+9
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1+
"""
2+
Arduino Alvik micropython library
3+
"""
4+
5+
__author__ = "Lucio Rossi <[email protected]>, Giovanni Bruno <[email protected]>"
6+
__license__ = "MPL 2.0"
7+
__version__ = "1.0.1"
8+
__maintainer__ = "Lucio Rossi <[email protected]>, Giovanni Bruno <[email protected]>"
9+
110
from .arduino_alvik import *

arduino_alvik/arduino_alvik.py

+23-6
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ def is_target_reached(self) -> bool:
251251
if self._last_ack == self._waiting_ack:
252252
self._packeter.packetC1B(ord('X'), ord('K'))
253253
uart.write(self._packeter.msg[0:self._packeter.msg_size])
254-
sleep_ms(100)
255-
self._last_ack = 0x00
256254
self._waiting_ack = None
255+
self._last_ack = 0x00
256+
sleep_ms(100)
257257
return True
258258
return False
259259

@@ -971,10 +971,27 @@ def print_status(self):
971971
Prints the Alvik status
972972
:return:
973973
"""
974-
for a in vars(self):
975-
if str(a).startswith('_'):
976-
continue
977-
print(f'{str(a).upper()} = {getattr(self, str(a))}')
974+
print('---ALVIK STATUS---')
975+
print(f'VERSION: {self._version}')
976+
977+
print('---SENSORS---')
978+
print(f'TOF: T:{self._top_tof} B:{self._bottom_tof} L:{self._left_tof} CL:{self._center_left_tof}' +
979+
f' C:{self._center_tof} CR:{self._center_right_tof} R:{self._right_tof}')
980+
print(f'LINE: L:{self._left_line} C:{self._center_line} R:{self._right_line}')
981+
print(f'ACC: X:{self._ax} Y:{self._ay} Z:{self._az}')
982+
print(f'GYR: X:{self._gx} Y:{self._gy} Z:{self._gz}')
983+
print(f'POS: X:{self._x} Y:{self._y} TH:{self._theta}')
984+
print(f'IMU: ROLL:{self._roll} PITCH:{self._pitch} YAW:{self._yaw}')
985+
print(f'COLOR: R:{self._red} G:{self._green} B:{self._blue}')
986+
print(f'BATT(%) {self._battery_perc}')
987+
988+
print('---COMMUNICATION---')
989+
print(f'TOUCH BYTE: {self._touch_byte}')
990+
print(f'LAST ACK: {self._last_ack}')
991+
992+
print('---MOTORS---')
993+
print(f'LINEAR VEL: {self._linear_velocity}')
994+
print(f'ANGULAR VEL: {self._angular_velocity}')
978995

979996
def on_touch_ok_pressed(self, callback: callable, args: tuple = ()) -> None:
980997
"""

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
["arduino_alvik/stm32_flash.py", "github:arduino/arduino-alvik-mpy/arduino_alvik/stm32_flash.py"]
1111
],
1212
"deps": [
13-
["github:arduino/ucPack-mpy", "0.1.5"]
13+
["github:arduino/ucPack-mpy", "0.1.6"]
1414
],
15-
"version": "1.0.0"
15+
"version": "1.0.1"
1616
}

0 commit comments

Comments
 (0)