Advertisement
miklik

CyberPi-linechart1

Apr 29th, 2024
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | Source Code | 0 0
  1. from cyberpi import *
  2. import random
  3.  
  4. @event.start
  5. def on_start():
  6.     display.set_brush("blue")
  7.     linechart.set_step(1)
  8.     y = 50
  9.     s = 2
  10.     for i in range(120):
  11.         y = y + random.randint(-s,s)
  12.         if y < 0: y = 0
  13.         linechart.add(y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement