# This is what I do in my spare time



## PandaMan (Oct 14, 2010)

I like electronics. Specifically electronics including microcontrollers and programming. This is my finished code for my GCSE Systems and control project at school. It probably doesn't mean much to anyone, but I just want to show it off









```
<br />
Init:<br />
pause 500	<br />
let b0 = 0   <br />
serout B.2, N2400, (254,1)<br />
serout B.2, N2400, (#b0)<br />
Main:<br />
IF pin1=1 then<br />
  let b0 = b0+1<br />
  GOSUB Displaymins<br />
ENDIF<br />
  pause 100<br />
IF pin2=1 then<br />
  let b0 = b0-1<br />
  GOSUB Displaymins<br />
ENDIF<br />
  pause 100<br />
IF pin3=1 then<br />
  let b0 = b0+10<br />
  GOSUB Displaymins<br />
ENDIF<br />
  pause 100<br />
IF pin4=1 then<br />
  let b0 = b0-10<br />
  GOSUB Displaymins<br />
ENDIF<br />
  pause 100<br />
IF pin0=0 then<br />
  pause 100<br />
  goto Main<br />
ELSEIF pin0=1 then<br />
  high B.3<br />
  pause 50<br />
  low B.3<br />
  goto Function<br />
ENDIF<br />
Displaymins:<br />
   serout B.2, N2400, (254,1)<br />
   pause 30<br />
   high B.3<br />
   pause 50<br />
   low B.3<br />
   serout B.2, N2400, (#b0)<br />
   RETURN<br />
Function:<br />
  IF b0 = 0 then Main<br />
  FOR b1 = 1 to b0<br />
   wait 5<br />
   let b0 = b0-1<br />
   serout B.2, N2400, (254,1)<br />
   pause 30<br />
   serout B.2, N2400, (#b0)<br />
  NEXT<br />
  serout B.2, N2400, (254,1)<br />
  pause 30<br />
  serout B.2, N2400, ("Time's Up")<br />
  high B.0	<br />
  pause 700<br />
  low B.0	<br />
  wait 1		<br />
  high B.1	<br />
  low B.1	<br />
  let b0 = 0   <br />
  serout B.2, N2400, (254,1)<br />
  pause 30<br />
  serout B.2, N2400, (#b0)	<br />
  goto Main<br />
```
It is programming language called "BASIC" used by the PICaxe range of microcontrollers. The code may appear complex but it is quite simple.

PandaMan


----------



## Dayhiker (Mar 13, 2010)

They still using BASIC?

10 cls
20 let m = "Hello World"
30 display m
40 end

Ha ha!

probably got the commands wrong, but I was all about the BASIC a while back. Since, however, I didn't need to do programming for a living, I ran out of useful things to do with it and moved on to just buying other people's software.

Interesting stuff, though.


----------

