User Tools

Site Tools


hardware:ambilight

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
hardware:ambilight [2012/07/15 15:41] – [Software] excylehardware:ambilight [2024/02/22 20:35] (current) – [Software] excyle
Line 1: Line 1:
 ====== Ambilight clone ====== ====== Ambilight clone ======
 +
 Onder XBMC is het erg makkelijk om met een arduno en een digitale RGD ledstring een ambilight clone te maken, met heel aardig resultaat. Onder XBMC is het erg makkelijk om met een arduno en een digitale RGD ledstring een ambilight clone te maken, met heel aardig resultaat.
  
-{{:hardware:ambilight:voorbeeld.jpg?direct&100|}}+{{:hardware:ambilight:voorbeeld.jpg?direct&100}}
  
 ===== Onderdelen lijst ===== ===== Onderdelen lijst =====
 +
   * Arduino Uno   * Arduino Uno
   * RGB ledstring   * RGB ledstring
Line 11: Line 13:
  
 ===== Hardware ===== ===== Hardware =====
-Wat betreft de hardware is het vrij simpel + 
-vanaf de ledstring gaat de +Wat betreft de hardware is het vrij simpel vanaf de ledstring gaat de 
   * gnd naar de gnd van de arduino en de gnd van de adapter   * gnd naar de gnd van de arduino en de gnd van de adapter
   * +5 naar de +5 van de adapter   * +5 naar de +5 van de adapter
Line 21: Line 24:
  
 ter referentie hier ook de code zelf ter referentie hier ook de code zelf
 +
 <code c LEDstream.pde> <code c LEDstream.pde>
 // Arduino "bridge" code between host computer and WS2801-based digital // Arduino "bridge" code between host computer and WS2801-based digital
Line 197: Line 201:
           if(chk == (hi ^ lo ^ 0x55)) {           if(chk == (hi ^ lo ^ 0x55)) {
             // Checksum looks valid.  Get 16-bit LED count, add 1             // Checksum looks valid.  Get 16-bit LED count, add 1
-            // (# LEDs is always > 0) and multiply by 3 for R,G,B.+            // (# LEDs is always> 0) and multiply by 3 for R,G,B.
             bytesRemaining = 3L * (256L * (long)hi + (long)lo + 1L);             bytesRemaining = 3L * (256L * (long)hi + (long)lo + 1L);
             bytesBuffered -= 3;             bytesBuffered -= 3;
Line 240: Line 244:
           hold      = 100 + (32 - bytesBuffered) * 10;           hold      = 100 + (32 - bytesBuffered) * 10;
           mode      = MODE_HOLD;           mode      = MODE_HOLD;
- }+    }
       } else {       } else {
         // End of data -- issue latch:         // End of data -- issue latch:
Line 256: Line 260:
   // Not used.  See note in setup() function.   // Not used.  See note in setup() function.
 } }
 +
 </code> </code>
- 
  
 ===== Software ===== ===== Software =====
 +
 packages uit de standaard ubuntu repo installeren packages uit de standaard ubuntu repo installeren
  
-Ubuntu 10.04 
 <code bash> <code bash>
-aptitude install libx11-dev libxrender-dev libxext-dev portaudio19-dev libavcodec-dev libavformat-dev libswscale-dev libavdevice-dev +aptitude install libusb-1.0-0-dev libx11-dev libxrender-dev libxext-dev 
 </code> </code>
  
-Ubuntu 12.04 +Download van de boblight software en deze compilen
-<code bash> +
-aptitude install libusb-1.0.0-dev libx11-dev libxrender-dev libxext-dev +
-</code+
  
-SVN-checkout van de boblight software en deze compilen 
 <code bash> <code bash>
-svn checkout http://boblight.googlecode.com/svn/trunk/ boblight+wget https://storage.googleapis.com/google-code-archive-source/v2/code.google.com/boblight/source-archive.zip 
 + 
 +unzip source-archive.zip
  
 #compilen #compilen
 cd boblight cd boblight
-./configure --without-opengl --without-portaudio+cd trunk 
 +./configure --without-portaudio --without-opengl --without-x11 --prefix=/usr
 make make
 make install make install
  
-#XBMC plugin fixen onder 64-bit ubuntu +
-ln -s /usr/local/lib/boblight.so /usr/lib/boblight.so+
 </code> </code>
  
 ===== configuratie ===== ===== configuratie =====
