Tuesday, November 18, 2014

Emulating An Arduino Sketch in a Spreadsheet

Many times I'll mock up my Arduino formulas in a spreadsheet before I start building a sketch. One of the more complicated Arduino commands to emulate is the MAP command.

The Arduino code:

height = map(adc, 171, 512, 12, 0);

In Excel becomes:

= (adc-in_min)*(out_max-out_min) / (in_max-in_min) + out_min

The following emulates a voltage divider that converts a fluid level of a container to gallons. It uses a reverse map as decreasing resistance of the sensor means increasing depth.

Sunday, November 16, 2014

Installing & Programming the VV-898 2m / 70cm Ham Radio

Ricky and I installed my new Leixen VV-898 2m/70cm 10 watt dual band Ham Radio in my truck today. It's $135 delivered, from http://www.radioddity.com. Ricky pulled out the ashtray and installed the radio in the exposed cavity. I then wired the power to the power leads from the old cigarette lighter (radio is about 10 watts, lighter can handle 150 watts), and we ran the antenna cable under the seats and out the back window (temporary, there's a rubber plug in the floor behind the seat).

UPDATE: I've programmed two of our "local" repeaters, one on the SCHeart system (Murrel's Inlet, SC), and one on the PALS system (Greelyville, SC). Both are about 35 miles from me (Andrews, SC) in opposite directions. I'm getting great signal reports, and both TX and RX is clean and clear.

Programming the radio to talk to our local repeater was a bit of a challenge (Software programming further down). Complete details were not in one place. I've collected the bits, and assembled them in an orderly and easy to follow collection.

In order to program the radio, you need to put it into Frequency mode (defaults to Channel mode). Press B on the Mic, and verify the channel + and - buttons actually change the frequency, and not the channel number.

Now enter the frequency of your repeater output using the numeric buttons on the Mic. I could not enter 146.805 (kept going to 146.800), so I knew the step was off.

Press M (which puts you in Menu mode), and CHA+ till you get to Menu 41. Press M again to enter Menu 41, and CHA+ until step says 5KHz. Press M again to back out to Menu.

Now enter the frequency of your repeater with the Mic keypad.

Press M to enter Menu mode, then:

Press CHA + or - to Menu 34, Press M to enter, and CHA- or + to pick your offset (600 KHz for us), then M again to exit.

Press CHA + or - to Menu 35, then M to enter. Set the offset type to -RPT (or whatever your repeater uses) with the CHA+ or -, then M to exit out.

Press CHA + or - to Menu 10, press M to enter, and CHA + or - to select CTC, then M to exit.

Press CHA + or - to Menu 11, press M to enter, and CHA + or - to select CTC Code (85.4 in our case), then M to exit.

Press CHA + or - to Menu 5, press M to enter, and CHA + or - to select Channel 1 (or whatever channel you want to save to), then M to exit.

Wait 3 or 4 seconds for the timeout to exit Menu, and press B to exit Frequency Mode. Now you should be able to use the CHA + or - to select saved channels.

Find out more - http://www.radioddity.com/us/lx-898-mobile-radio-60db-4w-10w-dtmf-vehicle-mobile-dual-band-transceiver-136-174-400-470mhz.html

If you have a Kenwood programming cable, a USB -> TTL adapter, or want to make one, you can download the CHIRP programming software, and build a cable adapter like the following:

Related Posts Plugin for WordPress, Blogger...