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

Commit

Permalink
Adding API call for motion sensor (#89)
Browse files Browse the repository at this point in the history
[PBI 31691]
* added temperature value

* removed deead code

* removed dummy

* added type to the slider

* remove unit notions

* changes

* changes to the api

* created new variable

* added degree sign

* removed extra spaces

* more extra spaces removed

* using varaiable for the slider color

* added null check

* beautifying

* beuatifying

* solving issues

* Update src/view/components/toolbar/InputSlider.tsx

Co-Authored-By: Jonathan Wang <jonathanwangg@gmail.com>

* used prettier

* removed dummy

* prettier again

* following good unsollicited advices 1

* cleaning up

* adding light sensor cimponent

* adding temp sensor

* changes

* added view for light sensor

* refectored process

* added api call

* solved error

* added API call

* adding support for stop button

* Update src/extension.ts

Co-Authored-By: Luke Slevinsky <lslevins@ualberta.ca>

* Update src/view/components/toolbar/TemperatureSensorBar.tsx

Co-Authored-By: Luke Slevinsky <lslevins@ualberta.ca>

* rework setmessage

* reformat

* let's follow best practices

* resolved issue with input

* removed dead lines

* added motion sensor control

* added api call

* added scrollbar for sensors

* reduced size so people can see

* adding logic for sensor

* removed API call

* solved font color for light theme

* restaored api call

* changed tuple to named tuple

* removed unused file
  • Loading branch information
FMounz authored Aug 3, 2019
1 parent fe129ed commit acf1d7d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/adafruit_circuitplayground/express.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from playsound import playsound
from .pixel import Pixel
from . import utils
from collections import namedtuple


class Express:
Expand All @@ -32,11 +33,19 @@ def __init__(self):
'switch': False,
'temperature': 0,
'light': 0,
'motion_x': 0,
'motion_y': 0,
'motion_z': 0
}

self.pixels = Pixel(self.__state)
self.__abs_path_to_code_file = ''

@property
def acceleration(self):
Acceleration = namedtuple('acceleration', ['x', 'y', 'z'])

return Acceleration(self.__state['motion_x'], self.__state['motion_y'], self.__state['motion_z'])

@property
def button_a(self):
Expand Down
4 changes: 3 additions & 1 deletion src/process_user_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
'switch',
'temperature',
'light',

'motion_x',
'motion_y',
'motion_z'
]

read_val = ""
Expand Down
2 changes: 1 addition & 1 deletion src/view/components/toolbar/InputSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the MIT license.

import * as React from "react";
import "../../styles/InputSlider.css";
import { ISliderProps } from "./Toolbar_utils";
import "../../styles/InputSlider.css";

interface vscode {
postMessage(message: any): void;
Expand Down

0 comments on commit acf1d7d

Please sign in to comment.