Send data to a ws2801 LED strip with arduino [closed] - arduino

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
How do i send data manually (without any pre-made library) to a ws2801 led strip with a arduino?
I'm not asking for someone to write the code for me, just a push in the right direction.
i have a arduino leonardo

You use SPI, which is 3 data lines from the Arduino.
Check out this tutorial:
Tronix SPI tutorial
and then the Arduino library/tutorial:
Arduino SPI Tutorial/Library
Now check the datasheet and see what you can learn from it:
WS2801 datasheet
There are several video tutorials online about using the Arduino, check them out once you grok SPI it's really quite simple.:

The WS2801, does use a SPI type interface similar to a Shift register, you push 3 Bytes of data to populate the first chip, then keep pushing more Bytes for an overflow.
The Data Sheet shows two wire, Clock & Data; but you can also connect POL (Output polarity reversal) up to a PWM output for intensity, thus the 3-wire interface.
Look at Adafruit-WS2801-Library for additional guidance.

This is several years later, but I'd been looking into the same subject, and found some relevant information that could help the next reader.
This project by Josh Levine uses 7 WS2812B strips to display scrolling text. The strips are connected in parallel to a single Arduino board, and the code for it does not use any pre-built library.
Check out the code here. The main thing is that the timing for WS2812b is very specific, and the code uses ASM to get the timing right. More reading about the WS2812 timing here.
Additional reading: If you're interested in how the LED strips connected in parallel work, Josh has also written up an article explaining his bit-crunching technique for this, which you can read here.

Related

Read temperature with Arduino ATmega328P ADC with DTH11 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I have a little problem for school and I have to read the temperature with Arduino from a DTH11 sensor and print it in serial, only in C language.
Can someone help me with an example or something.
You can find the DHT11 data sheet on the Internet, for example
https://akizukidenshi.com/download/ds/aosong/DHT11.pdf
or
https://www.mouser.com/ds/2/758/DHT11-Technical-Data-Sheet-Translated-Version-1143054.pdf
there are sections which explain how the sensor module communicates via 1 wire with the MCU (Arduino).
Then, once you have an idea how the communication happens, you can read more articles like
https://howtomechatronics.com/tutorials/arduino/dht11-dht22-sensors-temperature-and-humidity-tutorial-using-arduino/
and there are many others, most use an already written library.
If your assignment won't let you use a library, you'll have to read for example the code at https://playground.arduino.cc/Main/DHTLib/ in files dht.h and dht.cpp and implement your own, maybe minimal version based on your understanding of the information provided on DHT's data sheet.
I would recommend to get things working by using a library first, then change it to work without.

First step Arduino Uno R3? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I won the arduino uno r3 in an event, but I have doubts about how to take the first steps to learn how to program it. I would like to understand which courses I am looking for that work for my arduino model (uno r3) and which programming languages and which IDEs I can use. So I can look for a course in Udemy or another platform that I can learn without having to buy an arduino of another brand
The only language you really need to know to code an Arduino is C++. Even with just the basics, you can do quite a lot. These are some things I think are a must to know:
Variables
If Statments
Loops
Importing Classes
Calling Functions
Next you can download the Arduino IDE, and start coding. Look up tutorials on YouTube to get a hand of the different commands you have at your finger tips and how to compile and upload your code to the board. You'll be using different functions such as digitalWrite() which can be used to turn an LED connected to a certain pin on or off, and many more.
In short, learn C++, and look up YouTube tutorials and you should be good.
Although you won't need to take classes for the programming side, you may need to take some when creating circuits with the Arduino. Electronics can be hard to learn, and some people may need some resource other than YouTube to learn that.

Obtaining encoder data [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Hello and in advance thank you for reading my post,
I am working on a project which is controlled by a stepper motor which also includes an encoder. I have made the motor running and now I want to proceed to the next step and include the functions of the encoder. I know that the encoder tells me the actual position travelled by the motor, however, as I am still quite a newbie, I have unfortunately no idea how to include the information of my encoder into my code (which library? which variables). Both motor and encoder are connected to my Arduino Uno and I have also attached a photo with the corresponding pins for the encoder.
Thank you for any much required help
Here's a huge list of resources and libraries, that should get you started: http://playground.arduino.cc/Main/RotaryEncoders
I'd recommend using this library as it automatically takes advantage of the interrupt capabilities, if you connect the encoder to the correct pins (2 & 3 on the Uno). You might need this in order to still get precise measurements even at high rpm.

Measuring current from a digital pin with analogRead [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I want to be able to check if some pieces of a puzzle is placed or not. To do this as easy as possible, I've set up 5 digital pins to output HIGH with digitalWrite(). The wires from the digital pins is connected to one analog pin each. Instead of a closed circuit, I have a gap for each piece of puzzle which is covered in aluminium foil.
The logic is that when the puzzle piece is placed, the circuit will be complete - and the Arduino will give some sort of output. Since I have a lot of pieces, I need some logic to test if each specific piece is placed or not.
I've tried to read the output from the digitalWrite() with analogRead() and map the values of 0-1023 on a 0-100 scale. This gives me a high variation in readings, and sometimes a reading of 100 (1023) even though the circuit is not closed by the puzzle piece.
Is it possible to get a more precise reading that doesn't vary so much? So far I haven't used any resistance between the different pins.
Why are you connecting to an analog pin?
Go digital all the way. Connect the digital pin to another digital pin, enable the pull-up resistors and then do a digitalRead on that pin.
You should get 1 if it's on and 0 if it's off.
Pretty simple, no?
I hope I helped.

How to write a program that controls a motor [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Connecting a motor to move a laser pointer up/down left/right to draw patterns.
Has anyone seen any examples to help the project? What programming language would be used for this? What computer ports would this use? Does a custom circuit have to be made or does a store exist for this?
There is a lot of different approaches you could go to this. Here is a few off the top of my head.
1. You could use a micro controller like an Arduino.
2. You could use a serial port and a socket. Here would be a good resource if you want to pursue this route. http://www.easysw.com/~mike/serial/serial.html
3. If you only need to control two motors you could use the headphone jack on your computer. You could hook a simple amplifier circuit up to each of the left and right speaker line. Then hook each of the amplifiers up to a separate motor. Then you could write a program that generates a separate sound for each channel, thus modifying the voltage given to each motor.
P.S if you use a servo, you can control the exact angle of the laser.

Resources