Differences

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

Link to this comparison view

iot:res:streams [2015/07/21 15:25]
madalina.tanea [Print]
iot:res:streams [2015/07/30 16:21] (current)
madalina.tanea [Social: Send and receive]
Line 30: Line 30:
 By convention it will have a msg.payload property containing the body of the message. By convention it will have a msg.payload property containing the body of the message.
 If you double click on it, you will find the name field, the second field, where you write the code and the last one, where you specify how many outputs the node has.  If you double click on it, you will find the name field, the second field, where you write the code and the last one, where you specify how many outputs the node has. 
 +{{ :​iot:​labs:​functions.png?​300 |}}
  For this node you can find an usage example in // Course 3: Software for the Internet of Things //.  For this node you can find an usage example in // Course 3: Software for the Internet of Things //.
 ==== Visual ==== ==== Visual ====
 This node is similar to the function block, only that the second field will consist of visual blocks. This node is similar to the function block, only that the second field will consist of visual blocks.
-{{ :​iot:​labs:​functions.png?​300 |}}+
  
 Look up an example in // Lab. 03 - Blink an LED //. Look up an example in // Lab. 03 - Blink an LED //.
Line 52: Line 53:
 {{ :​iot:​labs:​messages.png?​200 |}} {{ :​iot:​labs:​messages.png?​200 |}}
 The third field asks for the board ID. In //send// you need the receiver board ID. To obtain it, go to the main page, find your board and, in its options, choose // Board ID// The third field asks for the board ID. In //send// you need the receiver board ID. To obtain it, go to the main page, find your board and, in its options, choose // Board ID//
-{{ :​iot:​labs:​boardid.png?​200 |}}+{{ :​iot:​labs:​boardid.png?​300 |}}
  
 Here's a simple and short example on a situation where you might need this very nodes. ​ Here's a simple and short example on a situation where you might need this very nodes. ​
Line 59: Line 60:
  
 You, on the other hand, will have to put a //Receive message// node which, in this example, will print on your console the values respective to the temperature,​ in an analog range (0 - 1024) every time it gets a message from the first board. \\ You, on the other hand, will have to put a //Receive message// node which, in this example, will print on your console the values respective to the temperature,​ in an analog range (0 - 1024) every time it gets a message from the first board. \\
-{{:​iot:​res:​receivemsg.png?​300|}}{{ :​iot:​res:​sendmsg.png?​300|}}+{{:​iot:​res:​receivemsg.png?​300 |}} 
 +{{ :​iot:​res:​sendmsg.png?​300 |}}
 ===== Say ===== ===== Say =====
 You can make the board speak. Just insert this node and specify the message and the language. ​ It will be saved in the payload. ​ You can make the board speak. Just insert this node and specify the message and the language. ​ It will be saved in the payload. ​
 {{ :​iot:​labs:​say.png?​200 |}} {{ :​iot:​labs:​say.png?​200 |}}
 +
 +For instance, a possible application would implement this block and two other simple ones: the // run // node and a change node, where you write the message you expect from your project. ​
 +
 +{{ :​iot:​res:​sayexample.png?​400 |}}
 ===== I/O pins ===== ===== I/O pins =====
   *  digitalWrite - it will write 0 or 1 on a digital pin, the one that you choose in the settings.   *  digitalWrite - it will write 0 or 1 on a digital pin, the one that you choose in the settings.
Line 73: Line 79:
   * Shift in/ out- When it receives an input, shifts in/out a byte value from a pin using the clock pin as a clock. The value read/​written is in payload. If no data pin is specified, the pin number is the topic field of the message.   * Shift in/ out- When it receives an input, shifts in/out a byte value from a pin using the clock pin as a clock. The value read/​written is in payload. If no data pin is specified, the pin number is the topic field of the message.
 {{ :​iot:​labs:​shifts.png?​200 |}} {{ :​iot:​labs:​shifts.png?​200 |}}
-Here's an example on how to use the //shift out// node. You want to light up 3 LEDs one by one, without changing the state of the previous one. Picture this: you have the pins connected to 3 consecutive pins of a shift register so,  you want to have on them the values: 0, 0, 0 when they are all out; 0, 0, 1 when the last pin is high; 0, 1, 1 when the last two are turned on and for all the LEDs to be alight 1, 1, 1. The corresponding values would be 0, 1, 3 and 7 which in binary would look exactly like the values you expect. Make a function which will return ​these numbers and the //shift out // node will write on the shift register exactly what you need. Make sure the data and the clock pin correspond ​with the shift register'​s pins. +Here's an example on how to use the //shift out// node. You want to light up 3 LEDs one by one, without changing the state of the previous one. Picture this: you have the pins connected to 3 consecutive pins of a shift register so,  you want to have on them the values: 0, 0, 0 when they are all out; 0, 0, 1 when the last pin is high; 0, 1, 1 when the last two are turned on and for all the LEDs to be alight 1, 1, 1. The corresponding values would be 0, 1, 3 and 7 whichin binarywould look exactly like the values you expect. Make a function which returns ​these numbers and the //shift out // node will write on the shift register exactly what you need. Make sure the data and the clock pin correspond ​to the shift register'​s pins.  
-{{ :​iot:​res:​shiftoutt.png?​300 |}}+{{ :​iot:​res:​shiftoutt.png?​400 |}} 
 +The easiest way to do this is to select, in the // run // node, the // Times// option, instead of // timestamp//​. This will send in the payload a number, starting with 0, which is incresing by one each time a new message is sent out. The function should look like this.  
 +{{ :​iot:​res:​exfctshiftout.png?​350 |}} 
 ===== Signals ===== ===== Signals =====
   *  receiveSignal- puts in the payload the value received though the signal, from the dashboard. Write in the settings the name of the signal you expect, which should be identical with the one in the dashboard.   *  receiveSignal- puts in the payload the value received though the signal, from the dashboard. Write in the settings the name of the signal you expect, which should be identical with the one in the dashboard.
Line 82: Line 91:
  
 As for the // receive signal //node, you add a swith in the dashboard and name the signal it sends in a paticular way.  As for the // receive signal //node, you add a swith in the dashboard and name the signal it sends in a paticular way. 
-Afterwords, you come back to your main page and put a // receive signal // node. This one will start the project when it gets the message sent from the switch and puts in the payload the value 0 or 1, depending the switch'​s state. You can use this value to light up an LED, for example. ​+Afterwords, you come back to your main page and add a // receive signal // node. This one will start the project when it gets the message sent from the switchand will put in the payload the value 0 or 1, depending ​on the switch'​s state. You can use this value to light up an LED, for example. ​
 {{ :​iot:​res:​example2.png?​300 |}} {{ :​iot:​res:​example2.png?​300 |}}
 {{ :​iot:​res:​examplereceive.png?​300 |}} {{ :​iot:​res:​examplereceive.png?​300 |}}
Line 92: Line 101:
 {{ :​iot:​labs:​web.png?​200 |}} {{ :​iot:​labs:​web.png?​200 |}}
  
-All the additional ​iformation ​you need can be found  in // Course 09. Web servers // and examples in // Lab 08. Web services //.+All the additional ​information ​you need can be found  in // Course 09. Web servers // and examples in // Lab 08. Web services //.
iot/res/streams.1437481519.txt.gz · Last modified: 2015/07/21 15:25 by madalina.tanea
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0