# Compare mcp Value with 100

**URL:** https://discourse.nodered.org/t/compare-mcp-value-with-100/85151
**Category:** General
**Created:** [2 February 2024 17:01 UTC](https://discourse.nodered.org/t/compare-mcp-value-with-100/85151 "2024-02-02T17:01:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Nobel](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nobel](https://discourse.nodered.org/u/Nobel)
#### Post date: [2 February 2024 17:01 UTC](https://discourse.nodered.org/t/compare-mcp-value-with-100/85151/1 "2024-02-02T17:01:43Z")

</div>

I am currently writing my thesis and I'm new to Node-RED. I have made a PCB, where I get a value from a mcp3008. Now I have a problem, I have build a flow, which works for now, but I have to implement something to compare the mcp3008 value with 100. If the mcp3008 value is over or 100 a "True" should be send. If the value is under 100 a "False" should be send. How can i implement the comparison of the values. Thank you in advance!

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [2 February 2024 17:14 UTC](https://discourse.nodered.org/t/compare-mcp-value-with-100/85151/2 "2024-02-02T17:14:58Z")

</div>

Hi, welcome to the forum. I dont mean to sound _urm_ mean 😉 when I say this but this is very basic level stuff. Coupled with the fact you are a student, I think a point in the right direction will help you far more than giving you a fully working answer - hope you dont mind.

First a clue to your requirement: -\> switch node -\> change node -\>

Now the real learning: I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

also, check out all the built in examples CTRL-I:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/4511ae88abe51bb8d9e4b5ca65017b01f98352fe.png)

---

<div class="post-metadata">

### Author: ![Nobel](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nobel](https://discourse.nodered.org/u/Nobel)
#### Post date: [2 February 2024 17:25 UTC](https://discourse.nodered.org/t/compare-mcp-value-with-100/85151/3 "2024-02-02T17:25:14Z")

</div>

Thank you for the fast response and the links 😁

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [2 February 2024 17:30 UTC](https://discourse.nodered.org/t/compare-mcp-value-with-100/85151/4 "2024-02-02T17:30:59Z")

</div>

Probably every programming language has an IF statement.

If something, do something

Node-red's IF statement is supplied by the switch node:  
If something, send a message down a particular "wire".

Like other languages you can build up more complex IFs

If something or something else send a message down these wires, and if something else send a message down this wire, else down that wire.

The "do something" bit is handled by whatever nodes your switch is wired to.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [2 May 2024 17:31 UTC](https://discourse.nodered.org/t/compare-mcp-value-with-100/85151/5 "2024-05-02T17:31:05Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
