Impliment random() on msp340

also fix minor bug in firework.