An oscilloscope is typically a separate piece of equipment. If we were using one, it wouldn’t be necessary to change the code because the oscilloscope has its own processor for monitoring and displaying measurements.
This script started as button_light_blink from the Build and Test a Pushbutton activity’s Your Turn section [1]. Since the micro:bit is functioning as its own oscilloscope, calls to plot(volts(pin0), "y0", volts(pin2), "y2") are added before and after statements that check the pushbutton and change the LED light on/off states.
In electronics, a “start pulse” from one device can cause on/off signals from another device. Those signals might contain information, like binary communication data, or they might be something like the return waves from an ultrasonic ranging pulse (that measures distance). To emulate these events, when the script you will use in this activity detects a button press, it will blink the light six times.
Right-click button_led_blink_with_plot.hex and select Save link as... to download it.
button_led_blink_6x_with_plot.hex [2]
Links
[1] https://learn.parallax.com/tutorials/language/spin/sense-pushbutton-presses/build-and-test-pushbutton/input-register-and
[2] https://learn.parallax.com/sites/default/files/content/Python/button/button_led_blink_6x_with_plot.hex
[3] https://python.microbit.org/v/2
[4] https://cyberscope.parallax.com