|
Parts Kit posted:It may just be me or the combo of stuff I was using on a past project but Adafruit's libraries seem really bloated. I recall watching the output of both on my oscilloscope, and the neopixel bits were just way longer. Long enough that it cut into the frame rate with big chains. The fast led output was basically as short as could be dumped out of arduino.
|
# ? Sep 9, 2017 22:29 |
|
|
# ? May 30, 2024 06:14 |
|
Fastled also has some very nice math functions which I often pull over for lighting projects, even if I'm not using pixels.
|
# ? Sep 10, 2017 03:59 |
|
I'm trying to output unmodulated IR codes when pressing a button, which works half the time. I suspect it's got something to do with the state of the counter when hitting the button but so far I haven't been able to fix this. This is what the output looks like: Here's my code, trimmed for readability. Pressing the button calls transmit() code:
|
# ? Sep 10, 2017 09:34 |
|
unpacked robinhood posted:... I know you can use a char as a loop counter in C, but you are assigning numeric values to it, and char(zero) is numeric value=48.... All the printing character values begin at ASCII value 32....
|
# ? Sep 11, 2017 06:02 |
|
Just ordered this kit https://www.amazon.co.uk/dp/B01D8KOZF4/ref=cm_sw_r_cp_api_IzRTzb68JGWRJ I will mostly be tinkering with sensors, leds and motors until I am up to speed. Then I am looking to make a reef fish tank controller. Oh and some basic home automation stuff. I really really want to ask alexa to make me a coffee in the morning!
|
# ? Sep 11, 2017 17:17 |
|
thegasman2000 posted:Just ordered this kit I ordered this kit a couple days ago and although I've only made it to like lesson 5 in the book, it's been great so far. I think the CD it comes with is blank, but I just downloaded everything off their website.
|
# ? Sep 11, 2017 18:52 |
|
SpartanIV posted:I ordered this kit a couple days ago and although I've only made it to like lesson 5 in the book, it's been great so far. I replaced my MacBook DVD drive with another hard drive. I have not missed it but thanks for the heads up! Really excited to get this up and running
|
# ? Sep 11, 2017 19:09 |
|
edmund745 posted:Why is your for-loop counter using a char variable as the counter? Is that supposed to be an int? I didn't wrote this part I think it was originally for some flavor of *uino. Isn't this a hack to have the compiler use 8 bits instead of whatever is an int on the platform ? I admit it doesn't really makes sense on an 8 bit platform anyway
|
# ? Sep 11, 2017 19:42 |
|
I want to clock out bits at a specific rate -- just OOK basically. My current solution is a timer interrupt that changes the pin state based on the data and a bits sent counter that's incremented. The timer stops firing when the last bit is clocked out. Is there a nicer way to do this? I'd like to set up some hardware that to be like: here's a pointer here's the length, bit time is x usec , clock em out and interrupt when you're done
|
# ? Sep 11, 2017 20:09 |
|
edmund745 posted:Why is your for-loop counter using a char variable as the counter? Is that supposed to be an int? unpacked robinhood posted:I didn't wrote this part I think it was originally for some flavor of *uino. Isn't this a hack to have the compiler use 8 bits instead of whatever is an int on the platform ? I admit it doesn't really makes sense on an 8 bit platform anyway char / unsigned char will define an 8-bit integer variable. In C, there is nothing that makes a char special and only used for text characters, it is just an unfortunate name that implies it is special. Assigning 0 to a char is the same as assigning 0 to an int, you can do math in the normal way, etc. If you want to assign the ASCII character '0', you can do that with single quotes. Using a char instead of int is a common way to save a byte in an embedded context if you, like in this case, know the variable will not ever be large enough to overflow. I wouldn't bother worrying about it until you are optimizing, you might as well use int everywhere. Anyway, I would expect a modern compiler to use 1 byte for an int in a situation like this (very clear the variable will not overflow a byte), if you are compiling for an 8-bit target. code:
|
# ? Sep 11, 2017 20:29 |
|
unpacked robinhood posted:I didn't wrote this part I think it was originally for some flavor of *uino. Isn't this a hack to have the compiler use 8 bits instead of whatever is an int on the platform ? I admit it doesn't really makes sense on an 8 bit platform anyway Recent versions of the C++ spec (which Arduino uses) allows you to explicitly define integer widths as follows: code:
|
# ? Sep 11, 2017 21:43 |
|
thegasman2000 posted:Just ordered this kit I got it cheaper from Wish.com http://www.wish.com/c/593e086ee389ac6e350a4037 I also got loads of stuff from there real cheap http://www.wish.com/c/5821b1c69138567e1723fbcb and https://www.wish.com/c/576219ab82340962480489ce They offer full refund if they do not work (and you get to keep them)
|
# ? Sep 12, 2017 08:05 |
|
taqueso posted:char / unsigned char will define an 8-bit integer variable. In C, there is nothing that makes a char special and only used for text characters, it is just an unfortunate name that implies it is special. ... TheresaJayne posted:I got it cheaper from Wish.com ... But I mainly use China clone Arduino boards and so far all of them worked 100%. The only parts I've had that were bad were some Arduino prototyping shields that had some sloppy solder that shorted the 5v pin to a ground pin. The Arduino boards (like the Unos, Nanos and Megas) get loaded with a blink sketch and tested, to confirm that they work. The prototype shields have a couple buttons and LEDs on them, but they probably don't get tested at all. So you reeealllyy want to check the solder and traces on them before sticking them on a board and powering it up... (pop! goes the voltage regulator) Where is cheapest to buy depends a lot on where you are. In the US you can order stuff dirt cheap from China, because China has US most-favored-nation trading status, and so it gets a special extra-low mailing rate to send small packages to the US. The small-package rate from China is cheaper than the small-package rate inside the USA. US sellers selling the same items (even at the same price) can get it to you faster (and sometimes I will pay more to buy something from a US-based seller for that reason) but they can't compete on price, just on shipping costs alone. US mail-order companies universally hate the ePacket program. To add insult to injury, the USPS won't even publish the actual list of China-to-US rates: http://www.ecommercebytes.com/C/blog/blog.pl?/pl/2016/1/1453344622.html I don't think ePacket will live forever, but I'm using it while it's here. Probably all of the China-direct sites have a "keep it for free if not satisfied" because it can't be mail it back as cheap as it can get mailed to the US. The return postage cost makes it not worth doing. (For US people) I tend to stick to Aliexpress, but there's banggood, dx and others.
|
# ? Sep 12, 2017 14:26 |
|
Yeah the kit was on Amazon prime deals for £20 so a decent enough price and peace of mind if anything is wrong. For cheap poo poo I use Joom, gearbest and AliExpress to the uk but expect at least a 4 week lead time. I avoid eBay because it's a poo poo show if anything isn't working etc.
|
# ? Sep 12, 2017 15:20 |
|
edmund745 posted:I've seen where people used a char as a counter, but it was usually because they wanted to "print" the char at some point. The posted code was char[0] to char[2], which is non-printing characters. Yeah epacket is effectively dumping But cheap as hell electronics? Who cares??
|
# ? Sep 12, 2017 20:49 |
So I've been thinking a fun end-of-summer project would be to clone my garage door opener, which seems like it should just require a RF transmitter/receiver pair and a cheap microcontroller. Any recommendations for a low-cost microcontroller for this sort of thing? I don't have a ton of experience with embedded stuff (although I do have a lot of experience with C), so something beginner-friendly would be nice.
|
|
# ? Sep 12, 2017 21:04 |
|
To clone a garage door opener you can use any pair of little Arduino modules (Nano is small but also easy to work with) and the cheapo 433MHz/315MHz radio modules that are 10 for 10 dollars from eBay. No security other than obscurity, limited range, but it's easy.
|
# ? Sep 12, 2017 21:25 |
|
unpacked robinhood posted:I'm trying to output unmodulated IR codes when pressing a button, which works half the time. Here's my take on your code. I unwrapped the loop for clarity. I also like the "for(;test;);" construction instead of do;while(test); C code:
|
# ? Sep 13, 2017 02:32 |
|
Sagebrush posted:To clone a garage door opener you can use any pair of little Arduino modules (Nano is small but also easy to work with) and the cheapo 433MHz/315MHz radio modules that are 10 for 10 dollars from eBay. No security other than obscurity, limited range, but it's easy. Most garage door openers made in the last 15-20 years use some kind of rolling code or encryption. edit: Honestly not sure about the encryption part. Genie says they use encryption and then immediately say rolling code in the same sentence. Lowen SoDium fucked around with this message at 13:29 on Sep 13, 2017 |
# ? Sep 13, 2017 13:25 |
|
That's the same thing, rite? LOL at garage door company's security. The remotes are semi secure rolling code, but I'll bet their internet based stuff is a joke.
|
# ? Sep 13, 2017 13:39 |
It's kind of irrelevant in my case because I'm pretty sure the opener I'm cloning is from the 80s.
|
|
# ? Sep 13, 2017 18:51 |
|
babyeatingpsychopath posted:Here's my take on your code. I unwrapped the loop for clarity. I also like the "for(;test;);" construction instead of do;while(test); Thanks, I'll try running it after the weekend when I'm home. I'm still wondering whether the OCR0A register should be updated outside of the appropriate interrupt routine.
|
# ? Sep 14, 2017 21:04 |
|
So I have been fiddling with my starter kit and also bought a nodeMCA ESP8266 to try a few IOT things. Now the issue is with the programming side of things as I dont understand what I need to do to turn on a relay with it. Its for connecting to my amazon alexa. I have a demo sketch with also included some NeoPixel code, which I have tried to erase to make life easier. here is what i have so far..code:
After connection, ask Alexa/Echo to 'turn pixels on' or 'off' or 'turn relay on' or 'off' [WIFI] Connecting to PrettyFlyForAWifi ......... [WIFI] STATION Mode, SSID: PrettyFlyForAWifi, IP address: 192.168.1.232 [MAIN] relay state: OFF [MAIN] relay state: ON Which seems to suggest I have the thing working but my relay, plugged into GPIO 13, just stays "ON" all the time. thegasman2000 fucked around with this message at 14:35 on Sep 25, 2017 |
# ? Sep 24, 2017 22:07 |
|
code:
|
# ? Sep 24, 2017 23:04 |
|
Also edit out your Wi-Fi password
|
# ? Sep 25, 2017 08:31 |
|
Splode posted:Also edit out your Wi-Fi password
|
# ? Sep 25, 2017 14:13 |
|
Yeah I really am not worried about my Wifi password being on their as my router makes 2 ssid and this one is for testing alone, but thanks! So got it working. If anyone is in the least bit interested... Its a cheap NodeMCU running an 8 channel relay board making a smart power strip of sorts. This is then all controlled using my amazon echo. I plan on using it for a marine fish tank to allow hands free control while cleaning and pottering about along with some monitoring etc later such as temp sensing and low water levels turning on a top up pump. code:
|
# ? Sep 25, 2017 14:35 |
|
Post pictures of the physical set up! You've made me want to try using IFTTT with an esp8266 now
|
# ? Sep 25, 2017 22:06 |
|
I started to solder it up, realised my soldering is not uk to scratch and ordered some female to female leads My 8 channel relay board has some tiny surface mount leds to tell when the relay is switched off. I want to extend these so I can have a visual check on what's on and off at a glance. Should I extend these? Or add an led inline to the relay switch from the gpio? Also the next phase is to integrate some web stuff so I can log in and see what's on and off. Potentially see how long etc. Any pointers on what to google? I have an rpi sat doing f all so might be easiest. thegasman2000 fucked around with this message at 20:40 on Sep 27, 2017 |
# ? Sep 25, 2017 22:48 |
|
Sorry for the double post... So I also need to apologise for what i suspect is really, really ugly code! I bastardised some tutorial code to make a webserver which gives the state of one relay. code:
Connecting to meh .. WiFi connected IP address: 192.168.1.232 Relay 1 HTTP server started! Waiting for clients! however when I got to 192.168.1.232/server I get nothing. The tutorial code worked fine so its not a network issue at all.
|
# ? Sep 28, 2017 10:40 |
|
My attiny thing is starting to work but there's still something weird. I'm putting two eight bit values together and build a 16 bit pulse train with the following pattern: preamble - 16 bit pulse sequence - stop pulse. However I had to use weird values for the loop index to get it to work, sendCode() is the function I'm having trouble with: code:
However if I edit the loop inside sendCode() to code:
unpacked robinhood fucked around with this message at 23:03 on Oct 2, 2017 |
# ? Oct 2, 2017 22:58 |
|
unpacked robinhood posted:
try code:
|
# ? Oct 3, 2017 12:16 |
|
babyeatingpsychopath posted:try I edited in your loop declaration and changed the condition right after. It's more elegant but it still either loses 1 or 2 pulses at the beginning, or introduces one short extra glitchy pulse at the end. code:
unpacked robinhood fucked around with this message at 14:48 on Oct 3, 2017 |
# ? Oct 3, 2017 14:44 |
|
unpacked robinhood posted:I edited in your loop declaration and changed the condition right after. That just means it's not the for loop initializing that's causing your bit problems. Your program is just not sending one or two bits to begin with. Starting upshifted 17 just means you don't send the bits you're missing, so you always start correctly. Look elsewhere for this problem.
|
# ? Oct 3, 2017 22:27 |
|
So my 2 year old tried to burn my house down and its given me the inspiration to make something actually useful. Here in the UK we wire our electric cookers into a box with a simple throw switch built in. It looks like this https://imgur.com/a/yFxuE My darling child turned on one of the heating elements (hobs) while a nicely oiled wooden chopping block was sat on top. Lots of smoke and a torched chopping board later and we are lucky my smoke alarm works. So the problem is to make the setup safer. Now we normally turn the cooker off at the wall, most people with no small kids leave it on all the time but safety first and all that, but forgot to after cooking dinner. The solution. Well I think a simple solution of a large relay, 50A 240AC such as http://www.ebay.co.uk/itm/Solid-Sta...vkAAOSwbYZXex8v should surfice. I then think adding a small display such as http://www.ebay.co.uk/itm/I2C-OLED-...H7BzbjR65ULo-Bw and a decent button. When you press the button it adds 15 minutes to a timer, when the timer runs out it turns the cooker off. So you want to cook something for an hour? Press the button 5 times, the timer reads 1.15 and the oven turns on. Does this seem a reasonable solution to the problem? I would need to embed a small arduino board and a power supply for said board all into a standard electrical box and mount the whole thing to a blank front.
|
# ? Oct 5, 2017 10:34 |
|
You're describing an outlet auto-off timer, which you can buy off the shelf in any appliance store. You might have to shop around a bit (or talk to an electrician) to find one that can handle the draw of a cooktop though.. Something like this, assuming your cooktop draws less than 10A: https://www.amazon.co.uk/gp/product/B005C9S0I8/ e: vv What evil_bunnY said. Don't mix DIY and things that can burn your house down. Talk to an electrician. Collateral Damage fucked around with this message at 12:30 on Oct 5, 2017 |
# ? Oct 5, 2017 11:56 |
|
thegasman2000 posted:So my 2 year old tried to burn my house down
|
# ? Oct 5, 2017 12:20 |
|
I have never seen one of these things! Much easier and safer thanks!
|
# ? Oct 5, 2017 15:58 |
|
A very long time ago I was in a closing Radioshack and purchased a cheap Arduino Uno R3 and promptly forgot about it until I moved. I found it and a dictation machine pedal controller and thought that it would be fun to turn it into a USB keyboard controller for use in games because why not open my inventory in PUBG with my toe which is otherwise doing nothing. Turns out the Uno R3 doesn't support working as an HID keyboard. Technically it can- I ran through a bunch of posts and wikis filled with dead links, and reflashed the USB controller to make it unto a USB keyboard and back again... problem is it doesn't actually support the Arduino Keyboard library and there's no complete documentation on how to get around THAT. So gently caress it. What's the cheapest small Arduino or similar thing I can get that can take 3 push buttons and turn them into keyboard strokes on a PC that won't require me to do anything other than call a keyboard library? Alternatively, has anyone turned an Uno R3 into a functioning keyboard device and actually have documentation that isn't lost to the sands of time?
|
# ? Oct 5, 2017 18:54 |
|
|
# ? May 30, 2024 06:14 |
|
Any Arduino-compatible board with an ATMega32U4 will be able to do keyboard emulation with the native library. The Leonardo is the official Arduino board that can do it, while the Sparkfun Pro Micro is the same thing in a board the size of a stick of gum. You can get knockoff versions of both from eBay, Amazon, AliExpress, etc for cheap. Knockoff Pro Micros are like 4 dollars with free shipping if you're okay with it taking the slow boat.
|
# ? Oct 5, 2017 19:05 |