Hardware components | ||||||
| × | 1 |
My daughter got an R2D2 toy believing it was electronically controlled, just to find out that it was only an empty shell. She was very disappointed, so I said I could probably make it come alive. So this is where it all started.
The R2D2 is made by JAKKS PACIFIC.
The challenge was to add the mechanical component that were missing inside the shell. Thankfully, I have a 3D printer, I really love it!
I had to print a few parts and put together some electronics. Here is the breakdown:
Head Gear and Head Optical InterrupterThe head gear is mounted on a geared DC motor (bottom left) I got off ebay. The motor are controlled using a DRV8833 H-Bridge circuit via the PCA9685 I2C PWM drive circuit.
The optical beam interrupter (top right) is used with 3 optical switches. The switches provide travel limits to the head. The optical switches are wired to regular GPIO on the RPi.
For this project I purchased an off the shelf lithium battery that provides a 5V output. I took the cells out and the charging circuit and I made some mounting hardware and a button to be able to push it to see the 4 LED indicating the state of charge. I also added an On/Off circuit to control cycle the RPi on or off. The motors and all the circuits that needs a lot of current are wired directly to the 5V supply.
The RPi, PCA9685 and the DRV8833 circuit are mounted on an adapter inside the shell.
One of the leg has the ability to go up and down. So I used an HS-422 motor and removed the internal drive circuit and made an adapter to hold the motor and an optical switch. The motor has a CAM mounted on it. The CAM has a beam interrupter build-in to detect when the leg is in the bottom position.
I added 4 LED (2 x Red, 1 x Green and 1 x Blue). These LED all came from a defective Christmas light string. Can go cheaper than that!
So I assembled the LED on a proto board and made sure they were allign along with some mounting holes.
Having sound does make this project a lot more fun! So I bought once again an off the shelf (cheap...) speaker that had an amplifier in it as well. The one I bough was battery powered with 3 AAA battery. I took out the unnecessary hardware and glued it on the inside shell.
There was also a spot to add a couple of push button switches. I assemble them on a proto board an made some spacer (3D printed of course!) to give the proper clearance for the switches.
Since this is a battery powered toy using a rechargeable lithium battery, I added a circuit for allowing to turn on and off the RPi in a clean way. The circuit uses a push button switch to latch the power on. To turn off the button is pressed again an the state of the button is sensed by the RPi (GPIO04) to trigger a clean shutdown.
All the power hungry circuits are wired directly to the 5V supply. This is to prevent any voltage drop that would cause a reset of the RPi. The PCA9685 and the DRV8833 are both disabled when the RPi is off. They are enable after the program runs. The DRV8833 circuit is used to control both DC motors and also it controls the power to the speaker and the optical switches. The LED are controlled by the PCA9685.
Adding Audio to RPi ZeroWe need to add an external circuit to add audio to the Raspberry Pi Zero W.
I followed the instruction found here along with the external circuit:
Electrical CircuitFor controlling the R2D2pi I used NodeRed with the following Nodes:
1 - node-red-contrib-pca9685 (Control the PCA9685 board)
2 - node-red-contrib-speakerpi (Send audio to the speaker)
3 - node-red-dashboard (Used to build a web GUI)
- Add a microphone for voice recognition
- Add an alarm clock feature
- Sky is the limit, really...
{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf600
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\fs24 \cf0 [\
\{\
"id": "3485c53.773583a",\
"type": "PCA9685 out",\
"z": "311c8b43.5c0584",\
"name": "Head Motor In1",\
"pca9685": "84df5fdf.7962",\
"channel": "0",\
"payload": "",\
"unit": "percent",\
"onStep": "0",\
"x": 1032,\
"y": 358,\
"wires": []\
\},\
\{\
"id": "9ce790a.dd6127",\
"type": "PCA9685 out",\
"z": "311c8b43.5c0584",\
"name": "Opto Sensor Power",\
"pca9685": "84df5fdf.7962",\
"channel": "6",\
"payload": "",\
"unit": "percent",\
"onStep": "0",\
"x": 892,\
"y": 107,\
"wires": []\
\},\
\{\
"id": "1391d36f.9ba98d",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "Off",\
"topic": "",\
"payload": "0",\
"payloadType": "num",\
"repeat": "",\
"crontab": "",\
"once": false,\
"x": 678,\
"y": 130,\
"wires": [\
[\
"9ce790a.dd6127"\
]\
]\
\},\
\{\
"id": "56889913.0d0208",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "100%",\
"topic": "",\
"payload": "100",\
"payloadType": "num",\
"repeat": "",\
"crontab": "",\
"once": true,\
"onceDelay": "",\
"x": 679,\
"y": 90,\
"wires": [\
[\
"9ce790a.dd6127"\
]\
]\
\},\
\{\
"id": "2c19f6f8.7281ba",\
"type": "ui_slider",\
"z": "311c8b43.5c0584",\
"name": "",\
"label": "Motor Speed",\
"group": "4f5830f7.70499",\
"order": 1,\
"width": 0,\
"height": 0,\
"passthru": true,\
"topic": "MotorCommand",\
"min": "-100",\
"max": "100",\
"step": "100",\
"x": 303,\
"y": 372,\
"wires": [\
[\
"7a4fc5ec.fc77ec",\
"acae2226.82f26"\
]\
]\
\},\
\{\
"id": "354753aa.32dc4c",\
"type": "PCA9685 out",\
"z": "311c8b43.5c0584",\
"name": "LED Blue",\
"pca9685": "84df5fdf.7962",\
"channel": "12",\
"payload": "",\
"unit": "percent",\
"onStep": "0",\
"x": 556,\
"y": 590,\
"wires": []\
\},\
\{\
"id": "a3818cb8.cfac7",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "Off",\
"topic": "",\
"payload": "0",\
"payloadType": "num",\
"repeat": "1",\
"crontab": "",\
"once": true,\
"onceDelay": "",\
"x": 230,\
"y": 606,\
"wires": [\
[\
"e295323a.18cb9"\
]\
]\
\},\
\{\
"id": "ba68a1ae.36caf",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "100%",\
"topic": "",\
"payload": "100",\
"payloadType": "num",\
"repeat": ".75",\
"crontab": "",\
"once": true,\
"onceDelay": "",\
"x": 241,\
"y": 566,\
"wires": [\
[\
"e295323a.18cb9"\
]\
]\
\},\
\{\
"id": "a7280aff.f84388",\
"type": "PCA9685 out",\
"z": "311c8b43.5c0584",\
"name": "LED Green",\
"pca9685": "84df5fdf.7962",\
"channel": "13",\
"payload": "",\
"unit": "percent",\
"onStep": "0",\
"x": 563,\
"y": 734,\
"wires": []\
\},\
\{\
"id": "fc12716a.f039e",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "Off",\
"topic": "",\
"payload": "0",\
"payloadType": "num",\
"repeat": "0.75",\
"crontab": "",\
"once": true,\
"onceDelay": "",\
"x": 233,\
"y": 748,\
"wires": [\
[\
"be22b1fa.e27aa"\
]\
]\
\},\
\{\
"id": "2887785d.46fc98",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "100%",\
"topic": "",\
"payload": "100",\
"payloadType": "num",\
"repeat": "1",\
"crontab": "",\
"once": true,\
"onceDelay": "",\
"x": 218,\
"y": 704,\
"wires": [\
[\
"be22b1fa.e27aa"\
]\
]\
\},\
\{\
"id": "c5912ae8.456dd8",\
"type": "PCA9685 out",\
"z": "311c8b43.5c0584",\
"name": "LED Red Top",\
"pca9685": "84df5fdf.7962",\
"channel": "14",\
"payload": "",\
"unit": "percent",\
"onStep": "0",\
"x": 562,\
"y": 876,\
"wires": []\
\},\
\{\
"id": "81bc7696.1405f8",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "Off",\
"topic": "",\
"payload": "0",\
"payloadType": "num",\
"repeat": "1",\
"crontab": "",\
"once": true,\
"onceDelay": "",\
"x": 230,\
"y": 890,\
"wires": [\
[\
"144ae88f.034667"\
]\
]\
\},\
\{\
"id": "238ab939.4c29d6",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "100%",\
"topic": "",\
"payload": "100",\
"payloadType": "num",\
"repeat": ".33",\
"crontab": "",\
"once": true,\
"onceDelay": "",\
"x": 241,\
"y": 848,\
"wires": [\
[\
"144ae88f.034667"\
]\
]\
\},\
\{\
"id": "3638bd65.0a3752",\
"type": "PCA9685 out",\
"z": "311c8b43.5c0584",\
"name": "LED Red Bot",\
"pca9685": "84df5fdf.7962",\
"channel": "15",\
"payload": "",\
"unit": "percent",\
"onStep": "0",\
"x": 570,\
"y": 1016,\
"wires": []\
\},\
\{\
"id": "ebd0f1a6.d930c",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "Off",\
"topic": "",\
"payload": "0",\
"payloadType": "num",\
"repeat": ".75",\
"crontab": "",\
"once": false,\
"onceDelay": "",\
"x": 226,\
"y": 1033,\
"wires": [\
[\
"bccd5ede.4bfd6"\
]\
]\
\},\
\{\
"id": "395dcd0c.72ab22",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "100%",\
"topic": "",\
"payload": "100",\
"payloadType": "num",\
"repeat": ".25",\
"crontab": "",\
"once": false,\
"onceDelay": "",\
"x": 236,\
"y": 994,\
"wires": [\
[\
"bccd5ede.4bfd6"\
]\
]\
\},\
\{\
"id": "e295323a.18cb9",\
"type": "ui_switch",\
"z": "311c8b43.5c0584",\
"name": "",\
"label": "LED Blue",\
"group": "4b44ac65.e676c4",\
"order": 2,\
"width": 0,\
"height": 0,\
"passthru": true,\
"decouple": "false",\
"topic": "",\
"style": "",\
"onvalue": "100",\
"onvalueType": "num",\
"onicon": "",\
"oncolor": "",\
"offvalue": "0",\
"offvalueType": "num",\
"officon": "",\
"offcolor": "",\
"x": 369,\
"y": 590,\
"wires": [\
[\
"354753aa.32dc4c"\
]\
]\
\},\
\{\
"id": "be22b1fa.e27aa",\
"type": "ui_switch",\
"z": "311c8b43.5c0584",\
"name": "",\
"label": "LED Green",\
"group": "4b44ac65.e676c4",\
"order": 4,\
"width": 0,\
"height": 0,\
"passthru": true,\
"decouple": "false",\
"topic": "LED_Green",\
"style": "",\
"onvalue": "100",\
"onvalueType": "num",\
"onicon": "",\
"oncolor": "",\
"offvalue": "0",\
"offvalueType": "num",\
"officon": "",\
"offcolor": "",\
"x": 376,\
"y": 733,\
"wires": [\
[\
"a7280aff.f84388"\
]\
]\
\},\
\{\
"id": "144ae88f.034667",\
"type": "ui_switch",\
"z": "311c8b43.5c0584",\
"name": "",\
"label": "LED Red T",\
"group": "4b44ac65.e676c4",\
"order": 6,\
"width": 0,\
"height": 0,\
"passthru": true,\
"decouple": "false",\
"topic": "",\
"style": "",\
"onvalue": "100",\
"onvalueType": "num",\
"onicon": "",\
"oncolor": "",\
"offvalue": "0",\
"offvalueType": "num",\
"officon": "",\
"offcolor": "",\
"x": 377,\
"y": 876,\
"wires": [\
[\
"c5912ae8.456dd8"\
]\
]\
\},\
\{\
"id": "bccd5ede.4bfd6",\
"type": "ui_switch",\
"z": "311c8b43.5c0584",\
"name": "",\
"label": "LED Red B",\
"group": "4b44ac65.e676c4",\
"order": 8,\
"width": 0,\
"height": 0,\
"passthru": true,\
"decouple": "false",\
"topic": "",\
"style": "",\
"onvalue": "100",\
"onvalueType": "num",\
"onicon": "",\
"oncolor": "",\
"offvalue": "0",\
"offvalueType": "num",\
"officon": "",\
"offcolor": "",\
"x": 379,\
"y": 1015,\
"wires": [\
[\
"3638bd65.0a3752"\
]\
]\
\},\
\{\
"id": "84ad92e.3326c7",\
"type": "rpi-gpio in",\
"z": "311c8b43.5c0584",\
"name": "Left Sensor",\
"pin": "15",\
"intype": "tri",\
"debounce": "1",\
"read": true,\
"x": 210,\
"y": 51,\
"wires": [\
[\
"6c93671a.1bba58"\
]\
]\
\},\
\{\
"id": "20f40b4a.846e94",\
"type": "ui_text",\
"z": "311c8b43.5c0584",\
"group": "4b44ac65.e676c4",\
"order": 10,\
"width": 0,\
"height": 0,\
"name": "",\
"label": "Left Sensor",\
"format": "\{\{msg.payload\}\}",\
"layout": "row-spread",\
"x": 460,\
"y": 104,\
"wires": []\
\},\
\{\
"id": "cdffee97.e8896",\
"type": "rpi-gpio in",\
"z": "311c8b43.5c0584",\
"name": "Mid Sensor",\
"pin": "16",\
"intype": "tri",\
"debounce": "1",\
"read": true,\
"x": 218,\
"y": 145,\
"wires": [\
[\
"3b6ccee.f799f32"\
]\
]\
\},\
\{\
"id": "d9f6faf9.084cb8",\
"type": "ui_text",\
"z": "311c8b43.5c0584",\
"group": "4b44ac65.e676c4",\
"order": 12,\
"width": 0,\
"height": 0,\
"name": "",\
"label": "Mid Sensor",\
"format": "\{\{msg.payload\}\}",\
"layout": "row-spread",\
"x": 459,\
"y": 192,\
"wires": []\
\},\
\{\
"id": "665381ac.5e23",\
"type": "rpi-gpio in",\
"z": "311c8b43.5c0584",\
"name": "Right Sensor",\
"pin": "18",\
"intype": "tri",\
"debounce": "1",\
"read": true,\
"x": 219,\
"y": 230,\
"wires": [\
[\
"986361cc.4391b"\
]\
]\
\},\
\{\
"id": "39032a55.255716",\
"type": "ui_text",\
"z": "311c8b43.5c0584",\
"group": "4b44ac65.e676c4",\
"order": 14,\
"width": 0,\
"height": 0,\
"name": "",\
"label": "Right Sensor",\
"format": "\{\{msg.payload\}\}",\
"layout": "row-spread",\
"x": 457,\
"y": 272,\
"wires": []\
\},\
\{\
"id": "7a4fc5ec.fc77ec",\
"type": "function",\
"z": "311c8b43.5c0584",\
"name": "set left speed",\
"func": "var in1 = \{ payload: 0 \};\\nvar in2 = \{ payload: 0 \};\\nvar CurrentDirection = \{ payload: 0 \};\\n\\n// initialise the counter to 0 if it doesn't exist already\\nvar LeftSensorState = context.get('LeftSensorState')||0;\\nvar MidSensorState = context.get('MidSensorState')||0;\\nvar RightSensorState = context.get('RightSensorState')||0;\\nvar MotorCommand = context.get('MotorCommand')||0;\\nvar Trigger = context.get('Trigger')||0;\\n\\n\\n\\nif(msg.topic === \\"LeftSensor\\")\{\\n LeftSensorState = msg.payload;\\n context.set('LeftSensorState', msg.payload);\\n\}\\n\\nif(msg.topic === \\"MidSensor\\")\{\\n MidSensorState = msg.payload;\\n context.set('MidSensorState', msg.payload);\\n\}\\n\\nif(msg.topic === \\"RightSensor\\")\{\\n RightSensorState = msg.payload;\\n context.set('RightSensorState', msg.payload);\\n\}\\n\\nif(msg.topic === \\"MotorCommand\\")\{\\n MotorCommand = msg.payload;\\n context.set('MotorCommand', msg.payload);\\n\}\\n\\nif(msg.topic === \\"Trigger\\")\{\\n Trigger = msg.payload;\\n context.set('Trigger', msg.payload);\\n\}\\n\\n\\nif ( (MotorCommand > 0) && (RightSensorState === 0) ) \\n\{\\n CurrentDirection = \{ payload: 2 \};\\n \\n\\n in2 = \{ payload: 0 \};\\n in1 = \{ payload: MotorCommand \};\\n\\n\\n\} \\nelse if ( (MotorCommand < 0) && (LeftSensorState === 0) ) \\n\{\\n CurrentDirection = \{ payload: 1 \};\\n\\n in1 = \{ payload: 0 \};\\n in2 = \{ payload: Math.abs(MotorCommand) \};\\n\\n\}\\nelse\\n\{\\n in1 = \{ payload: 0 \};\\n in2 = \{ payload: 0 \};\\n CurrentDirection = \{ payload: 0 \};\\n\}\\n\\n\\nreturn [ in1, in2, CurrentDirection ];",\
"outputs": 3,\
"noerr": 0,\
"x": 819,\
"y": 372,\
"wires": [\
[\
"3485c53.773583a"\
],\
[\
"1d0c8657.10059a"\
],\
[\
"a4a2564d.1a6528"\
]\
]\
\},\
\{\
"id": "1d0c8657.10059a",\
"type": "PCA9685 out",\
"z": "311c8b43.5c0584",\
"name": "Head Motor In2",\
"pca9685": "84df5fdf.7962",\
"channel": "1",\
"payload": "",\
"unit": "percent",\
"onStep": "0",\
"x": 1032,\
"y": 394,\
"wires": []\
\},\
\{\
"id": "99cdda3.73e8928",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "Off",\
"topic": "",\
"payload": "0",\
"payloadType": "num",\
"repeat": "",\
"crontab": "",\
"once": false,\
"x": 88,\
"y": 373,\
"wires": [\
[\
"2c19f6f8.7281ba"\
]\
]\
\},\
\{\
"id": "42de3b38.d6f104",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "Forward",\
"topic": "",\
"payload": "100",\
"payloadType": "num",\
"repeat": "",\
"crontab": "",\
"once": false,\
"onceDelay": "",\
"x": 96,\
"y": 337,\
"wires": [\
[\
"2c19f6f8.7281ba"\
]\
]\
\},\
\{\
"id": "b25f0270.576e",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "Reverse",\
"topic": "",\
"payload": "-100",\
"payloadType": "num",\
"repeat": "",\
"crontab": "",\
"once": false,\
"onceDelay": "",\
"x": 87,\
"y": 409,\
"wires": [\
[\
"2c19f6f8.7281ba"\
]\
]\
\},\
\{\
"id": "6c93671a.1bba58",\
"type": "change",\
"z": "311c8b43.5c0584",\
"name": "LeftSensor Topic",\
"rules": [\
\{\
"t": "change",\
"p": "topic",\
"pt": "msg",\
"from": "topic",\
"fromt": "msg",\
"to": "LeftSensor",\
"tot": "str"\
\}\
],\
"action": "",\
"property": "",\
"from": "",\
"to": "",\
"reg": false,\
"x": 219,\
"y": 104,\
"wires": [\
[\
"20f40b4a.846e94",\
"7a4fc5ec.fc77ec"\
]\
]\
\},\
\{\
"id": "3b6ccee.f799f32",\
"type": "change",\
"z": "311c8b43.5c0584",\
"name": "MidSensor Topic",\
"rules": [\
\{\
"t": "change",\
"p": "topic",\
"pt": "msg",\
"from": "topic",\
"fromt": "msg",\
"to": "MidSensor",\
"tot": "str"\
\}\
],\
"action": "",\
"property": "",\
"from": "",\
"to": "",\
"reg": false,\
"x": 218,\
"y": 192,\
"wires": [\
[\
"d9f6faf9.084cb8"\
]\
]\
\},\
\{\
"id": "986361cc.4391b",\
"type": "change",\
"z": "311c8b43.5c0584",\
"name": "RightSensor Topic",\
"rules": [\
\{\
"t": "change",\
"p": "topic",\
"pt": "msg",\
"from": "topic",\
"fromt": "msg",\
"to": "RightSensor",\
"tot": "str"\
\}\
],\
"action": "",\
"property": "",\
"from": "",\
"to": "",\
"reg": false,\
"x": 217,\
"y": 272,\
"wires": [\
[\
"39032a55.255716",\
"7a4fc5ec.fc77ec"\
]\
]\
\},\
\{\
"id": "bc6dacb9.9dd52",\
"type": "PCA9685 out",\
"z": "311c8b43.5c0584",\
"name": "Audio Power",\
"pca9685": "84df5fdf.7962",\
"channel": "4",\
"payload": "",\
"unit": "percent",\
"onStep": "0",\
"x": 869,\
"y": 190,\
"wires": []\
\},\
\{\
"id": "1fbe5438.7b7bec",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "Off",\
"topic": "",\
"payload": "0",\
"payloadType": "num",\
"repeat": "",\
"crontab": "",\
"once": false,\
"onceDelay": "",\
"x": 675,\
"y": 213,\
"wires": [\
[\
"bc6dacb9.9dd52"\
]\
]\
\},\
\{\
"id": "901c239a.bea5e",\
"type": "inject",\
"z": "311c8b43.5c0584",\
"name": "100%",\
"topic": "",\
"payload": "100",\
"payloadType": "num",\
"repeat": "",\
"crontab": "",\
"once": true,\
"onceDelay": "",\
"x": 676,\
"y": 173,\
"wires": [\
[\
"bc6dacb9.9dd52"\
]\
]\
\},\
\{\
"id": "ebc381e2.2e3eb",\
"type": "speakerpi-output",\
"z": "311c8b43.5c0584",\
"choose": "givenfile",\
"filename": "/home/pi/Music/R2D2.wav",\
"channels": "1",\
"bitdepth": "8",\
"samplerate": "11025",\
"name": "R2D2",\
"x": 501,\
"y": 1145,\
"wires": []\
\},\
\{\
"id": "bf85e95d.22d5b8",\
"type": "ui_button",\
"z": "311c8b43.5c0584",\
"name": "",\
"group": "4f5830f7.70499",\
"order": 2,\
"width": 0,\
"height": 0,\
"passthru": false,\
"label": "Play R2D2",\
"color": "",\
"bgcolor": "",\
"icon": "",\
"payload": "true",\
"payloadType": "bool",\
"topic": "",\
"x": 240,\
"y": 1144,\
"wires": [\
[\
"ebc381e2.2e3eb"\
]\
]\
\},\
\{\
"id": "c542a2ef.954a8",\
"type": "speakerpi-output",\
"z": "311c8b43.5c0584",\
"choose": "givenfile",\
"filename": "/home/pi/Music/LAZER.WAV",\
"channels": "1",\
"bitdepth": "8",\
"samplerate": "11025",\
"name": "Lazer",\
"x": 501,\
"y": 1198,\
"wires": []\
\},\
\{\
"id": "4069947d.8363ec",\
"type": "ui_button",\
"z": "311c8b43.5c0584",\
"name": "",\
"group": "4f5830f7.70499",\
"order": 3,\
"width": 0,\
"height": 0,\
"passthru": false,\
"label": "Play Lazer",\
"color": "",\
"bgcolor": "",\
"icon": "",\
"payload": "true",\
"payloadType": "bool",\
"topic": "",\
"x": 240,\
"y": 1197,\
"wires": [\
[\
"c542a2ef.954a8"\
]\
]\
\},\
\{\
"id": "cc258492.685978",\
"type": "speakerpi-output",\
"z": "311c8b43.5c0584",\
"choose": "givenfile",\
"filename": "/home/pi/Music/starwars.wav",\
"channels": "1",\
"bitdepth": "8",\
"samplerate": "11025",\
"name": "StartWars",\
"x": 499,\
"y": 1419,\
"wires": []\
\},\
\{\
"id": "5e6199ed.a922f8",\
"type": "ui_button",\
"z": "311c8b43.5c0584",\
"name": "",\
"group": "4f5830f7.70499",\
"order": 7,\
"width": 0,\
"height": 0,\
"passthru": false,\
"label": "Play Theme",\
"color": "",\
"bgcolor": "",\
"icon": "",\
"payload": "true",\
"payloadType": "bool",\
"topic": "",\
"x": 228,\
"y": 1418,\
"wires": [\
[\
"cc258492.685978"\
]\
]\
\},\
\{\
"id": "656ae780.cd2dc8",\
"type": "ui_slider",\
"z": "311c8b43.5c0584",\
"name": "",\
"label": "Volume",\
"group": "4f5830f7.70499",\
"order": 9,\
"width": 0,\
"height": 0,\
"passthru": true,\
"topic": "",\
"min": 0,\
"max": "100",\
"step": 1,\
"x": 194,\
"y": 1525,\
"wires": [\
[\
"76d238dc.143448"\
]\
]\
\},\
\{\
"id": "c5be7a03.b9b148",\
"type": "exec",\
"z": "311c8b43.5c0584",\
"command": "amixer cset numid=1 -- ",\
"addpay": true,\
"append": "",\
"useSpawn": "false",\
"timer": "",\
"oldrc": false,\
"name": "Volume Ctrl",\
"x": 539.5,\
"y": 1526.5,\
"wires": [\
[],\
[],\
[]\
]\
\},\
\{\
"id": "76d238dc.143448",\
"type": "function",\
"z": "311c8b43.5c0584",\
"name": "Volume",\
"func": "msg.payload/=3;\\nif (msg.payload>0) msg.payload+=66;\\nmsg.payload+=\\"%\\";\\nreturn msg;",\
"outputs": 1,\
"noerr": 0,\
"x": 363,\
"y": 1526,\
"wires": [\
[\
"c5be7a03.b9b148"\
]\
]\
\},\
\{\
"id": "bdc88586.7737a8",\
"type": "speakerpi-output",\
"z": "311c8b43.5c0584",\
"choose": "givenfile",\
"filename": "/home/pi/Music/imperial.wav",\
"channels": "1",\
"bitdepth": "8",\
"samplerate": "11025",\
"name": "StartWars",\
"x": 498,\
"y": 1470,\
"wires": []\
\},\
\{\
"id": "7aaa86ca.62b248",\
"type": "ui_button",\
"z": "311c8b43.5c0584",\
"name": "",\
"group": "4f5830f7.70499",\
"order": 8,\
"width": 0,\
"height": 0,\
"passthru": false,\
"label": "Play Imperial",\
"color": "",\
"bgcolor": "",\
"icon": "",\
"payload": "true",\
"payloadType": "bool",\
"topic": "",\
"x": 227,\
"y": 1469,\
"wires": [\
[\
"bdc88586.7737a8"\
]\
]\
\},\
\{\
"id": "ccfd3eb.d4353c",\
"type": "speakerpi-output",\
"z": "311c8b43.5c0584",\
"choose": "givenfile",\
"filename": "/home/pi/Music/FATHER.WAV",\
"channels": "1",\
"bitdepth": "8",\
"samplerate": "11025",\
"name": "Father",\
"x": 499,\
"y": 1256,\
"wires": []\
\},\
...
This file has been truncated, please download it to see its full contents.
Comments