probably i should ask first but i have to do a house with lights with both arduino and app inventor but i don´t really know how to do the arduino code and i´m just kind of copying examples of others codes so can someone explain me? sorry if i didn´t explain myself well
You really didn't explain anything.
what code would you like to write?
what should the Arduino do?
Hi @dudu17
indeed what you have explained so far is way too less to give constructive support.
The more details you are explaining the faster your project will be finished.
Some initial questions:
how many lights shall your project have?
post the number of lights
shall these lights be only switched fully on/ fully off
or
do they have to be dimmable = varyiing the brightness
what kind of lights will this be?
- simple single colored LEDs?
- RGB-LEDs?
-
- Neopixel LEDs / or other LEDs?
- real main AC-lamps?
Do you already have a MIT App-Inventor APP?
What way did you choose to send the commands from the App to the Arduino?
- bluetooth
- WiFi
-
- MQTT?
- TCP ?
- UDP?
- HTTP?
-
- HTTP-GET?
-
- HTTP-POST?
from all these detail questions you can see:
there is much much much more to it.
So it might be that
as a first project for learning programming is too ambitious
You should write about your programming-experience
Can you post a project-description?
Can you post the text of the assignment?
This will help a lot to understand what you really want to do
best regards Stefan
only one light
only switch on/off
is a high pressure sodium vapor lamp
i still don´t do that and i´m also only doing the code, a friend will do the app inventor thing t.t
i almost don´t know about that, started seeing this in august 2023 and started with simpler things like shock sensors and microphone
i don't have it in writing, my teacher asked for it during class but he didn't explain it well, he just said "i want a house with functional lights that uses arduino and app inventor"
my teacher only asked us to make "a house with functional lights that had use arduino and inventor app", he didn't really explain anything else to us
it must have a code for a microphone sensor and a bluetooth sensor, it shall turn on/off one light
Well this is a very demanding way of asking. "It must have code..."
Usually this forum works not this way:
asking vaguely for a code
delivering full functional code.
The normal way is:
posting a precise description of the wanted functionality
posting an own attempt with self-written code
and then asking specific questions by describing the code-behaviour that the code shows and a description of what the code should do instead.
Regarding the microphone-sensor:
You will have to specify this microphone-sensor is it a
simple LOW-HIGH-signal sensor ?
analog voltage-sensor?
I2S-microphone?
what exact type of microcontroller are you using?
does this microcontroller have onboard bluetooth?
if there is no onboard-bluetooth
what interface-type does the bluetooth-module have
serial interface?
SPI-interface?
I2C-interface?
All these questions can be answered by posting download-links to the datasheets of the used components.
best regards Stefan
For the light, start studying some IDE examples (e.g. basics → blink and digital → button); that will get you started how to control an output.
For the Bluetooth, you can for now simulate with Serial and Serial Monitor. You will need some form of protocol that you need to spec yourself; e.g. 1 for on and 0 for off. Use the 1 and 0 that you receive to control the output.
At a later stage you can use another serial port or SoftwareSerial.
Talk to your friend about the needed protocol or tell him/her that the characters 0 and 1 are what your Arduino code is expecting.
Unless it can be controlled with a 5V signal, you will need additional hardware. Get the specs of that lamp so the hardware gurus can properly advise.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.