Attachment 'wobbulator_orangePi_patch.txt'

Download

   1 3c3
   2 < 
   3 ---
   4 > # 2016-11-13 RR, mod for Orange Pi
   5 44a45
   6 > print("start pgm")  # debug
   7 156c157,159
   8 < import quick2wire.i2c as i2c
   9 ---
  10 > #import quick2wire.i2c as i2c
  11 > # for orange pi Lite, pyA20 library
  12 > from pyA20 import i2c
  13 159c162,165
  14 < import RPi.GPIO as GPIO
  15 ---
  16 > # import RPi.GPIO as GPIO
  17 > from pyA20.gpio import gpio
  18 > from pyA20.gpio import port
  19 > from pyA20.gpio import connector
  20 162,163c168,170
  21 < GPIO.setmode(GPIO.BOARD)
  22 < GPIO.setwarnings(False)
  23 ---
  24 > #GPIO.setmode(GPIO.BOARD)
  25 > #GPIO.setwarnings(False)
  26 > gpio.init() #Initialize module. Always called first
  27 166,169c173,180
  28 < W_CLK = 15
  29 < FQ_UD = 16
  30 < DATA = 18
  31 < RESET = 22
  32 ---
  33 > #W_CLK = 15
  34 > W_CLK = port.PA3
  35 > #FQ_UD = 16
  36 > FQ_UD = port.PC4
  37 > #DATA = 18
  38 > DATA = port.PC7
  39 > #RESET = 22
  40 > RESET =port.PA2
  41 172,175c183,190
  42 < GPIO.setup(W_CLK, GPIO.OUT)
  43 < GPIO.setup(FQ_UD, GPIO.OUT)
  44 < GPIO.setup(DATA, GPIO.OUT)
  45 < GPIO.setup(RESET, GPIO.OUT)
  46 ---
  47 > #GPIO.setup(W_CLK, GPIO.OUT)
  48 > #GPIO.setup(FQ_UD, GPIO.OUT)
  49 > #GPIO.setup(DATA, GPIO.OUT)
  50 > #GPIO.setup(RESET, GPIO.OUT)
  51 > gpio.setcfg(W_CLK, gpio.OUTPUT)
  52 > gpio.setcfg(FQ_UD, gpio.OUTPUT)
  53 > gpio.setcfg(DATA, gpio.OUTPUT)
  54 > gpio.setcfg(RESET, gpio.OUTPUT)
  55 178,181c193,201
  56 < GPIO.output(W_CLK, False)
  57 < GPIO.output(FQ_UD, False)
  58 < GPIO.output(DATA, False)
  59 < GPIO.output(RESET, False)
  60 ---
  61 > #GPIO.output(W_CLK, False)
  62 > #GPIO.output(FQ_UD, False)
  63 > #GPIO.output(DATA, False)
  64 > #GPIO.output(RESET, False)
  65 > gpio.output(W_CLK, 0)
  66 > gpio.output(FQ_UD, 0)
  67 > gpio.output(DATA, 0)
  68 > gpio.output(RESET, 0)
  69 > 
  70 187c207,209
  71 < bus = i2c.I2CMaster()
  72 ---
  73 > #bus = i2c.I2CMaster()
  74 > i2c.init("/dev/i2c-0")
  75 > i2c.open(adc_address)
  76 191,192c213,216
  77 <     GPIO.output(pin, True)
  78 <     GPIO.output(pin, False)
  79 ---
  80 >     #GPIO.output(pin, True)
  81 >     #GPIO.output(pin, False)
  82 >     gpio.output(pin, 1)
  83 >     gpio.output(pin, 0)
  84 200c224,225
  85 <         GPIO.output(DATA, data & 0x01)
  86 ---
  87 >         #GPIO.output(DATA, data & 0x01)
  88 >         gpio.output(DATA, data & 0x01)
  89 215c240
  90 < # Function to set address for ADC
  91 ---
  92 > # Function to set address for ADC - not used ***
  93 240c265,266
  94 <     bus.transaction(i2c.writing_bytes(0x05, 0x03))
  95 ---
  96 >     #bus.transaction(i2c.writing_bytes(0x05, 0x03))
  97 >     i2c.write([0x05, 0x03]) #Write 0x03 to register 0x05
  98 242c268
  99 <     avhigh, avlow = bus.transaction(i2c.reading(address,2))[0]
 100 ---
 101 >     avhigh, avlow = i2c.read(2)
 102 266a293
 103 >         print("tk init")  # debug
 104 548a576
 105 >         print("sweep")  # debug
 106 585,586c613,614
 107 <             # AD8307 span 0.3 - 2.1 V, *185 = 10 dB/div
 108 <             y = int(500 - (reading * 185))
 109 ---
 110 >             # AD8307 span 0.3 - 2.1 V, *185 = 10 dB/div, +15 = offset
 111 >             y = int(500 + 25 - (reading * 185))
 112 645c673
 113 < root.wm_title('RPi Wobbulator v2.63RR, use "scrot -s" for window shot')
 114 ---
 115 > root.wm_title('RPi Wobbulator v2.6.3RR-OPi, use "scrot -s -d 4" for window shot')
 116 656a685
 117 > print("start mainloop")  # debug

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2016-12-28 11:05:00, 11.0 KB) [[attachment:Orange-pi-lite_panel-additions_364.png]]
  • [get | view] (2016-12-23 13:26:00, 168.1 KB) [[attachment:OrangePi_Lite_DSC06813.jpg]]
  • [get | view] (2017-03-08 09:01:00, 46.7 KB) [[attachment:OrangePi_housing_DSC06921.jpg]]
  • [get | view] (2016-12-28 09:54:00, 22.3 KB) [[attachment:Orange_pi_tkinter-test.png]]
  • [get | view] (2017-01-05 10:26:00, 206.3 KB) [[attachment:Wobbulator_OrangePiLiteXFCE.jpg]]
  • [get | view] (2017-01-05 06:32:00, 26.0 KB) [[attachment:wobbulator2.6.3o.py]]
  • [get | view] (2017-01-05 12:47:00, 2.8 KB) [[attachment:wobbulator_orangePi_patch.txt]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.