The inputs on CodeBug can be use in two modes, digital and analogue. Digital is on and off like a switch. Analogue gives a value between 0 and 255 depending on the voltage, like a light dimmer-switch.
First click on the blue cog on the start block and tick the checkbox next to leg 0 input/output.
Click the cog again to close this window and select analogue input from the leg 0 as dropdown menu.
This puts leg 0 into the analogue input mode.
From the Sprite menu, drag in a scroll sprite block and snap it inside your repeat while loop.
Also from the Sprite menu, drag in a get string sprite block and snap it to your scroll sprite block.
From the Inputs/Outputs menu, drag in a read analogue leg block and snap it to your get string sprite block (on top of the "Hello world" text block).
Click the green cog at the top right of the emulator.
Tick Show leg controls.
Click Apply.
Click the play button on the emulator. It will scroll "255".
If you click and hold leg 0, the emulator will start scrolling 0 instead. This shows us the highest and lowest value our analogue leg can read.
Click Download to download your code.
Load your code onto your CodeBug.