Questions tagged [tinkercad]

33 questions
0
votes
1 answer

How to make a duty cycle using 2 LEDs using arduino?

I want to make a duty cycle of 2 LEDs using Arduino in tinkercad. I have 2 LEDs 1 is red and another is green. I want both the LEDs on at the same time but a glowing delay of red led is 1second and green led is 1.3second just like the graph below…
0
votes
0 answers

I need help figuring out why only one of my force sensors work (tinkercad, c++)

raw code: int buzzer = 11; int forcePin1 = A1; int forcePin2 = A2; int Forcevalue = 0; void setup() { pinMode(forcePin1, INPUT); pinMode(forcePin2, INPUT); pinMode(buzzer, OUTPUT); Serial.begin(9600); } void loop() { …
Jacob
  • 19
  • 6
0
votes
1 answer

How to create IO Bargraph in Arduino?

Hello this is my code in Tinkercad. I created schema for Bargraph with LED. Two LED (Yellow and Orange) not work correctly. My code is below: int sensorValue = 0; int outputValue = 0; void setup() { pinMode(A0, INPUT); pinMode(1,…
kaluaaa
  • 47
  • 5
0
votes
3 answers

Arduino String does not properly convert integer to string

I am using TinkerCad as Arduino UNO R3 simulator. My aim is to convert int to string but the following code prints 188 instead of 180. void setup() { Serial.begin(115200); } void loop() { Serial.println(String(180)); } Output is 188 as you…
The Exile
  • 644
  • 8
  • 14
0
votes
1 answer

Why does the green light light up when needed?

So here's what I am trying to achieve when the ultrasonic sensor detects a distance less than a certain amount then the light should turn green allowing the traffic to move Here's the code int pir = 2; int rojo = 12; int amarillo = 11; int verde =…
0
votes
1 answer

I got 14:29 when running this code. Trying to use Ardouino circuits

int switchmode=0; void setup() { pinMode(3, INPUT); pinMode(7, OUTPUT); pinMode(9, OUTPUT); } void loop() { switchmode = digitalRead(3; digitalWrite(7,switchmode); if(switchmode== HIGH){ …
Tote99
  • 167
  • 8
0
votes
0 answers

How to send and receive data through UART between two Arduino Unos

I have been working through this problem for quite some time now and have succeeded in getting a partial mark. I would like to know what is wrong with the code that I have, that is preventing me from succeeding under certain conditions I need one…
Steve
  • 33
  • 1
  • 4
-1
votes
1 answer

How can i use the analog pin to assign a variable a binary value?

I'm using an arduino uno and some 7 segment displays to count from 0000 to 9999, i'm using the decoder cd4511 to save some ports, but in order to have the thousands in my counter, i needed to use the analog pins just like this:the leftmost display…
-1
votes
1 answer

How do I check if a button was pressed in a time interval?

I'm doing a project on Arduino that involves traffic lights. If the crossing button is pressed within a 7 second interval, after waitng for 3 seconds(delay3000), I will call a function. If it's not pressed, the loop will resume as normal. I have…
-1
votes
1 answer

the loop can not depent on the if function

boolean test(void) { if (light==0) { return false; } ; if ( BIT_IS_SET(PINB, 2) ) { if ((colour==1 && light==4)||(colour==0 && light==5)) { mark=mark+100; light=0; return true; } else { …
-1
votes
2 answers

The "break statement" is just not working like it should

This is the code but for some reason, when (distancia<100) the ("ALTO") still appears, and the same with the other while loop while (distancia<200 && distancia>100) { lcd.print("ALTO"); delay(1000); lcd.clear(); delay(1000); …
-1
votes
2 answers

Any reason why my Tinkercad's arduino serial plotter is not updating?

The arduino should be reading different values as the signal is a sine wave. Tried using different signal frequency as well as different delay(), still shows a constant value. Any help is highly appreciated! Thanks!!
Nawaz
  • 21
  • 4
-1
votes
1 answer

How can i include iostream in tinkercad

When I write #include iostream in tinkercad, an error shows up saying "fatal error: iostream: No such file or directory" How can I fix this? full code
olavv
  • 3
  • 2
-2
votes
1 answer

How can I break my while loop using a Serial input?

I'm trying to break this while loop with the serial input of "Clear" but my serial monitor shuts down when the loop is going. This loop basically makes my siren and light blink until the serial input of "clear" is given but it's not executing. Any…
-2
votes
2 answers

How to Change LED with Button?

i wanted to change LEDs with only one button. First click on the Button - Red Led turns on, Second - Red turns off and green turns on, third - Green turns off and yellow turns on, fourth - starts again with Red... First i tried to turn on Red with…
K4M41D
  • 23
  • 1
  • 2