init: ;set I/O ;Outputs output B.0,B.1,B.2,B.3,B.4,B.5,B.6,B.7,C.0,C.2,C.3,C.4,C.5 ;For selection station on Raspberry Pi Symbol ST01 = B.0 Symbol ST02 = B.1 Symbol ST03 = B.2 Symbol ST04 = B.3 Symbol ST05 = B.4 Symbol ST06 = B.5 Symbol ST07 = B.6 Symbol ST08 = B.7 Symbol ST09 = C.0 Symbol ST10 = C.2 Symbol ST11 = C.3 Symbol ST12 = C.4 ;Power LED to provide status information Symbol STATUS_LED = C.5 ;Inputs input C.1 ;ADC to read Poti Symbol STATIONSEL = C.1 ;ADC to read poti for station selection ;Variables ;Radio Symbol HelpVar = b0 ;universal helper variable for diverse purposes Symbol StorageStation = b1 ;storages for actual station Symbol BufferStation = b2 ;buffer for station selectiom HelpVar = 0 StorageStation = 0 BufferStation = 0 ;initials all pins High ST01, ST02, ST03, ST04, ST05, ST06, ST07, ST08, ST09, ST10, ST11, ST12 High STATUS_LED ;switch power LED on ;show system ready gosub FlashStatus ;flash power LED to show that system is ready pause 1000 ;wait a second bevor select station main: debug readadc STATIONSEL ,HelpVar ;read value from poti to variable HelpVar gosub SelectStation pause 100 goto main SelectStation: if HelpVar <= 5 and HelpVar >= 0 then StorageStation = 01 ;Hamburg endif if HelpVar <= 26 and HelpVar >= 15 then StorageStation = 02 ;Venedig endif if HelpVar <= 50 and HelpVar >= 40 then StorageStation = 03 ;Hannover endif if HelpVar <= 74 and HelpVar >= 64 then StorageStation = 04 ;London endif if HelpVar <= 98 and HelpVar >= 88 then StorageStation = 05 ;Helgoland endif if HelpVar <= 123 and HelpVar >= 113 then StorageStation = 06 ;Z?rich endif if HelpVar <= 148 and HelpVar >= 138 then StorageStation = 07 ;Helsinki endif if HelpVar <= 170 and HelpVar >= 160 then StorageStation = 08 ;Leipzig endif if HelpVar <= 193 and HelpVar >= 183 then StorageStation = 09 ;New York endif if HelpVar <= 216 and HelpVar >= 206 then StorageStation = 10 ;Sydney endif if HelpVar <= 238 and HelpVar >= 228 then StorageStation = 11 ;Aukland endif if HelpVar <= 255 and HelpVar >= 250 then StorageStation = 12 ;Aethernetz endif if BufferStation <> StorageStation then gosub FlashStatus gosub StartStation BufferStation = StorageStation endif return StartStation: select case StorageStation case 01 low ST01 pause 500 high ST01 case 02 low ST02 pause 500 high ST02 case 03 low ST03 pause 500 high ST03 case 04 low ST04 pause 500 high ST04 case 05 low ST05 pause 500 high ST05 case 06 low ST06 pause 500 high ST06 case 07 low ST07 pause 500 high ST07 case 08 low ST08 pause 500 high ST08 case 09 low ST09 pause 500 high ST09 case 10 low ST10 pause 500 high ST10 case 11 low ST11 pause 500 high ST11 case 12 low ST12 pause 500 high ST12 endselect return FlashStatus: ;flash status LED 3 to show some activies low STATUS_LED pause 500 high STATUS_LED pause 500 return