-vervolgens moet je een boblight config maken, het LED gedeelte kan je automagisch via [[http://sanya.tarhelyszolgaltato.eu/|deze]] link laten genereren. + 
 +vervolgens moet je een boblight config maken, het LED gedeelte kan je automagisch via [[http://sanya.tarhelyszolgaltato.eu/|deze]] link laten genereren.
  
 Je krijgt dan het "Light" gedeelte uit de config en een plaatje hoe je de leds moet plaatsen. Je krijgt dan het "Light" gedeelte uit de config en een plaatje hoe je de leds moet plaatsen.
  
-{{:hardware:ambilight:pic.png?direct&100|}}+{{:hardware:ambilight:pic.png?direct&100}} 
 + 
 +(voor 50 leds is deze config bruikbaar)
  
-(voor 25 leds is deze config bruikbaar) 
 <code bash> <code bash>
 mcedit /etc/boblight.conf mcedit /etc/boblight.conf
 +
 </code> </code>
 +
 zet hier de volgende code in : zet hier de volgende code in :
 +
 <code xorg_conf boblight.conf> <code xorg_conf boblight.conf>
 #config file for adalight from http://www.ladyada.net/make/adalight/ #config file for adalight from http://www.ladyada.net/make/adalight/
Line 306: Line 314:
  
 [device] [device]
-name ambilight +name            ambilight 
-type momo +type            momo 
-output /dev/ttyACM0 +output            /dev/ttyACM0 
-channels 75 +channels        150 
-prefix 41 64 61 00 18 4D +prefix            41 64 61 00 31 64 
-interval 10000 +interval        10000 
-rate 115200 +rate            115200 
-debug off #turn this on to see what it's doing with the serial port +debug            off #turn this on to see what it's doing with the serial port 
-delayafteropen 1000000 +delayafteropen    1000000
  
 [color] [color]
Line 328: Line 335:
 name            blue name            blue
 rgb             0000FF rgb             0000FF
- 
  
 [light] [light]
Line 335: Line 341:
 color           green   ambilight 2 color           green   ambilight 2
 color           blue    ambilight 3 color           blue    ambilight 3
-hscan           33.33 44.44 +hscan           47.06 52.94 
-vscan           83.33 100+vscan           90.91 100
  
 [light] [light]
Line 343: Line 349:
 color           green   ambilight 5 color           green   ambilight 5
 color           blue    ambilight 6 color           blue    ambilight 6
-hscan           22.24 33.35 +hscan           35.31 41.19 
-vscan           83.33 100+vscan           90.91 100
  
 [light] [light]
Line 351: Line 357:
 color           green   ambilight 8 color           green   ambilight 8
 color           blue    ambilight 9 color           blue    ambilight 9
-hscan           11.09 22.2 +hscan           29.43 35.31 
-vscan           83.33 100+vscan           90.91 100
  
 [light] [light]
Line 359: Line 365:
 color           green   ambilight 11 color           green   ambilight 11
 color           blue    ambilight 12 color           blue    ambilight 12
-hscan           0 11.11 +hscan           23.54 29.42 
-vscan           83.33 100+vscan           90.91 100
  
 [light] [light]
Line 367: Line 373:
 color           green   ambilight 14 color           green   ambilight 14
 color           blue    ambilight 15 color           blue    ambilight 15
-hscan           0 11.11 +hscan           17.66 23.54 
-vscan           66.67 83.33+vscan           90.91 100
  
 [light] [light]
Line 375: Line 381:
 color           green   ambilight 17 color           green   ambilight 17
 color           blue    ambilight 18 color           blue    ambilight 18
-hscan           11.11 +hscan           11.77 17.65 
-vscan           50 66.67+vscan           90.91 100
  
 [light] [light]
Line 383: Line 389:
 color           green   ambilight 20 color           green   ambilight 20
 color           blue    ambilight 21 color           blue    ambilight 21
-hscan           0 11.11 +hscan           5.89 11.77 
-vscan           33.33 50+vscan           90.91 100
  
 [light] [light]
Line 391: Line 397:
 color           green   ambilight 23 color           green   ambilight 23
 color           blue    ambilight 24 color           blue    ambilight 24
-hscan           11.11 +hscan           5.88 
-vscan           16.67 33.33+vscan           90.91 100
  
 [light] [light]
Line 399: Line 405:
 color           green   ambilight 26 color           green   ambilight 26
 color           blue    ambilight 27 color           blue    ambilight 27
-hscan           11.11 +hscan           5.88 
-vscan           0 16.67+vscan           81.82 90.91
  
 [light] [light]
Line 407: Line 413:
 color           green   ambilight 29 color           green   ambilight 29
 color           blue    ambilight 30 color           blue    ambilight 30
-hscan           11.11 22.22 +hscan           0 5.88 
-vscan           0 16.67+vscan           72.73 81.82
  
 [light] [light]
Line 415: Line 421:
 color           green   ambilight 32 color           green   ambilight 32
 color           blue    ambilight 33 color           blue    ambilight 33
-hscan           22.22 33.33 +hscan           0 5.88 
-vscan           0 16.67+vscan           63.64 72.73
  
 [light] [light]
Line 423: Line 429:
 color           green   ambilight 35 color           green   ambilight 35
 color           blue    ambilight 36 color           blue    ambilight 36
-hscan           33.33 44.44 +hscan           0 5.88 
-vscan           0 16.67+vscan           54.55 63.64
  
 [light] [light]
Line 431: Line 437:
 color           green   ambilight 38 color           green   ambilight 38
 color           blue    ambilight 39 color           blue    ambilight 39
-hscan           44.44 55.55 +hscan           0 5.88 
-vscan           0 16.67+vscan           45.46 54.55
  
 [light] [light]
Line 439: Line 445:
 color           green   ambilight 41 color           green   ambilight 41
 color           blue    ambilight 42 color           blue    ambilight 42
-hscan           55.55 66.67 +hscan           0 5.88 
-vscan           0 16.67+vscan           36.36 45.46
  
 [light] [light]
Line 447: Line 453:
 color           green   ambilight 44 color           green   ambilight 44
 color           blue    ambilight 45 color           blue    ambilight 45
-hscan           66.67 77.78 +hscan           0 5.88 
-vscan           0 16.67+vscan           27.27 36.36
  
 [light] [light]
Line 455: Line 461:
 color           green   ambilight 47 color           green   ambilight 47
 color           blue    ambilight 48 color           blue    ambilight 48
-hscan           77.78 88.89 +hscan           0 5.88 
-vscan           0 16.67+vscan           18.18 27.27
  
 [light] [light]
Line 463: Line 469:
 color           green   ambilight 50 color           green   ambilight 50
 color           blue    ambilight 51 color           blue    ambilight 51
-hscan           88.89 100 +hscan           0 5.88 
-vscan           0 16.67+vscan           9.09 18.18
  
 [light] [light]
Line 471: Line 477:
 color           green   ambilight 53 color           green   ambilight 53
 color           blue    ambilight 54 color           blue    ambilight 54
-hscan           88.89 100 +hscan           0 5.88 
-vscan           16.67 33.33+vscan           0 9.09
  
 [light] [light]
Line 479: Line 485:
 color           green   ambilight 56 color           green   ambilight 56
 color           blue    ambilight 57 color           blue    ambilight 57
-hscan           88.89 100 +hscan           5.88 11.76 
-vscan           33.33 50+vscan           0 9.09
  
 [light] [light]
Line 487: Line 493:
 color           green   ambilight 59 color           green   ambilight 59
 color           blue    ambilight 60 color           blue    ambilight 60
-hscan           88.89 100 +hscan           11.76 17.65 
-vscan           50 66.67+vscan           0 9.09
  
 [light] [light]
Line 495: Line 501:
 color           green   ambilight 62 color           green   ambilight 62
 color           blue    ambilight 63 color           blue    ambilight 63
-hscan           88.89 100 +hscan           17.65 23.53 
-vscan           66.67 83.33+vscan           0 9.09
  
 [light] [light]
Line 503: Line 509:
 color           green   ambilight 65 color           green   ambilight 65
 color           blue    ambilight 66 color           blue    ambilight 66
-hscan           88.89 100 +hscan           23.53 29.41 
-vscan           83.33 100+vscan           0 9.09
  
 [light] [light]
Line 511: Line 517:
 color           green   ambilight 68 color           green   ambilight 68
 color           blue    ambilight 69 color           blue    ambilight 69
-hscan           77.78 88.89 +hscan           29.41 35.29 
-vscan           83.33 100+vscan           0 9.09
  
 [light] [light]
Line 519: Line 525:
 color           green   ambilight 71 color           green   ambilight 71
 color           blue    ambilight 72 color           blue    ambilight 72
-hscan           66.67 77.78 +hscan           35.29 41.18 
-vscan           83.33 100+vscan           0 9.09
  
 [light] [light]
Line 527: Line 533:
 color           green   ambilight 74 color           green   ambilight 74
 color           blue    ambilight 75 color           blue    ambilight 75
-hscan           55.55 66.67 +hscan           41.18 47.06 
-vscan           83.33 100+vscan           0 9.09 
 + 
 +[light] 
 +name            26 
 +color           red     ambilight 76 
 +color           green   ambilight 77 
 +color           blue    ambilight 78 
 +hscan           47.06 52.94 
 +vscan           0 9.09 
 + 
 +[light] 
 +name            27 
 +color           red     ambilight 79 
 +color           green   ambilight 80 
 +color           blue    ambilight 81 
 +hscan           52.94 58.82 
 +vscan           0 9.09 
 + 
 +[light] 
 +name            28 
 +color           red     ambilight 82 
 +color           green   ambilight 83 
 +color           blue    ambilight 84 
 +hscan           58.82 64.71 
 +vscan           0 9.09 
 + 
 +[light] 
 +name            29 
 +color           red     ambilight 85 
 +color           green   ambilight 86 
 +color           blue    ambilight 87 
 +hscan           64.71 70.59 
 +vscan           0 9.09 
 + 
 +[light] 
 +name            30 
 +color           red     ambilight 88 
 +color           green   ambilight 89 
 +color           blue    ambilight 90 
 +hscan           70.59 76.47 
 +vscan           0 9.09 
 + 
 +[light] 
 +name            31 
 +color           red     ambilight 91 
 +color           green   ambilight 92 
 +color           blue    ambilight 93 
 +hscan           76.47 82.35 
 +vscan           0 9.09 
 + 
 +[light] 
 +name            32 
 +color           red     ambilight 94 
 +color           green   ambilight 95 
 +color           blue    ambilight 96 
 +hscan           82.35 88.23 
 +vscan           0 9.09 
 + 
 +[light] 
 +name            33 
 +color           red     ambilight 97 
 +color           green   ambilight 98 
 +color           blue    ambilight 99 
 +hscan           88.23 94.12 
 +vscan           0 9.09 
 + 
 +[light] 
 +name            34 
 +color           red     ambilight 100 
 +color           green   ambilight 101 
 +color           blue    ambilight 102 
 +hscan           94.12 100 
 +vscan           0 9.09 
 + 
 +[light] 
 +name            35 
 +color           red     ambilight 103 
 +color           green   ambilight 104 
 +color           blue    ambilight 105 
 +hscan           94.12 100 
 +vscan           9.09 18.18 
 + 
 +[light] 
 +name            36 
 +color           red     ambilight 106 
 +color           green   ambilight 107 
 +color           blue    ambilight 108 
 +hscan           94.12 100 
 +vscan           18.18 27.27 
 + 
 +[light] 
 +name            37 
 +color           red     ambilight 109 
 +color           green   ambilight 110 
 +color           blue    ambilight 111 
 +hscan           94.12 100 
 +vscan           27.27 36.36 
 + 
 +[light] 
 +name            38 
 +color           red     ambilight 112 
 +color           green   ambilight 113 
 +color           blue    ambilight 114 
 +hscan           94.12 100 
 +vscan           36.36 45.45 
 + 
 +[light] 
 +name            39 
 +color           red     ambilight 115 
 +color           green   ambilight 116 
 +color           blue    ambilight 117 
 +hscan           94.12 100 
 +vscan           45.45 54.54 
 + 
 +[light] 
 +name            40 
 +color           red     ambilight 118 
 +color           green   ambilight 119 
 +color           blue    ambilight 120 
 +hscan           94.12 100 
 +vscan           54.54 63.64 
 + 
 +[light] 
 +name            41 
 +color           red     ambilight 121 
 +color           green   ambilight 122 
 +color           blue    ambilight 123 
 +hscan           94.12 100 
 +vscan           63.64 72.73 
 + 
 +[light] 
 +name            42 
 +color           red     ambilight 124 
 +color           green   ambilight 125 
 +color           blue    ambilight 126 
 +hscan           94.12 100 
 +vscan           72.73 81.82 
 + 
 +[light] 
 +name            43 
 +color           red     ambilight 127 
 +color           green   ambilight 128 
 +color           blue    ambilight 129 
 +hscan           94.12 100 
 +vscan           81.82 90.91 
 + 
 +[light] 
 +name            44 
 +color           red     ambilight 130 
 +color           green   ambilight 131 
 +color           blue    ambilight 132 
 +hscan           94.12 100 
 +vscan           90.91 100 
 + 
 +[light] 
 +name            45 
 +color           red     ambilight 133 
 +color           green   ambilight 134 
 +color           blue    ambilight 135 
 +hscan           88.24 94.12 
 +vscan           90.91 100 
 + 
 +[light] 
 +name            46 
 +color           red     ambilight 136 
 +color           green   ambilight 137 
 +color           blue    ambilight 138 
 +hscan           82.35 88.24 
 +vscan           90.91 100 
 + 
 +[light] 
 +name            47 
 +color           red     ambilight 139 
 +color           green   ambilight 140 
 +color           blue    ambilight 141 
 +hscan           76.47 82.35 
 +vscan           90.91 100 
 + 
 +[light] 
 +name            48 
 +color           red     ambilight 142 
 +color           green   ambilight 143 
 +color           blue    ambilight 144 
 +hscan           70.59 76.47 
 +vscan           90.91 100 
 + 
 +[light] 
 +name            49 
 +color           red     ambilight 145 
 +color           green   ambilight 146 
 +color           blue    ambilight 147 
 +hscan           64.71 70.59 
 +vscan           90.91 100 
 + 
 +[light] 
 +name            50 
 +color           red     ambilight 148 
 +color           green   ambilight 149 
 +color           blue    ambilight 150 
 +hscan           58.82 64.71 
 +vscan           90.91 100 
 </code> </code>
  
 Met de prefix bepaal je ook hoeveel leds je aanstuurd, gebruik dus altijd de juiste Met de prefix bepaal je ook hoeveel leds je aanstuurd, gebruik dus altijd de juiste
 <code> <code>
 +
 Prefix for 25 LEDS: 41 64 61 00 18 4D Prefix for 25 LEDS: 41 64 61 00 18 4D
 Prefix for 50 LEDS: 41 64 61 00 31 64 Prefix for 50 LEDS: 41 64 61 00 31 64
 Prefix for 100 LEDS: 41 64 61 00 63 36 Prefix for 100 LEDS: 41 64 61 00 63 36
 +
 </code> </code>
  
 ===== Autostart ===== ===== Autostart =====
 +
 uiteraard willen we het geheel automagisch starten. uiteraard willen we het geheel automagisch starten.
  
 <code bash> <code bash>
-mcedit /etc/init.d/boblight+mcedit /usr/lib/systemd/system/boblight.service 
 </code> </code>
 +
 zet hier het volgende in zet hier het volgende in
-<code xorg_conf boblight> 
-#!/bin/sh -e 
-### BEGIN INIT INFO 
-# Provides:          transmission-daemon 
-# Required-Start:    $local_fs $remote_fs $network 
-# Required-Stop:     $local_fs $remote_fs $network 
-# Default-Start:     2 3 4 5 
-# Default-Stop:      0 1 6 
-# Short-Description: Start or stop the transmission-daemon. 
-### END INIT INFO 
  
-/lib/lsb/init-functions+<code xorg_conf boblight.service> 
 +[Unit] 
 +Description=Boblight Ambient Lighting Daemon 
 +DefaultDependencies=no 
 +After=network.target
  
 +[Service]
 +ExecStart=/usr/bin/boblightd > /var/log/boblightd 2>&1
 +Restart=on-abort
  
-start_daemon() +[Install] 
-+WantedBy=multi-user.target
- /usr/local/bin/boblightd -f > /var/log/boblightd 2>&+
-+
- +
-stop_daemon() +
-+
- killall boblightd +
-}+
  
- 
-case "$1" in 
-    start) 
-        log_daemon_msg "Starting boblight daemon" 
-        start_daemon 
-        log_end_msg 0 
-        ;; 
-    stop) 
-        log_daemon_msg "Stopping boblight daemon" 
-        stop_daemon 
-        log_end_msg 0 
-        ;; 
-    restart|force-reload) 
-        log_daemon_msg "Restarting boblight daemon" 
-        stop_daemon 
-        start_daemon 
-        log_end_msg 0 
-        ;; 
-    *) 
-        echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart}" 
-        exit 2 
-        ;; 
-esac 
- 
-exit 0 
 </code> </code>
  
 en laat deze automagisch starten en laat deze automagisch starten
 +
 <code bash> <code bash>
-chmod +x /etc/init.d/boblight +systemctl daemon-reload 
-update-rc.d boblight defaults+systemctl enable boblight 
 </code> </code>
  
 ===== Sources ===== ===== Sources =====
 +
 [[http://www.pieterfloris.nl/shop/product.php?id_product=485|Arduino Uno]] [[http://www.pieterfloris.nl/shop/product.php?id_product=485|Arduino Uno]]
  
Line 608: Line 788:
  
 [[http://arduino.cc/hu/Main/Software|Arduino programeer software]] [[http://arduino.cc/hu/Main/Software|Arduino programeer software]]
 +
 +
hardware/ambilight.1342359709.txt.gz · Last modified: (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki