Home Discord Chat
Go Back   ChiefsPlanet > Nzoner's Game Room
Register FAQDonate Members List Calendar

Reply
 
Thread Tools Display Modes
Old 10-13-2021, 08:27 PM  
Monticore Monticore is offline
I love your mom
 
Join Date: Feb 2020
Location: Sturgeon Falls, Ontario
Casino cash: $2834957
Nerd homework

My son needs help with his homework and I know nothing about coding , he is trying to get a RGB strip to light up with increasing intensity as more pressure is applied to sensor while also randomizing a series of colors .(llike a light up shoe)

this is what he has which he knows is horribly wrong i am pretty sure this is C/C+, this is his hisrt ever coding class so his knowledge is fairly limited.
I also know it is in french but it might still make sense to some of you

int valeur1 = 0; //variable de type integer pour enregistrer analog A0
int valeur2 = 0; //variable de type integer pour enregistrer analog A0
int valeur3 = 0;
int valeur4 = 0;
int valeur5 = 0;

void setup() {

Serial.begin(9600); //commence le serial pour ecrire les données
pinMode(A0,INPUT_PULLUP); //prepare A0 pour le pressure sensor
pinMode(3,OUTPUT); //prepare pin 3 pour output de 5V
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
}

void loop() {

valeur1 = analogRead(A0);
delay(1000);
valeur2 = (200/valeur1);
valeur3 = (valeur2*valeur2);




valeur4 = random(255);
valeur5 = valeur4;

if (valeur4 > valeur5){
valeur5--;
analogWrite(3,valeur5);

}

if (valeur4 < valeur5){
valeur5++;
analogWrite(3,valeur5);

}

if (valeur4 == valeur5){

valeur5;
analogWrite(3,valeur5);

}







if (valeur4 > valeur5){
valeur5++;
analogWrite(5,valeur5);

}

if (valeur4 < valeur5){
valeur5--;
analogWrite(5,valeur5);

}

if (valeur4 == valeur5){

analogWrite(5,valeur5);

}








if (valeur4 > valeur1){
valeur5++;
analogWrite(6,valeur5);

}

if (valeur4 < valeur5){
valeur5--;
analogWrite(6,valeur5);

}

if (valeur4 == valeur5){

analogWrite(6,valeur5);

}

}

would appreciate any help or insults
Posts: 6,572
Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.
    Reply With Quote
Old 10-13-2021, 08:30 PM   #2
RollChiefsRoll RollChiefsRoll is offline
I don’t care for Auburn
 

Join Date: Aug 2014
Location: Sweet Home Alabama
Casino cash: $4860340
Posts: 6,678
RollChiefsRoll threw an interception on a screen pass.RollChiefsRoll threw an interception on a screen pass.RollChiefsRoll threw an interception on a screen pass.RollChiefsRoll threw an interception on a screen pass.RollChiefsRoll threw an interception on a screen pass.RollChiefsRoll threw an interception on a screen pass.RollChiefsRoll threw an interception on a screen pass.RollChiefsRoll threw an interception on a screen pass.RollChiefsRoll threw an interception on a screen pass.RollChiefsRoll threw an interception on a screen pass.RollChiefsRoll threw an interception on a screen pass.
    Reply With Quote
Old 10-13-2021, 08:32 PM   #3
digger digger is online now
Thread I will end you.......
 
digger's Avatar
 

Join Date: Apr 2007
Location: Kansas City, KS
Casino cash: $1912608
VARSITY
quick search, might help...




https://learn.sparkfun.com/tutorials...okup-guide/all


good luck, google/bing/duck duck go... ect are you friend went to comes to code, everything is online, (Mostly)...
__________________

Patrick Mahomes II MVP 2X
Super Bowl MVP 3x
Travis Kelce TE GOAT
Posts: 8,793
digger is obviously part of the inner Circle.digger is obviously part of the inner Circle.digger is obviously part of the inner Circle.digger is obviously part of the inner Circle.digger is obviously part of the inner Circle.digger is obviously part of the inner Circle.digger is obviously part of the inner Circle.digger is obviously part of the inner Circle.digger is obviously part of the inner Circle.digger is obviously part of the inner Circle.digger is obviously part of the inner Circle.
    Reply With Quote
Old 10-13-2021, 08:34 PM   #4
Bearcat Bearcat is offline
Would an idiot do that?
 
Bearcat's Avatar
 

Join Date: Nov 2000
Location: Arizona
Casino cash: $2904931
Quote:
Originally Posted by Monticore View Post
i am pretty sure this is C/C+
Seems generous.
Posts: 55,199
Bearcat is obviously part of the inner Circle.Bearcat is obviously part of the inner Circle.Bearcat is obviously part of the inner Circle.Bearcat is obviously part of the inner Circle.Bearcat is obviously part of the inner Circle.Bearcat is obviously part of the inner Circle.Bearcat is obviously part of the inner Circle.Bearcat is obviously part of the inner Circle.Bearcat is obviously part of the inner Circle.Bearcat is obviously part of the inner Circle.Bearcat is obviously part of the inner Circle.
Thumbs Up 3 Thumbs Down 0     Reply With Quote
Old 10-13-2021, 08:34 PM   #5
ClevelandBronco ClevelandBronco is offline
I'm with the banned.
 
ClevelandBronco's Avatar
 

Join Date: Sep 2006
Casino cash: $5658955
This looks racist. Is it racist?
__________________
"Faith and reason are like two wings on which the human spirit rises to the contemplation of truth ..."
– Pope Saint John Paul II
Posts: 28,113
ClevelandBronco is obviously part of the inner Circle.ClevelandBronco is obviously part of the inner Circle.ClevelandBronco is obviously part of the inner Circle.ClevelandBronco is obviously part of the inner Circle.ClevelandBronco is obviously part of the inner Circle.ClevelandBronco is obviously part of the inner Circle.ClevelandBronco is obviously part of the inner Circle.ClevelandBronco is obviously part of the inner Circle.ClevelandBronco is obviously part of the inner Circle.ClevelandBronco is obviously part of the inner Circle.ClevelandBronco is obviously part of the inner Circle.
Thumbs Up 3 Thumbs Down 0     Reply With Quote
Old 10-13-2021, 08:43 PM   #6
Monticore Monticore is offline
I love your mom
 

Join Date: Feb 2020
Location: Sturgeon Falls, Ontario
Casino cash: $2834957
Quote:
Originally Posted by Bearcat View Post
Seems generous.
I agree I just want his questions to stop .
Posts: 6,572
Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.
    Reply With Quote
Old 10-13-2021, 08:45 PM   #7
Monticore Monticore is offline
I love your mom
 

Join Date: Feb 2020
Location: Sturgeon Falls, Ontario
Casino cash: $2834957
Quote:
Originally Posted by digger View Post
quick search, might help...




https://learn.sparkfun.com/tutorials...okup-guide/all


good luck, google/bing/duck duck go... ect are you friend went to comes to code, everything is online, (Mostly)...
Thanks .
Posts: 6,572
Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.Monticore would the whole thing.
    Reply With Quote
Old 10-13-2021, 08:45 PM   #8
phisherman phisherman is offline
King Sandbagger
 

Join Date: Feb 2003
Location: The Summit, MO
Casino cash: $1705484
It would help to see the formal requirements of the assignment.
Posts: 3,806
phisherman wants to die in a aids tree fire.phisherman wants to die in a aids tree fire.phisherman wants to die in a aids tree fire.phisherman wants to die in a aids tree fire.phisherman wants to die in a aids tree fire.phisherman wants to die in a aids tree fire.phisherman wants to die in a aids tree fire.phisherman wants to die in a aids tree fire.phisherman wants to die in a aids tree fire.phisherman wants to die in a aids tree fire.phisherman wants to die in a aids tree fire.
    Reply With Quote
Old 10-13-2021, 08:47 PM   #9
Rain Man Rain Man is offline
NFL's #1 Ermines Fan
 
Rain Man's Avatar
 

Join Date: Jul 2001
Location: My house
Casino cash: $3408491
VARSITY
The kid needs to learn english. I can't understand a word he's saying.
__________________
I'm putting random letters here as a celebration of free speech: xigrakgrah misorojeq rkemeseit.
Posts: 141,204
Rain Man is obviously part of the inner Circle.Rain Man is obviously part of the inner Circle.Rain Man is obviously part of the inner Circle.Rain Man is obviously part of the inner Circle.Rain Man is obviously part of the inner Circle.Rain Man is obviously part of the inner Circle.Rain Man is obviously part of the inner Circle.Rain Man is obviously part of the inner Circle.Rain Man is obviously part of the inner Circle.Rain Man is obviously part of the inner Circle.Rain Man is obviously part of the inner Circle.
Thumbs Up 3 Thumbs Down 0     Reply With Quote
Old 10-13-2021, 08:48 PM   #10
backinblack backinblack is offline
go to work wasted
 
backinblack's Avatar
 

Join Date: Jan 2020
Location: Boise
Casino cash: $3270400
is it just me or is high school a lot more difficult these days?

have no idea what's happening in the OP
Posts: 2,702
backinblack 's adopt a chief was Sabby Piscitellibackinblack 's adopt a chief was Sabby Piscitellibackinblack 's adopt a chief was Sabby Piscitellibackinblack 's adopt a chief was Sabby Piscitellibackinblack 's adopt a chief was Sabby Piscitellibackinblack 's adopt a chief was Sabby Piscitellibackinblack 's adopt a chief was Sabby Piscitellibackinblack 's adopt a chief was Sabby Piscitellibackinblack 's adopt a chief was Sabby Piscitellibackinblack 's adopt a chief was Sabby Piscitellibackinblack 's adopt a chief was Sabby Piscitelli
    Reply With Quote
Old 10-13-2021, 08:51 PM   #11
EPodolak EPodolak is offline
Spooky Action
 
EPodolak's Avatar
 

Join Date: Dec 2003
Casino cash: $2732558
Canada must be stopped!
Posts: 6,331
EPodolak 's phone was tapped by Scott Pioli.EPodolak 's phone was tapped by Scott Pioli.EPodolak 's phone was tapped by Scott Pioli.EPodolak 's phone was tapped by Scott Pioli.EPodolak 's phone was tapped by Scott Pioli.EPodolak 's phone was tapped by Scott Pioli.EPodolak 's phone was tapped by Scott Pioli.EPodolak 's phone was tapped by Scott Pioli.EPodolak 's phone was tapped by Scott Pioli.EPodolak 's phone was tapped by Scott Pioli.EPodolak 's phone was tapped by Scott Pioli.
    Reply With Quote
Old 10-13-2021, 08:57 PM   #12
ptlyon ptlyon is offline
Bono & Grbac wasn't enough
 

Join Date: Oct 2000
Location: Sioux City, IA
Casino cash: $13173829
Clean up the God damn brackets. Jesus. Heathen.
__________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Advertise here: $19.99 a month
Posts: 33,468
ptlyon is obviously part of the inner Circle.ptlyon is obviously part of the inner Circle.ptlyon is obviously part of the inner Circle.ptlyon is obviously part of the inner Circle.ptlyon is obviously part of the inner Circle.ptlyon is obviously part of the inner Circle.ptlyon is obviously part of the inner Circle.ptlyon is obviously part of the inner Circle.ptlyon is obviously part of the inner Circle.ptlyon is obviously part of the inner Circle.ptlyon is obviously part of the inner Circle.
    Reply With Quote
Old 10-13-2021, 09:00 PM   #13
arrwheader arrwheader is offline
Veteran
 
arrwheader's Avatar
 

Join Date: Dec 2011
Casino cash: $3176613
don't speak French and don't code in c++ but So I can see him declaring Integer variables then passing them to a function then based on their return, passing that to another function which I assume returns the color.

Would help if I need what the functions do exactly but seems like he is on the right track at least with the flow.

I mostly code in c#.

Sent from my Pixel 3a using Tapatalk
Posts: 3,475
arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.
    Reply With Quote
Old 10-13-2021, 09:04 PM   #14
smithandrew051 smithandrew051 is offline
I Like The Kansas City Chiefs
 
smithandrew051's Avatar
 

Join Date: Nov 2017
Location: Shawnee, KS
Casino cash: $3324400
Be sure to drink your Ovaltine.
__________________
My 2023 Adopt a Chief: Keondre Coburn

Holy Hat!
Posts: 25,674
smithandrew051 is obviously part of the inner Circle.smithandrew051 is obviously part of the inner Circle.smithandrew051 is obviously part of the inner Circle.smithandrew051 is obviously part of the inner Circle.smithandrew051 is obviously part of the inner Circle.smithandrew051 is obviously part of the inner Circle.smithandrew051 is obviously part of the inner Circle.smithandrew051 is obviously part of the inner Circle.smithandrew051 is obviously part of the inner Circle.smithandrew051 is obviously part of the inner Circle.smithandrew051 is obviously part of the inner Circle.
Thumbs Up 2 Thumbs Down 0     Reply With Quote
Old 10-13-2021, 09:06 PM   #15
arrwheader arrwheader is offline
Veteran
 
arrwheader's Avatar
 

Join Date: Dec 2011
Casino cash: $3176613
Also the ifs in c# would look like

If (this)
{
Than that
}
Else if (this and this)
{
That and this
}
Else
{

}

Anyway that's how I'm used to seeing multi if statements in my world


Also he has val 5 equals val 4 and then is comparing them in the if statements? They are the same.


Sent from my Pixel 3a using Tapatalk
Posts: 3,475
arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.arrwheader is blessed with 50/50 Hindsight.
    Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump




All times are GMT -6. The time now is 03:25 PM.


This is a test for a client's site.
Fort Worth Texas Process Servers
Covering Arlington, Fort Worth, Grand Prairie and surrounding communities.
Tarrant County, Texas and Johnson County, Texas.
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.