where is bcdInputs[] defined?? From: "G0DPG g0dpg@... [SoftwareControlledHamRadio]" To: SoftwareControlledHamRadio@... Sent: Thursday, May 19, 2016 5:48 AM Subject: [SoftwareControlledHamRadio] Yaesu ft 1000mp band data
?
Can anyone help me with code please? Ardunio uno.
I need to read the band data, display the output on lcd, i.e. 160m and also drive miniature relays on a LPF for the band selected. Got some code sorted but needs more work. Day two now of using code so be gentle Had a bollocking for posting code in wrong place on another forum so hope ok to place it below. Thanks. /* pinMode(bcdInputA0, INPUT); pinMode(bcdInputA1, INPUT); pinMode(bcdInputA2, INPUT); pinMode(bcdInputA3, INPUT); */ for(byte i = 0; i < sizeof(bcdInputs); i++){ pinMode(bcdInputs[i], INPUT); } lcd.begin(16, 2); lcd.print("Hello"); lcd.setCursor(0, 1); lcd.print("sel"); } // end of void setup void loop() { // put your main code here, to run repeatedly: //again in array byte sequence = 0; for(byte i = 0; i < sizeof(bcdInputs); i++){ //shift left by 10 sequence <<= 1; //add the next bcd input, starting at the last counting down sequence |= digitalRead(bcdInputs[sizeof(bcdInputs) - i]); } lcd.setCursor(0,0);//whereever you want if(sequence == 0){ lcd.print("No radio input"); } else if(sequence < sizeof(distancesLookup + 1)){ lcd.print(distancesLookup[sequence - 1]); lcd.print("m"); } else{ lcd.print("Inv"); } } // end of void loop |