[solved] traffic light code

pins 4,5,6 -3 x leds - 3 x 220r resistors - 1 x ground

pins 7,8 - 2 x leds - 2 x 220r - 1 x ground

pin 2 - switch - 5v
|
10k resistor - ground

this is my wiring

the grounds are different but should i use the one at the end of the line of digital i/o pins on the uno?