Skip to content
Open
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
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,48 @@ MicroPython also provides a set of MicroPython-specific modules to access
hardware-specific functionality and peripherals such as GPIO, Timers, ADC,
DAC, PWM, SPI, I2C, CAN, Bluetooth, and USB.



CircuitOS
---------------

Docs for functions exposed by CircuitOS

#### Artemis Watch
```
from Artemis import *
// also gets you relevant CircuitOS imports
```

|Command |Description |
|--------------------------------------------------------------|------------------------------------------------------------------------------------------------|
|begin() |Hardware Initializes the Artemis hardware. Must be called first in every script after importing.|
|backlight.on() //or off |Turns the backlight on or off. |
|display.fill(color) |Display Fills the entire screen. display.fill(0) clears the screen to black. |
|display.rect(x, y, width, height, color, filled) |Display Draws a rectangle. filled is a True/False boolean. |
|display.ellipse(x, y, rx, ry, color, filled) |Display Draws an oval/circle. rx and ry are horizontal/vertical radii. |
|display.text('string', x, y, color) |Display Prints text to the screen at the given coordinates. |
|display.blit(buffer, x, y, transparent_color) |Display Draws a complex graphic (like a sprite) using a FrameBuffer. |
|display.commit() |Display Crucial: Pushes drawings to the actual screen. Required to update the display. |
|Display.Color.[Color] |Display Built-in colors: Red, Green, Blue, Yellow, Magenta, Cyan, White. |
|buttons.scan() |Input Crucial: Reads physical buttons. Must be inside the while True loop. |
|buttons.on_press(button, function) |Input Links a button press to a function (callback). |
|Buttons.[Name] |Input Physical buttons: Buttons.Up, Buttons.Down, Buttons.Select, Buttons.Back. |
|imu.get_accel_x() |Sensors Returns acceleration in the x direction. |
|imu.get_accel_y() |Sensors Returns acceleration in the y direction. |
|imu.get_accel_z() |Sensors Returns acceleration in the z direction. |
|imu.get_gyro_x() |Sensors Returns tilt in x direction (Pitch: tilting wrist up/down). |
|imu.get_gyro_y() |Sensors Returns tilt in y direction (Roll: twisting forearm). |
|imu.get_gyro_z() |Sensors Returns tilt in z direction (Yaw: sweeping arm left/right). |
|piezo.tone(frequency, duration) |Audio Plays a note. Frequency in Hertz, duration in milliseconds. |
|for i in range(6): leds[i].on() // or off |LEDs Turns specific LEDs (0-5) on or off. |
|rgb.set(r, g, b) |LEDs Sets the secret LED at the front (values 0 or 100). |
|time.sleep(seconds) |Utilities Pauses execution for a specified number of seconds. |
|rtc.set_time(Time()) |Time Sets the time on the watch. |
|rtc.get_time() |Time Gets the current time from the watch. |
|rtc.get_time().{property} |Time Access time properties: hours, minutes, seconds, month, day, year. |


Getting started
---------------

Expand Down