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 [2015/07/25 16:12] – [Autostart] 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> 
-aptitude install libx11-dev libxrender-dev libxext-dev portaudio19-dev libavcodec-dev libavformat-dev libswscale-dev libavdevice-dev  
-</code> 
- 
-Ubuntu 12.04 
 <code bash> <code bash>
 aptitude install libusb-1.0-0-dev libx11-dev libxrender-dev libxext-dev aptitude install libusb-1.0-0-dev libx11-dev libxrender-dev libxext-dev
 +
 </code> </code>
  
-SVN-checkout van de boblight software en deze compilen+Download 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
 +cd trunk
 ./configure --without-portaudio --without-opengl --without-x11 --prefix=/usr ./configure --without-portaudio --without-opengl --without-x11 --prefix=/usr
 make make
 make install make install
 +
  
 </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 50 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 304: Line 314:
  
 [device] [device]
-name ambilight +name            ambilight 
-type momo +type            momo 
-output /dev/ttyACM0 +output            /dev/ttyACM0 
-channels 150 +channels        150 
-prefix 41 64 61 00 31 64 +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 326: Line 335:
 name            blue name            blue
 rgb             0000FF rgb             0000FF
- 
  
 [light] [light]
Line 727: Line 735:
 hscan           58.82 64.71 hscan           58.82 64.71
 vscan           90.91 100 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:          boblight-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/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 806: Line 788:
  
 [[http://arduino.cc/hu/Main/Software|Arduino programeer software]] [[http://arduino.cc/hu/Main/Software|Arduino programeer software]]
 +
 +
hardware/ambilight.1437833524.txt.gz · Last modified: by excyle

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki