Hello, I am making a simple project with my Arduino and wanted a software to test it virtually. I have been using Tinkercad but there is some bug in that so I am not able to use it so I tried Wokwi, a free Arduino simulator. This was my second day trying to figure out the solution of my problem. Basically
when a person/object is in a 100cm range with the HC-SR04 the LED turns on else it stays off. So to control the distance of the sensor, I right-click it, an error shows up saying "No Controls Defined".
What should I do to fix it?
Thanks:)
Probably add a link to your Wokwi project ?
The Wokwi model appears to be broken, but you can still change the distance by editing its JSON definition. For instance
"attrs": { "distance": "180" }
You can do this while the simulation is running
Hello I tried your solution now but it breaks the whole thing; Literally the wokwi screen became black.
Here is the link:
And another question I had, I want to kinda prototype with the Arduino UNO and make the the final product a bit miniaturized so if I do the necessary connections of this to a Attiny85 and use the same code will it work?
{
"version": 1,
"author": "Anonymous maker",
"editor": "wokwi",
"parts": [
{ "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} },
{
"type": "wokwi-led",
"id": "led1",
"top": -72.92,
"left": 262.98,
"attrs": { "color": "red" }
},
{
"type": "wokwi-hc-sr04",
"id": "ultrasonic1",
"top": -128.73,
"left": 46,
"attrs": { "distance": "180" }
}
],
"connections": [
[ "ultrasonic1:VCC", "uno:5V", "red", [ "v21.56", "h-140.78", "v222.67", "h184" ] ],
[
"ultrasonic1:GND",
"uno:GND.2",
"black",
[ "v8.9", "h99.62", "v-117.38", "h-279.83", "v359.15", "h207.12" ]
],
[ "ultrasonic1:ECHO", "uno:0", "green", [ "v20.78", "h125.13" ] ],
[ "ultrasonic1:TRIG", "uno:1", "green", [ "v29.6", "h121.27" ] ],
[ "led1:A", "uno:2", "green", [ "v25.55", "h-48.85" ] ],
[
"led1:C",
"uno:GND.3",
"green",
[ "v2.78", "h-29.83", "v-130.73", "h-312.88", "v379.72", "h248.25" ]
]
]
}
The wokwi simulation linked in #5 seems to work fine here.
Is it supposed to be broken? If so, try a different web browser and see if things work differently.
a7
It works for me too now but I can confirm that earlier today the "No Controls Defined" message did pop up when right clicking on the sensor so something has changed
You mean like when Mercury went void of course earlier this day?
a7
I mean before I wrote post #3
Hello, Yes it is supposed to be broken. Its not working on my side. Ok i'l try to use another browser and then check
Wait... Now its working for me
I also tried with a Attiny85
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.