diff --git a/src/view/pages/__snapshots__/gettingStarted.spec.tsx.snap b/src/view/pages/__snapshots__/gettingStarted.spec.tsx.snap index f2def6158..74943b260 100644 --- a/src/view/pages/__snapshots__/gettingStarted.spec.tsx.snap +++ b/src/view/pages/__snapshots__/gettingStarted.spec.tsx.snap @@ -15,27 +15,40 @@ exports[`GettingStartedPage component should render correctly 1`] = ` disabled={true} selected={true} > - Select a Device + Learn more about: - - - + + + + -
Copy these snippets of code to a .py file and run the simulator - +
+
from adafruit_circuitplayground import cp
- +-while True:-+cp.red_led = True
+-while True:-+if cp.button_a:-+cp.red_led = True
+
cp.pixels[0] = (0, 0, 255)
-
+
from microbit import *
-
+
display.show(Image.HEART)
- +-while True:-+if button_a.is_pressed():-+display.show(Image.HAPPY)-+if button_b.is_pressed():-+display.show(Image.SAD)
+-while True:-+temp = temperature()-+display.show(temp)
+-while True:-+display.show("Your name")
- a. Access your settings: -
-
- File -> Preferences -> Settings
-
- Code -> Preferences -> Settings
-
- .
- b. Check the
-
- "Device Simulator Express: Preview Mode"
-
- setting.
-
-
+
from adafruit_clue import clue
- - clue_data = clue.simple_text_display(title="CLUE!", text_scale=2) +-+ clue_data = clue.simple_text_display(title="CLUE!")-+while True:-+clue_data[1].text = "Hello World!"-- clue_data[3].text = "Temperature: - {} - ".format(clue.temperature) --+if clue.button_a:-+clue_data[5].text = "A is pressed!"-+else:-+clue_data[5].text = "A is not pressed!"-+clue_data.show()
Make sure there are bitmap (.bmp) pictures of your choice in the same directory as the code file.
@@ -332,86 +448,454 @@ exports[`GettingStartedPage component should render correctly 1`] = `
-
+
-
import board
-
+
from adafruit_slideshow import SlideShow
-
+
-
- slideshow = SlideShow(board.DISPLAY, auto_advance=True, dwell=3, fade_effect=True)
+
+ slideshow = SlideShow(clue.display, auto_advance=True, dwell=3, fade_effect=True)
-
+
while slideshow.update():
-
+
pass
+
clue.pixel.fill(clue.GREEN)
- + clue_data = clue.simple_text_display(title="CLUE Sensor Data!", title_scale=2) ++
+ while True: ++
+ clue_data[0].text = "Acceleration:
+ {}
+
+ {}
+
+ {}
+ ".format(*clue.acceleration)
+
+
+ clue_data[1].text = "Gyro:
+ {}
+
+ {}
+
+ {}
+ ".format(*clue.gyro)
+
+
+ clue_data[2].text = "Magnetic:
+ {}
+
+ {}
+
+ {}
+ ".format(*clue.magnetic)
+
+
+ clue_data[3].text = "Pressure:
+ {}
+ hPa".format(clue.pressure)
+
+
+ clue_data[4].text = "Altitude:
+ {}
+ m".format(clue.altitude)
+
+
+ clue_data[5].text = "Temperature:
+ {}
+ C".format(clue.temperature)
+
+
+ clue_data[6].text = "Humidity:
+ {}
+ %".format(clue.humidity)
+
+
+ clue_data[7].text = "Proximity:
+ {}
+ ".format(clue.proximity)
+
+
+ clue_data[8].text = "Gesture:
+ {}
+ ".format(clue.gesture)
+
+
+ clue_data[9].text = "Color: R:
+ {}
+ G:
+ {}
+ B:
+ {}
+ C:
+ {}
+ ".format(*clue.color)
+
+
+ clue_data[10].text = "Button A:
+ {}
+ ".format(clue.button_a)
+
+
+ clue_data[11].text = "Button B:
+ {}
+ ".format(clue.button_b)
+
+ + clue_data.show() ++ +
+-import board-+import displayio-+from adafruit_display_shapes.rect import Rect-+-+splash = displayio.Group(max_size=20)-+board.DISPLAY.show(splash)-+-+rect = Rect(80, 20, 41, 41, fill=0x0000FF)-+splash.append(rect)
+ Press
+
+ F5
+
+ or go to
+
+ Run -> Start Debugging
+
+
+ + Stopping at a breakpoint pauses the program at that particular place. +
++ Use the debug toolbar or the shortcuts below +
+
+
+
+ Copy these snippets of code to a .py file and run the simulator - +
{/* prettier-ignore */}from adafruit_circuitplayground import cp+
from adafruit_circuitplayground import cp-
while True:-
cp.red_led = True+
while True:+
cp.red_led = True-
while True:-
if cp.button_a:-
cp.red_led = True+
while True:+
if cp.button_a:+
cp.red_led = True-
cp.pixels[0] = (0, 0, 255)+
cp.pixels[0] = (0, 0, 255)-
from microbit import *+
from microbit import *-
display.show(Image.HEART)+
display.show(Image.HEART)-
while True:-
if button_a.is_pressed():-
display.show(Image.HAPPY)-
if button_b.is_pressed():-
display.show(Image.SAD)+
while True:+
if button_a.is_pressed():+
display.show(Image.HAPPY)+
if button_b.is_pressed():+
display.show(Image.SAD)-
while True:-
temp = temperature()-
display.show(temp)+
while True:+
temp = temperature()+
display.show(temp)-
while True:-
display.show("Your name")
+ while True:+
display.show("Your name")
- a. Access your settings:
-File -> Preferences -> SettingsCode -> Preferences -> Settings. b. Check the "Device Simulator Express: Preview Mode" setting.
- from adafruit_clue import clue+
from adafruit_clue import clue-
- clue_data = clue.simple_text_display(title="CLUE!", text_scale=2) +-+ clue_data = clue.simple_text_display(title="CLUE!")-while True:-clue_data[1].text = "Hello World!"-clue_data[3].text = "Temperature: {"{}"}".format(clue.temperature)-if clue.button_a:-clue_data[5].text = "A is pressed!"-else:-clue_data[5].text = "A is not pressed!"-clue_data.show()+while True:+clue_data[1].text = "Hello World!"+if clue.button_a:+clue_data[5].text = "A is pressed!"+else:+clue_data[5].text = "A is not pressed!"+clue_data.show()
Make sure there are bitmap (.bmp) pictures of your choice in the same directory as the code file.
-import board-
from adafruit_slideshow import SlideShow-
-
slideshow = SlideShow(board.DISPLAY, auto_advance=True, dwell=3, fade_effect=True) +-import board+from adafruit_slideshow import SlideShow++slideshow = SlideShow(clue.display, auto_advance=True, dwell=3, fade_effect=True)-while slideshow.update():-pass+while slideshow.update():+pass
clue.pixel.fill(clue.GREEN)+
clue.pixel.fill(clue.GREEN)-
import board-
import displayio-
from adafruit_display_shapes.rect import Rect-
-
splash = displayio.Group(max_size=20)-
board.DISPLAY.show(splash)-
-
rect = Rect(80, 20, 41, 41, fill=0x0000FF)-
splash.append(rect)+
clue_data = clue.simple_text_display(title="CLUE Sensor Data!", title_scale=2)+
while True:+
clue_data[0].text = "Acceleration: {"{}"} {"{}"} {"{}"}".format(*clue.acceleration)
+ clue_data[1].text = "Gyro: {"{}"} {"{}"} {"{}"}".format(*clue.gyro)
+ clue_data[2].text = "Magnetic: {"{}"} {"{}"} {"{}"}".format(*clue.magnetic)
+ clue_data[3].text = "Pressure: {"{}"}hPa".format(clue.pressure)
+ clue_data[4].text = "Altitude: {"{}"}m".format(clue.altitude)
+ clue_data[5].text = "Temperature: {"{}"}C".format(clue.temperature)
+ clue_data[6].text = "Humidity: {"{}"}%".format(clue.humidity)
+ clue_data[7].text = "Proximity: {"{}"}".format(clue.proximity)
+ clue_data[8].text = "Gesture: {"{}"}".format(clue.gesture)
+ clue_data[9].text = "Color: R: {"{}"} G: {"{}"} B: {"{}"} C: {"{}"}".format(*clue.color)
+ clue_data[10].text = "Button A: {"{}"}".format(clue.button_a)
+ clue_data[11].text = "Button B: {"{}"}".format(clue.button_b)
+ clue_data.show()-
import board+
import displayio+
from adafruit_display_shapes.rect import Rect+
+
splash = displayio.Group(max_size=20)+
board.DISPLAY.show(splash)+
+
rect = Rect(80, 20, 41, 41, fill=0x0000FF)+
splash.append(rect)+ +
Press F5 or go to Run -> Start Debugging
+ Stopping at a breakpoint pauses the program at that particular place.
+Use the debug toolbar or the shortcuts below
+
+
+
+