rawtaztimemage: i've fallen for the grace of the teensy's size, especially compared to the mega (which i own as well) :)
rawtaztimemage: but i digress
timemagerawtaz, the mega i have is the adk version, which i got mostly because i wanted to do some usb host stuff with it. that said, i've barely used it for that purpose. it's nice to have one with an smps though.
BHXThis one for example seems pretty nice with it's extremely low on-resistance
BHXhttp://www.vishay.com/docs/72918/si4378dy.pdf
timemagerawtaz, i've never used anything approaching half of the pins of the mega2560 board.
rawtazstaying big i hear :D
timemagerawtaz, hmm?
rawtazi mean, the mega is big and has lots of ports. youre staying on that size of boards i take it
timemagerawtaz, not really. a nano close fitted with a pb is what i've been using the most recently.
timemagerawtaz, nano clone rather.
rawtazmhm
timemagerawtaz, i have a teensy 3.1, micro, and a nucleo board that is same rough form factor.
rawtazglad to hear it :)
timemagerawtaz, where i'm not putting the actual arduino into a project i don't usually care so much about the board size.
timemagerawtaz, mostly it depends on whether im prototyping on a breadboard or prototyping with a shield.
rawtazspeaking of boards - do you happen to know a good ethernet shield and perhaps also a good GSM shield (for sending SMS) for the teensy?
timemagerawtaz, for gsm not at all. for ethernet the only shield i have (but can't find) is a wiznet based thing. the older of the two common ones, 5100, i think.
rawtazaha. i think ive seen that at some point
timemagerawtaz, there are encj-whatever ones still floating around i think. don't really recommend it. praticularly if you're using an avr. to the extent that using an 8bit micro with ethernet is a something that should be done, it's better to offload a bunch of the network stack from it. the wiznet chips to do that. the encj based ones basically give you access to an ethernet frame buffer.
rawtazhmm ok
rawtazfeels like the adafruit stuff is what to use for ethernet and cellular
rawtazyou can connect the ethernet to a teensy using their feather adapter, so that part is fine. they dont however have a cellular "shield" so you cant get cellular with their stuff and the teensy. instead have to use a FONA
timemagerawtaz, cdma network here. and i don't have money to throw at data contracts for something i'd hook to an arduino. so, i pretty much ignore cellular related stuff.
rawtazhmm dont you have the type of sim cards where you just throw in (refill) a bunch of money whenever you want and can then use it as slow as you want?
rawtaztype of sim cards -> type of plans
timemagerawtaz, sim cards are generally a GSM thing. i don't fully understand their use it lte networks in cdma areas, so many there's away to use them there. but my impression is no. basically all of the sim### and shields are essentially useless unless your near a "city".
rawtazhm ok
timemagerawtaz, there was something like cdma counterpart to the sim card in cdma technology prior to lte use. RUIM. so far as i can tell, no carrier in the u.s. adopted it.
rawtazthat sucks. being able to send an SMS is awesome :)
timemagerawtaz, u.s. carriers are not awesome, less so if they're cdma ones.
sibiriatimemage: the SIM card is just one of several ways to hold the IMSI
rawtaztimemage: so, CDMA, does that mean you dont have a SIM-like card at all in your phone?
rawtazis the phone number you have linked to the device or something like that?
timemagerawtaz, my last check into putting devices on a verizon network involved having to go though their business unit. they have machine-to-machine plans. you must be a business to do it. must have an EIN actually, so an lcorp or something of that sort. you must have at least 5 devices. and you pay a lot of data. way more than you'd guess. it's useful if you have remote telemetry that is making you money. otherwise it's an expensive pain in
timemagethe ass that's inaccessible to ordinary users.
sibiriawith CDMA you usually have the IMSI in the phone itself
timemagerawtaz, unless it's an LTE device, no, no card.
rawtazwow
rawtazto me this sounds crazy. for comparison, here in sweden you can go to any supermarket, candy store or betting place or whatever, and get a sim card, a plan, or anything related to that type of telephony thing. then you just pop it into any phone you want and you have tele, mobile data, etc. and you pay as you go or by a plan, your choice. you pay e.g. per minute of calling or per sms.
rawtazweird that the big america hasnt gotten further than CDMA (unless theres some extremely good benefit to it that i dont know about :)
timemagerawtaz, yeah, the 'any phone you want' thing is not much of a reality here. typically even if you are on a GSM network your phone is locked to the account, at least until your contract is up. at which time you can ask them to unlock it.
timemagerawtaz, things are very different here.
sibiriaCDMA can use ruim-cards but i don't think that's used at all in the americas
sibiriaat least not in the USA
timemagesibiria, i mentioned that above.
sibiria'coz that would involve giving some sort of control to customer
sibiriaand that's baa-a-a-a-d
timemageyup
rawtazso you guys on CDMA cant take your phone and use it here in sweden i suppose, or do you think there's CDMA around here as well?
timemagerawtaz, anyway, know you know why i'm less than enthusiastic about arduino cellular stuff. more so about sim800/sim900 questions here, because questions regularly come up no one ever seems to get a satisfactory answer. if anyone does they don't seem to stick around to help anyone else with it.
tgunrI just notied something, the docs talk about slave select, i presume that would be the RESET ping in the iCSP?
rawtaztimemage: yeah, very understandable
timemagerawtaz, nope, can't. actually you can't with some gsm phones either. they have to support your frequency band. although those /are/ available. and people that travel a lot do buy them from carriers here.
timemagetgunr, ehh, more context needed. reset during isp does behave a bit like the way ss behaves under normal spi.
tgunrspecifically https://www.arduino.cc/en/Reference/SPI under connections
rawtaztimemage: interesting. thanks for letting me know a lot of things i had no clue about. never thought it was like this :D
timemagetgunr, the SS pin is relevant if you're device is being the normal spi slave. not the case for your arduino-as-isp and not he case for your arduino being isp target. you /do/ want pin 10 either input pulled high, or output, because if it goes low (even if floating) it will interfere with master mode. the convention is to use it as the connection to the target reset line. but really you don't have to. you could use pin 2 and put a
timemageresistor to vcc on pin 10. or enable the internal pullup. or set it to output but don't use.
sibiriaGSM and W-CDMA is almost always universally supported these days
timemagetgunr, so long as you have to satisfy the the requirement that SS be output or input-not-low on the master, you might as well use it to drive the slave reset line.
tgunrso ICSP RESET = Slave RESET? (on slave)
timemagetgunr, well, actually on a mega2560 it's not pin 10. it's something in low 50s iirc.
timemagetgunr, if i understand the question correctly, yes
tgunrok, i'm getting confused, I have the master pin 10 going to slave ICSP RESET, so your saying that needs to be pulled high?
sibiriabasically every phone made the past decade that has GSM support will do 850+900+1800+1900
sibiriaeven my old dumb-phone from 2004 does the full set of bands for GSM
timemagetgunr, look at pin 53
tgunron master?
timemagetgunr, yes
tgunrnot connected
timemagetgunr, this is the arduino mega counterpart to the uno's pin 10.
timemagetgunr, it *cannot* be allowed to go low as input.
tgunrok, will pull it high with resistor
timemagetgunr, yes, or... i can repeat all the stuff said above.
timemagetgunr, what i would do instead is connect your isp target reset line to it. and compile the arduinoisp sketch with 53 instead of 10 for the reset definition.
tgunrlooking in code
tgunrRESET = 10
timemagetgunr, yes. change to 53
tgunrand tie 53 master to slave ICSP reset
timemagetgunr, that is what i'd do.
tgunrthen i'll pretend to be you :)
timemagetgunr, "so long as you have to satisfy the the requirement that SS be output or input-not-low on the master, you might as well use it to drive the slave reset line."
timemagetgunr, if you weren't going from the isp header it's right where you'd've tapped into those signals anyway.
tgunryews, but no getting a damn error in ide compiler about spimode0 and I have not changed anything
timemagetgunr, dunno. what error and what version of the ide?
tgunrits in ArdunioISP.ino somewhere
timemagetgunr, it would be.
tgunr SPI.beginTransaction(SPISettings(SPI_CLOCK, MSBFIRST, SPI_MODE0));
mrpacketheadwell, i fiinsihed the layout for my first ardunion project
mrpacketheadhttps://imagebin.ca/v/3qiTHiOKBDzF
tgunrdoesnt know whaat SPIMODE0 is
tgunrwait, wrong SPIBeginTransaction
tgunrah, i see it, using wrong folder for libraries
timemagetgunr, uhh, that's one that comes with the core. so... not sure how you managed to misconfigure anything like that.
tgunrme either, somehow it started using marlin folder
rawtazlooks like https://github.com/andresarmento/modbus-arduino only supports slave mode. can anyone recommend a library for arduino that can do modbus over IP both as master and slave (as i need both)?
rawtazbrb
rawtazif there isnt one, im open to suggestions on other simple communication libs, i just need to do some message sending between a couple of arduinos
rawtaz(over ethernet)
begarHello, is anybody online?
rawtazperhaps MQTT
rawtazbegar: yeah its an active channel
rawtazbbiab
xxoxxhi. trying to setup pwm on timer4. but pins won't toggle. am I doing everything right ?
xxoxxhttps://pastebin.com/ECd2NDBc
begarDoes anybody have experience with asf library and arduino due?
begarI am trying to setup bluetooth HC05 with it, but dont know how to set up USART 3 as UART communication
Snert__xxoxx: pinMode(PIN_pot,INPUT); <-- input?
xxoxxyea. this is just for debug
timemagerawtaz, seem to remember there's one in the library manager.
xxoxxI hooked up a potentiometer to PIN_pot, which is set as duty cycle on channel B of timer 4
xxoxxand 100 as constant duty cycle on channel A of timer 4
xxoxxbut neither of these pins toggle
rawtaztimemage: theyre either just RTU or just slave. but im checking out other types pf ethernet comm now, there's a bunch at https://playground.arduino.cc/Main/InterfacingWithHardware#Communication
rawtazor not. man its seriously hard to find master modbus libs for arduino. i wonder why. i guess cuz most the times there's some master involved already (e.g. a PLC)
timemagerawtaz, it's normal for the master to be a larger more complicated thing. but there are uses for both ways. so, you're looking for master ascii ?
xxoxxokay.. i got the pins to toggle.
xxoxxby using analogWrite(8,pot) rather than OCR4A = pot;
xxoxxwhy analogWrite works but OCR4A doesn't work ?
xxoxxthe setup portion seems to be correct. I get the desired frequency.
xxoxx62.5khz
rawtaztimemage: yeah. a friend has a PLC as the master, i just realized.. well honestly i just need to be able to send a few commands and snippets of data long with them, between two arduinos :)
timemagerawtaz, meaning you don't really need modbus?
rawtaztimemage: not necessarily, no. i would like to use it, because i think it's a nice little protocol and it's supported in e.g. PLCs, so i'd prefer it. but this time i just need to solve this need in the easiest way
rawtazit has to be over ethernet though, and preferrably with a nice lib so it doesnt require a bunch of code
timemagerawtaz, hmm, you didn't find the pepsilla AsciiModbusMaster stuff or you did but it isn't useful?
rawtazdidnt, checking right now
xxoxxhi. what does sbi() mean ?
xxoxxcan't find mention of sbi() in arduino docs anywhere
baldengineerit's not an "arduino" api
timemagexxoxx, macro in avrlibc for an avr instruction. check avrlibc doc or doc0856
baldengineerprobably part of AVR ^^
xxoxxright. i saw it in the implementation of analogWrite
timemagexxoxx, "set bit in i/o register"
xxoxxyeah ok. thanks
rawtaztimemage: hm based on https://github.com/pepsilla/Arduino/blob/master/MODBUS/ASCII/libraries/AsciiModbusMaster/examples/AsciiModbusMasterArduino/AsciiModbusMasterArduino.ino it looks like this is for serial/RTU though, not ethernet?
timemagerawtaz, ascii. i dunno that ascii is ever used over tcp unless only because a general serial-network adapter is used.
rawtazim sorry, im not entirely following. ASCII to me is in the context of the ASCII table. the code in that file suggests setting up a serial physical interface - i dont see anywhere that IP over ethernet is set up. are you saying i can somehow use this library but over ethernet anyway?
timemagerawtaz, https://tinyurl.com/y8wzp95m
timemagerawtaz, maybe i'm not understanding what you want. but i asked about modbus ascii master and got something like a 'yes'. so far as i know the ascii version of modbus is pretty much only ever carried on serial.
timemagerawtaz, i don't see why you couldn't send it over tcp. but as i understand it, that isn't generally done.
rawtaztimemage: okay. yeah sorry if i confused you :) my goal is to send data over IP on ethernet. that is, to have both arduinos communicate using IP.
rawtazi did find something though - i could probably just use the ethernet library straight off the bat, it has a simple server and client.
timemagerawtaz, heh, okay. then MODBUS-ASCII wouldn't likely be involved at all.
rawtazi'd just lack the protocol atop that, but my use case is so simple that i can easily make my own little silly protocol for message passing.
rawtazhere's a simple example of the server: https://www.arduino.cc/en/Reference/EthernetServer
timemagerawtaz, MODBUS-TCP is probably what you're looking for. it's basically RTU, i think. only integrity is guaranteed by TCP instead of the modbus layer.
rawtaztimemage: exactly, that's what i was looking for. but havent found any such libraries that can work in master mode as well as client mode (theyre just client mode)
timemagerawtaz, well, if you don'd mind sending RTU over TCP (as though it were serial) you could probably hack the various RTU libraries and just insert your own code where it does transmit and receive.
rawtazperhaps, thats probably doable. but i dont have the time for that im afraid (this time)
paule32hello
paule32i am new, and i would like to process the tv sample
rawtazhi there
rawtazwhat tv sample?
paule32i saw a video on youtube
paule32i have the arduino for me
paule32i connect resistors to ping 9 and 7
baldengineerwhat video
paule32i plug-in the ground wire cable
paule32https://www.youtube.com/watch?v=DT9K0ZZl_rQ
rawtazpaule32: we have no idea what you mean by "tv sample" or what video youre talking about.
xxoxxokay. figured it out ....
baldengineerpaule32 save me a lot of time, what time code does he show the schematic?
xxoxxseems I forgot to do pinMode
paule32baldengineer: 6 minutes
baldengineerYeah, I don't think there is one there
paule32what i not understand is, where could i connect grnd?
baldengineer?
baldengineerground of what
paule32arduino
baldengineerthe Arduino already has ground pins
paule32yes
baldengineerconnecting takes two things. you only gave one. connect arduino to what
paule32to tv
baldengineeruh
paule32,
baldengineerokay, I'm done.
rawtazpaule32: you are not making any sense. do you understand that?
paule32the only question was, where do plug gnd from arduino to
paule32to the chinch cable gnd?
rawtazpaule32: it *completely* depends on what you are trying to do here. which you haven't explained well enough
rawtazpaule32: we cant read your mind. you have to explain in an elaborate way what youre trying to do and what youre stuck on
paule32i would like to made arduino retro computer
rawtazand what do you mean by that. what is it supposed to actually do.
zap0lol.. you got brainwashed into thinking an arduino is a general purpose computer powerful enough for such things... HAHA! yet another marketing victim
paule32i have 2 resistors, 1 cinch cable, and 1 tv
paule32not at least 1 arduino
xxoxxare you confusing arduino with a raspberry pi ?
paule32 no
xxoxxif you want to use an arduino as a general purpose computer, it can be roughly equal to a TRS80
xxoxxyou can load BASIC into its ROM
rawtazpaule32: you are not listening, and you fail to explain. we simply cannot help you.
xxoxxthat's pretty much the only way to run "code" from RAM
xxoxxi.e. interpreted
ozzzypaule32, why don't you try with something that is at least a computer
xxoxxthese atmel thingie reminds me of little intricate clock / watches
xxoxxtimers are like these tiny gearing mechanisms
xxoxxTCCR OCR like catch / release mechanisms
mrpacketheadwhat programmer woudl you recommend to buy for ATMegas?
baldengineerI like the USBTiny
mrpacketheadi'll potentially have a LOT of chips to program so fast is important.
baldengineerAVRTiny or USBTinyAVR whatever it is called
xxoxxi just use STK500
xxoxxwhy not STK500 ?
mrpacketheadwhat happens with millis() when it clocks over
deskwizard1the universe turns inside out
deskwizard1it's a bitch really
deskwizard1all those particules ... *sigh*
deskwizard1:P
mrpacketheadcurrentMillis - previousMillis may well be negetive
mrpacketheadis that a problem?
mrpacketheadthese are unsigned long
timemagemrpackethead, it's modular arithmetic.
mrpacketheadmeaning?
mrpacketheadi dont' know what modular arthmetic is
timemagemrpackethead, the answer is basically the same as the answer to this. if you started working on something at 22:00 (10pm) and you ended at 02:00, (2am), the difference of end-start is 04:00
mrpacketheadright.
timemagemrpackethead, it is similar to normal arithmetic, except the result is reduced modulo the limit of the numbers.
mrpacketheadok.
paule32sodele
mrpacketheadwell that makes it simple
paule32i download ide 1.8.5
deskwizard1congrats
paule32where are the .hex/bin files?
timemagemrpackethead, so if you have a 32bit number like 0xFFFFFFFE and you subtract from 0x00000002 the answer is 0x00000004
deskwizard1paule32: enable verbose on compile it'll show you
mrpacketheadgot it timemage thanks.
mrpacketheadmakes sence
mrpacketheadi'm seeing up some periodic tasks in my main loop
deskwizard1oh and just to be a dick...
deskwizard1an unsigned variable can't be negative :P~
deskwizard1carry on.
timemagemrpackethead, https://pastebin.com/AxR7Puiz you can tweak the millis value, if you want. feed this: set_millis(-4000); you should be 4 seconds from rollover then. you print out millis a couple of times to verify that's the case. you can use it to test rollover in something that uses millis. you could also just wrap it, e.g.: unsigned long my_millis() { return millis() - 2000; } and test your code subject to rollover by using calls
timemageto my_millis()
timemagemrpackethead, not sure why i went with 2000 instead of 4000 for the second example, but anyway.
mrpacketheadbacj
mrpacketheadthanks
mrpacketheadyour pastebin might be missing somthign?
timemagemrpackethead, might it not?
mrpacketheadsorry i saw no reference to 2000 or 4000
timemagemrpackethead, it's only the function. you can set it to whatever you want.
mrpacketheadahh ok
mrpacketheadits looking like it will work nicely
timemagemrpackethead, if you want to pretend the arduino just fired up even though it's been running for hours/days whatever. set_millis(0); -4000 would set you 4000 millis seconds from rollover.
mrpacketheadI have to make an 'alarm' sound that is .6s/.2s .6s/.2s .6s/1s ( alarm/pause )
mrpacketheadits six 'step's in the alarm, so i'll just keep track of where its up to
mrpacketheadand check the millis. its pretty easy
timemagemrpackethead, yeah, you can keep a unsigned state; variable unsigned long entered_state = millis(); an array: unsigned tone_delay[][2] = {{600, 200}, ....};
timemagemrpackethead, something like that.
mrpacketheadtimemage, these little $1 Ic's are quite amazing, and the whole arduino environment is acutally quite functional and useful
timemagemrpackethead, which ic?
mrpacketheadin the environment i work in, ( i'm 98% just doing hardware for work ) people seem to have this idea that ardunio is just a toy
mrpacketheadbut actually its quite capable.
mrpacketheadThis thing i've bene playing with is a 328
mrpacketheadtimage, my alarm works very nicely thanks.
mrpacketheada new question.
mrpacketheadfor the rookie.
mrpacketheadthere is a "library" that allows me to play multiple tones at the same time.
mrpackethead(on differnent pins)
mrpacketheadhow do i install this libary?
mrpacketheadthere is a .cpp and .h file in a src folder
mrpacketheadwhere do i put them
HrdwrBoBhttps://www.google.com.au/search?q=how+to+install+arduino+libraries&oq=how+to+install+arduino+&aqs=chrome.1.69i57j0l5.4767j0j7&sourceid=chrome&ie=UTF-8
HrdwrBoB:)
mrpacketheadthanks.. thats easy
mrpackethead:-)
HrdwrBoBfeel free to come back if parts don't make sense etc
HrdwrBoBbut always google first
mrpacketheadi did google.
mrpacketheadi went on a goose chase.
mrpacketheadgot a bad one
mrpacketheadtimemage, you still here..
mrpacketheadtimemage, thanks for your help, i got this to work
mrpacketheadhttps://youtu.be/wUPSw6d45UQ
mmgoodHi. I'm pretty sure the Arduino Pro Mini I'm working with right now is a knockoff. The silkscreen reads "ACC" rather than "VCC" on the non-programming-header power pin, the reset button has a rectangular shape, and so on...
timemagemrpackethead, nice.
mmgoodThe canonical schematic shows a cuttable pad to completely isolate the onboard regulator and power indicator LED but I'm not finding a picture that shows where it ought to be...
Mikeeemmgood just determine which IC is the regulator
mmgoodI know where the regulator is.
mrpacketheadPart of me is struggling with how 'simple' ardunio is
Mikeeemmgood what is your intention
mmgoodI'm just trying to find out where the pad "ought to be"
mmgoodBut it's a log shot.
Mikeeeyou can easily just test the existing pads with a meter to find out
Mikeeethere's like what, three?
mmgoodthe fricking regulator runs hot even when I power from the prog headr. that is not how it ought to be.
mmgoodfive
timemagemrpackethead, it's more so when you're working within common scenarios.
Mikeeefive takes five seconds to test then
mmgoods/long/log
mmgoodsigh. not what I am asking but thanks just the same.
Mikeeegets you to your answer a lot quicker than your own method
mmgoodno it doesn't.
Mikeeeyou don't own a meter?
mmgoodI'm familiar with the approach you sugest.
mmgood*suggest
Mikeeepoke poke poke poke poke
Mikeeedone
timemagemmgood, not all regulars are designed to be fed only to the load side. sometimes the advertise them as having that capability in the first page summary in the datasheet.
mrpacketheadi should quite possibly do some reading
mrpacketheadtheres qutie a bit i could learn
Mikeeefuck reading
Mikeeego to thailand
Mikeeefor a thing
mrpacketheadi hated thailand.
mmgoodIf this reg is to spec it ought to be OK being left open on the vin side and being fed 5V on its output
mrpacketheadits only my not to return to list
mmgoodbut I am not seeing that, it's running hot even when there's no "raw" vin
timemagemmgood, yeah, i'm just saying it may not be if it's a cheap clone.
mmgoodso meh
timemagemmgood, you've got nothing attached to the board right?
mmgoodtime: roger that.
mmgoodso I chuck these and go with The Real Thing ;P
timemagemmgood, maybe stick it in a junk drawer until you feed like desoldering the regulator.
Mikeeei'd just lift the output leg
timemageMikeee, have to keep you away from fire hydrants.
mmgood#FFS I found the pad. You know how cuttable pads are supposed to invite you to cut them? Like with two wide spots with a narrow junction between?
mmgoodthis is a VIA. #jeeziss
timemagemmgood, duhhh, cuttable via?
mmgoodnot very but I might drill it.
mmgoodso there we go. duuuuhhhhh
Mikeeethe problem here is that mmgood expects it to be at all the same to the official arduino
mmgoodit was situated in an obscure place
mmgoodwell, it'd hae been nice if the via were near the regulator. :P
Mikeeewhy would it be?
mmgoodI'm an optimist.
mmgoodIt was solder masked over
mmgoodfuuuuck
mmgoodanyway.
mmgoodthanks for the moral support , all
mmgoodall best. cial
mmgood*ciao
faxmodemHi there
faxmodemI just bought a pro micro. Strangely, it announces itself (IDE>Tools>BoardInfo) as a LiliPad Arduino USB
faxmodemwhen I upload Blink, it doesn't blink
faxmodemAny idea on what I could try next? upload a new bootloader?
deshipuswitch to pro micro and upload again
deshiputhe autodetection is not reliable
faxmodemdeshipu: well the detection is from the USB layer as `dmesg` tells me the same
faxmodemdeshipu: but I'll try
faxmodemI just fear the wrong bootloader has been flashed to the device
IcePicI think the simpler explanation would be "they are so similar that its hard to tell the difference codewise"
IcePicjust because Lilipads look very differeny physically, must not mean that they are very different upload-wise
faxmodemyeah so I just chose "Arduino/Genuino Micro", and it seems to render the device useless: linux reports "device not accepting address" and both green leds are continuously on
deshipuwhat didn't you understand in "switch to pro micro"?
deshipuleonardo would have worked too
faxmodemmicro and pro micro aren't the same?
deshipuno
faxmodemright, will have to do the RST dance
deshipuactually, scratch that
deshipumicro should work too, sorry
faxmodemArduino Pro or Pro mini?
deshipuno, the mini and pro mini are the same as uno
faxmodemit's a 3.3V device BTW
deshipumicro and pro micro are the same as leonardo
faxmodemI'll retry with leonardo
deshipualso try a different cable
faxmodemthe real difference between thos boards is what? Chip and pin mapping?
deshipusize of the pcb
deshipuand design
deshipuwell, and uno/leonardo have a larger voltage regulator on board, I guess
faxmodemthe only physical weird thing I noticed when I got it was that its usb is micro-usb, while the others I have are mini-usb
faxmodemhow can I flash from the shell? the reset "trick" is difficult to do, as I only have 8 seconds to short RST to GND, click /dev/ttyACM0 on IDE, hit upload on IDE
deshipuif you enable verbose output in the arduino ide, it will show you the commands it is running to flash
faxmodemthanks!
faxmodemwait, where's that option?
deshiputhere are also makefiles floating around the Internet with the commands already in them
deshipuin the settings
faxmodemah yes
faxmodemcan you tell it not to delete tmp files in /tmp/arduino_build_ABCDEF ?
deshipuI don't know
deshipuoh, you can also flash by running the arduino from command line
faxmodemwhat do you mean?
deshipuhttps://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc
deshiputhe --upload option
faxmodemthanks
faxmodemanyway, is it possible the wrong bootloader is on the board?
deshipuwhere did you get it from?
faxmodemebay/china
deshipueverything is possible then
faxmodem"Deek-Robot" is written on it
deshipubut I thnk that all those bootloaders for the 32u4 are pretty much the samer
deshiputhe same
deshipuhowever, the led for blinking may be on a different pin
stardivinerDo I have to run Arduino with sudo (root privilege) ?
shantaram3013deshipu: then why can't we just use LED_PIN?
deshipushantaram3013: you can, if you selected the correct board from the menu
deshipustardiviner: you shouldn't have to
shantaram3013stardiviner: I remember having to add the Arduino application to some kind of group and then logging in and out before it could use the emulated serial port
stardivinerLike this one? https://playground.arduino.cc/Linux/All (Serial port permission)
shantaram3013yeah
IcePicusually linux serial ports are owned by the uucp ot dialout group
shantaram3013but it worked fine after that
shantaram3013no root required once I did that command
stardivinerI see, thanks
IcePicif you are not in it, then editing /etc/group and logout/login will make sure you are in it the next time
faxmodemthanks deshipu for your help
faxmodemdeshipu: so it won't help to flash another bootloader?
faxmodemright, so flashing blink again using lilipad/USB unbricks the arduino, but the led still doesn't blink. I tried uploading a sketch interacting with the serial port, but I can't get anything to input/output on the tty
faxmodemright, so DigitalReadSerial.ino seems to work
deshiputhe led is probably on another pin, that's why it doesn't blink
faxmodemdeshipu: I'll write a sketch to check all the pins
faxmodemdeshipu: sorry for asking again, but would it make sense to try to flash a pro-micro bootloader? or is there no such thing? ;o) (sorry noob question)
deshipufaxmodem: you can try, if it doesn't work, you can always flash the other one
faxmodemcan I backup the current bootloader?
deshipuI think avrdude should be able to do that, but I have no idea how, it's a bit advanced
deshipulooking at the pinout at http://www.pighixxx.com/test/portfolio-items/pro-micro/?portfolioID=314 it doesn't look like the pro micro has a led you could blink yourself
IcePicyes, reading out the current program (including the bootloader) should be doable, but I haven't done it. Should be "easy" to find with a search engine though
deshipuit has rx and tx leds, but they are not exposed as arduino pins
faxmodemokay thanks so much folks
jgalicWhich free MQTT online server is the best fot testing ARDUINO publish/subscribe purposes?
deshipuno idea, but I've heard adafruit io is nice
IcePicgoogle gave me a list
IcePichttps://diyprojects.io/8-online-mqtt-brokers-iot-connected-objects-cloud/
jgalicThank you!
jgalicAnd do ISPs sometimes forbid MQTT port (1883) communication?
deshipuI see no reason for them to do that
p0g0To extort a monthly fee maybe- my ISP won't open outbound mail( no mail server), until I give them $5/m...
p0g0Officially, a 'security' notion, the $5 kinda obviates that.
IcePicmail (and SMB windows ports) are quite different
p0g0But MQTT is a very low data rate thing.
p0g0Well, my ISP used to not block those ports and had assured me that they did not intend to, until they did.
p0g0So, in my case, it is about the $5/m
deshipuhighway robbery aside, there is no technical reason to do that
jgalicThank you very much for sharing your experince.
YotsonI can imagine a small fee will keep out a lot of assholes.
jgalicDoes anyone have an idea what is better solution for control on/off for smart digital candle over Internet? Arduino connected to MQTT port (with public IP address) or Raspberry Pi?
p0g0jgalic: Do you care about security? The two methods you offered have different approaches. As well, there are a lot of ways to do what you describe, not just a Pi or an MQTT server.
p0g0But both methods you mentioned can work too.
jgalicThe security is not so important because it is for kids and playing.
jgalicWhat are alternatives for someone who knows anly ARDUINO?
p0g0The web interface should be good then, easy enough and familiar to a kid.
p0g0jgalic: there are a zillion ways to manage that. I tend to use an ssh session, but I am not doing anything like what you are.
djphsecurity is always important ...
djphunless you want to be yet another person who's part of the IoT botnet ...
p0g0jgalic: you might look at the esp-link software, that has an embedded web page and iirc, MQTT- it runs on a 3$ ESP01 and can manage some GPIO pins, to turn on and off your light. You could port forward that from your firewall and make it a public web page.
jgalicOf course, regarding security ....
p0g0If the only thing attached to the ESP01 is your light, there is little risk of things...
jgalicI want to control 10 smart digital candles and control them with Android application.
jgalicover Internet.
p0g0all 10 run on the same MCU/CPU?
p0g0or are they distributed around differnent devices/places/IP addresses?
jgalicin same place, one besides another, I thought over relay board attached on 1 Arduino Mega.
p0g08 and 16 relays are common, you might need an 8 and a 2 to get 10
jgalicOK:
p0g0The original intent of the the esp-link software is a transparent serial bridge, offering you a telnet->serial bridge to the Mega.
HrdwrBoBI have a 16 relay board
p0g0jgalic: In that mode, the ESP is mostly invisible, beyond it's web page- but you use port 23 to pass serial data to the AVR Mega (socat can make that look like a local USB comm port too, on linux).
p0g0So, you can directly address the Mega like a telnet session, and pass serial IO to and fro.
jgalicExcuse me, is there some kind of document on the web describing procedure for project similar to this one, please?
p0g0jgalic: my stuff is way complicated for this, but the esp-link software is well documented.
jgalicOK, thank you.
pwillardp0g0: "there is no technical reason to do that" -- I asked Earthlink about it years ago. They said... it was mainly to prevent abuse through people who didn't know better from becoming accidental spam bots for others nefarious types. If you asked for it... it implied you were not one of the people who had no clue that they were worried about.
p0g0pwillard: yes, I get the open relay issue. That remains an issue with or without the $5/m fee. It might be an argument that the ISP needs $5 to cover the cost of managing the mail port, but that's really not how it is done either- a spammer gets in trouble from the recipients and spam engines, not from the originating site... usually.
p0g0The ISP will eventually get involved, but they get that message from spamassassin and the spam houses.
IcePicin .se, the 137-139,445 ports didn't use to be closed at ISPs, but then a tabloid had a full page on "you can see the files your neighbors are sharing" and lots of spin on how bad ISPs were for allowing this, and quite soon after, those ports were blocked on all ISPs
IcePicnow, the amount of crap we would have seen if they were kept open would have been bad, but it was blocked for all the wrong reasons
pwillardAs an enterprise firewall guy... I know how EASY it is to selectively open or close ports... I think it was more... Oh look a knob we can twiddle for customers... that should cost $5 to twiddle for them.
p0g0the twiddle might deserve a oner time fee, but the monthly in perpetuity after you once twiddled... that's just taking money because you can.
pwillardagreed... they over do it "recovering costs"
YotsonOr, because you can, charge money. Being capitalistic and all. :)
Yotsonhmm. Seems my ISP has a couple of port blocking settings. Hosting services at home at regular ports isn't/shouldn't be an issue.
IvoIf I set DDRB &= B11111100; (pin 8 & 9 as input) and PORTB |= B00000011; (write pin 8 & 9 high), is that the correct way to set them as input pullups using PORT/DDR/PIN register variables?
YotsonBut this ISP is far from cheap.
IvoYotson, you have static ip?
YotsonNot officially. But it has been the same for years and i get to play with DNS settings.
YotsonAlthough i haven't figured out how to change DNS for ipv6.
blathijsIvo: Yes, that is the correct way to set pullups
Ivocool
pwillardThough IVO... that would not be the Arduino way. That would be the AVR way.
Ivowanting to read things fast
djphpwillard: what's wrong with AVR's way (although personally I like _BV(pin))
Ivowhat's _BV()?
p0g0the port reads and writes are faster.
djphpart of one of the AVR includes, shorthand for "Bit Value".
p0g0You can also read a byte in one pass, not just a bit.
IcePic_BV is a macro
djph^
djphSuppose directly writing Bxxxxxxxx is less overhead at the end of the day; though I haven't really looked into it beyond "now why can't I get this to do what I think it's supposed to do"
pwillardBit Value
djph*sigh* I STILL can't figure out why this shift-register is off by one. Curse my rusty as all hell C programming.
pwillard_BV() was the committee answer to abusing some NOT QUITE C "asm" calls to set and clear bits from the early AVR days.
p0g0abuse by committee... there should be nibbling ducks, paper cuts, and many camel killing straws.
djphI wonder if I drew the picture wrong ... hmmm
pwillarddjph: I'm sure there is a logical reason
djphpwillard: I'm thinking I drew the picture wrong, or I got the math wrong on "where to start" vs. "where the light should be"
pwillardwell, everything starts at "0" of course.
deskwizard1o/
Aidusshi
Aidusshas anyone played around with mpu9250?
djphpwillard: seems it's more the conversion from decimal (I need the 4th LED to light) to "which bit is that now?" :)
djphalthough it's only on the second shift register in the ... oooohhh, I wonder if there's an extra CLK pulse to go from pin7 to pin_out ...
pwillardAiduss: just ask a question. The "Has Anyone" thing will always seem to fall on deaf ears. Stating why you are having a problem with mpu9250 is a better starting point.
pwillardusing 74HCT595's?
djphpwillard: something like that.
djphbut I've also got max... something or others ... as well. the TI chips just came first
Aidusswell the mpu9250 is a one big problem :D i have used kris wiener's code and many more sketches but so far no good results.
AidussIm interested in using mpu9250 with pro mini 3.3 v version for game controller, so output must be pretty fast and clean
pwillardPin 9 (out) is not LATCH dependent.. unlike pin Q7... only difference
Aidussso that was actually my question : did anyone had luck with this sensor
pwillardSo I assume you have been all through the Sparkfun page? https://learn.sparkfun.com/tutorials/mpu-9250-hookup-guide
Aidussoh yes
pwillarddjph: do you have decoupling caps on both 595's across the power and gnd pins?
djphpwillard: yeah, it's "half" a pulse ahead of Q7. which means that Q0 of the second chip would go high as soon as Q7 on the first does ...
djphpwillard: yeah
Aidussi have problem with all those sketches because my sensor connects to x69 not x68 as they all have in their code,
djph... er, I think anyway. I might be extrapolating the q7' to q0 pulse wrong.
djphbut I've a ton of LEDs and a fair number of extra 795's, so making a 16x1 array is trivial
deskwizard1Aiduss: change the code or change the address
deskwizard1*device address
djphwatch it be something daft like "it's because I'm not clearing the registers" :)
deskwizard1djph: simplest answer is usually the right one :P
deskwizard1Aiduss: you ran i2c scanner to get that address or 69 just looked good ?
djphcode *should* be clearing the registers (i.e. pulsing SRCLR low for a clock cycle), but maybe I got that part wrong ...
Aidussscanner gives me such address and it's kind a working with x69 but i think because of that i have not desired results out from the arduino
zap0aaaarggghhhhhhhh.... magic smoke just came out of my arduino board
deshipuRIP
Aidussohh
_ami_zap0: :( what did you do?
deskwizard1zap0: good work ! :)
zap0i thought i was doing the right thing.
deskwizard1Aiduss: then stop thinking :P
deskwizard1a phone's a phone, as long as you call the right number ;)
zap0i have a 12V DC power, and a PC fan connected, via a motor controller board.
deskwizard1Aiduss: perhaps actually describing your issue and showing your code might give you more help than my snarkly comments
deskwizard1zap0: no, you HAD a 12v... :P
deskwizard1Aiduss: but since I'm fkin psychic... https://github.com/dxinteractive/ResponsiveAnalogRead
deskwizard1psycho?
deskwizard1you guys make the call :P
zap0USB still works..... so i probably just fried the DC input reg
deskwizard1zap0: Hoprfully
deskwizard1(but yeah... :/ I wouldn't count on that :P)
deskwizard1what arduino do you have ?
zap0rx tx LED still works..... so it wasn't them
zap0power on LEd is still working.
zap0it's comm'ing at 115200 just fine .... over a page of text.
deskwizard1you sounds like you're booting hehe
zap0so not sure what i fried.
deskwizard1zap0: nothing is an option ;) sometimes shit recovers, especially if it was the vreg that hit his protection or something
deskwizard1I'm sure life will have a way to mess something you do with that board in the future, just as a reminder hehehe
Ivoshould a delay() in the main loop effect interrupt calls? 'Cus it seems to in my code
Aidussdeskwizard true, ill prepare myself better next time i visit this place ;)
zap0Ivo, using delay() at all is a code smell. avoid it.
deskwizard1Aiduss: hehehe no worries :)
deskwizard1Ivo: if it would, what would be the point of interrupts in the first place then ? :P
deskwizard1Ivo: post your code please so I can go "yep, knew it"
deskwizard1jk
blathijsIvo: delay() does not disable interrupts, so it should not prevent ISRs from running
Ivoarduino.cc should host their own pastebin and have a menu option to upload sketch to it
deskwizard1actually not a bad idea
deskwizard1of just to pastebin directly
dunz0rPastebin is blergh though
Ivoany pastebin is better than pastebin.com
deskwizard1okay okay let's have a dropbox to choose
deskwizard1:P
deshipuIvo: that means pastebin.com is better than itself!
dunz0rdeskwizard1: As long as it isn't pastebin.com :P
Ivodeskwizard1, http://dpaste.com/2Y5QH7X
dunz0rACTION should finish his pastebin and deploy it
dunz0rIt works, actually, the deletion-part doesn't yet though
dunz0rAs in, entries are forever
IvoIf I uncomment the delay(10); at the last line, then all 0s come up on serial, no matter how much I twist
IvoSemi related, if I also try to print re_counter to my I2C 20x4 lcd display (as is also commented out atm), then nothing works either
IvoIf I just print to 9600 baud rate serial, then counter does the uppy downys just fine
deskwizard1Ivo: well if you remove that delay, you're flooding the serial port as fast as it can
dunz0rIvo: Could it be that it's printing so fast that you can't see anything but zeros, or something?
deskwizard1hence the slower baudrate working
dunz0rACTION suspects this as well
deskwizard1Ivo: use a flag in your interrupt, something like "encoderChanged" and use that flag to only print if it change
Ivoalso worked at 115200
deskwizard1or if you insist on always printing, use something akin to the "blink without delay" example
dunz0rIvo: Yeah, compare the value to the last stored value, set a flag, and print if the flag is set
deskwizard1well with his possible states as -1 0 and 1, he already has one, just have to use it hehehe
dunz0rAh, could be wiser to store the state instead of the value, yeah.
deskwizard1that's what I usually do, but I'm lazy so I use defines for CW and CCW hehehe
IvoBut then if you don't poll for the state fast enough, loop can't adjust the value properly?
deskwizard1that sentence makes exactly 0 sense whatsoever
deskwizard11) you're using interrupts, what polling?
deskwizard12) adjusting what?
Ivoas in, 'reading values in loop() is essentially polling them'
deskwizard1I'm probably being a bit pedandic here, indeed :P
Ivohttp://dpaste.com/0TV9JN8 now zilch gets printed
deskwizard1yeah that's pretty much what we we're saying, flag waving hehehe
Ivobut does not work
Ivo:/
Ivonot even 0s get printed
pwillard 're_counter / 4' inside a serial.print() call might not be ideal
deskwizard1Ivo: you in a hurry? I was planning to get an encoder out sooner than later, might as well be today
Ivono i just got 10 REs from china today so I'm figuring out how to make em work
deskwizard1Ivo: aight, I'll be back with the encoder in a bit, I'll let you know once I'm back and hooked up
deskwizard1pwillard: I'm listening ;)
pwillardI always consider the argument processing of serial.print() to be stupid.
Ivopwillard, since re_counter is essentially being controlled by read_encoder, and my hardware encoder always increments by 4 states for every click, not much else to do afaik
Ivoif you print the value out vanilla, it will always be 0, 4, 8, 12, 16, -4, -32, etc
pwillardre_counter = (re_counter/4); serial.print(re_counter);
Ivoif loop is spinning around
Ivothat would very quickly result in the counter being divided down to 0
Ivofor the vast duration of its existence
deskwizard1pwillard: seems consistent with what I gathered the other day :P
deskwizard1Ivo: have a link to the encoders you ordered?
Ivohttps://www.aliexpress.com/item/Areyourshop-Potentiometer-Rotary-Encoder-With-Switch-EC12-Audio-Digital-Potentiometer-15mm-KQ-Handle-2-8Pcs-Hot/32844763167.html
deskwizard1Okay, I assumed those on a pcb, no worries
deskwizard1I have those also
deskwizard1when you have a moment could you share your wiring?
deskwizard1I'll try to wake myself up in the meantime lol
deskwizard1especially what related to the encoders, pullups, caps, etc
deskwizard1nvm the pullups... ;)
deskwizard1oh which arduino also plz
deskwizard1also, I think I have a straight AVR encoder code somewhere now that I think of it
pwillardone that uses hardware interrupts on pins 2 and 3 ;-P
Ivouno
Ivooutside wires on analogue 2 & 3
Ivomiddle on ground
deskwizard1pwillard: smartass. :P
deskwizard1pwillard: I'd double check his code if I we're you ;)
deskwizard1looks like port C not D :P
Ivopwillard, you're not wrong
deskwizard:| shit.
deskwizardlol
deskwizardyep, I'm an idiot, carry on.
deskwizardI should stop yakking and start drinking
IvoC register is analogue
Ivopretty sure
deskwizardbbiab
deskwizardIvo: yes, I'm the dude who can't yet read apparently
deskwizardhell, considering I couldn't count up to 7 the other day, not that bad ... *facepalm*
Ivonote their EC12 encoders not EC11
IvoI'm still struggling to find the difference between them
Ivobut EC12 sounded like +1 better than EC11
Snert_wow, lotsa good tutorials about that ec-12 encoder
Snert_Ivo: so which one are you following?
Ivomostly https://www.circuitsathome.com/mcu/reading-rotary-encoder-on-arduino/ but moved value reading to interrupt based
Ivo*pin reading
deskwizardAh, code I was thinking of uses a timer, nvm that one.
Ivobecause I thought having it interrupt based would mean it wouldn't matter how fast loop() was reading stuff (because it wasn't working when I was trying to print out via I2C LCD display)
Ivobut then with interrupts it still isn't working with anything apart from printing to Serial
IvoI wonder if transferring this to an esp would help
deskwizardwell, first it wouldn't work since you're using straight AVR C
deskwizardand no, because even if it would, it's still wrong
deskwizardin case your so inclined, that's the timer encoder stuff I was talking about earlier, in case you wanna try it or something http://dpaste.com/1X2QCVX
deskwizardyou're*
deskwizardIvo: I recall a nice writeup on rotary encoders with straight AVR and interrupts, iirc it was at avrfreaks
Ivosame website has mostly that... https://www.circuitsathome.com/mcu/rotary-encoder-interrupt-service-routine-for-avr-micros/
deskwizardnow that you mention it, probably is the same exact thing yeah
blathijsIf you want to measure speed with the encoder (and not really direction), you can also use the ICP module to capture very exact timestamps of each encoder tick (not sure what you're building, though)
deskwizardblathijs: Oh, interesting! I'll keep that in mind :)
Ivodeskwizard, that's for an AVR with more than 2 pins available to set interrupts on?
Ivono just a timer interrupt
deskwizardit's using a timer interrupt instead of a pin interrupt, you can use whatever pin you want
deskwizardyou might what to try changing line 64 to 124 instead of 249 since it seems to be set up for 8mHz but it would work right away anyway, timer interrupt will just get called twice as often
N0ZYCdebouncing seems like it would be a little more difficult to do with a digital rotary
deskwizarddepends on how you're doing the encoders in the first place, in the end, my timer thing is doing pretty much the same a "blink without delay" would, "more or less", just not disturbed
deskwizard(roughly)
deskwizardalso depends on how you define "good enough debouncing"
deskwizardor just read it faster and don't confirm state until X number of the same position have been read, something like that
deskwizardI'd probably do something like that as well if I'd be using a PCINT
deskwizardyeah, that's what I'll do. using int0/1 you have to read both, with PCINT you read and mask, 1 read
deskwizardI think I'm slowly waking up hehehehe
_JordanHi guys, any recommendations on BLE chips? My aim is to 2 way communicate betweem an UNO and a BLE slave chip. Shout up if you want any more information
_JordanI'm currently looking into the Arduino Feather 32u4
BHXDoes anybody know of a simple method to generate a floating potential? Like generating a voltage of 5 volts between a certain point in the circuit and another (otherwise floating) point?
BHXI am thinking of using multiple DC/DC converters, but those are relatively expensive... and large...
blathijsBHX: If you have another voltage that will be more than 5 volts above your floating point (at least some of the time), you could a zener, resistor and capacitor as sort of regulated supply
blathijsBHX: If it's completely floating, you'll probably need some DC/DC (isolated) converter
BHXYea, so I'm probably going to use 8 DC/DC converters, unless I find one with multiple isolated outputs... the relevant points are connected to external circuits over which I have no control and which can be any voltage between 1.8 and 42 volts. :/
faxmodemso I've got this pro micro and want to hook it up to a W5100 ethernet module. I've read I need to use the micro's ICMP for SPI but other docs say I need pins 10,14,16,15
blathijsIf these points are referenced to your own GND (which is apparently the case if you say they're between 1.8V and 42V, assuming that's relative to your GND) you could perhaps get away with my zener trick (though I guess you might be wasting a lot of power depending on the actual floating voltage)
faxmodemI tried the latter, but it doesn't seem to work
blathijsfaxmodem: Try looking at the schematics to see what the SPI pins are?
blathijsfaxmodem: Note that MOSI/MISO/SCK are the shared SPI pins (which overlap with ISP), the W5100 SS (slave select) pin can be any I/O pin (including the Arduino's "SS" pin, but that one is only special when the Arduino is in slave mode)
blathijsAlso, you said "ICMP", and probably meant "ICSP", which is a PIC term. For AVR, the offical term is "ISP" (I believe it stands for in-circuit serial programming)
faxmodemyes sorry
faxmodemblathijs: does this mean if usb is connected to a computer, I can't use SPI?
blathijsfaxmodem: No, USB and ISP are completely unrelated
faxmodemeven if the programming is done over usb?
blathijsfaxmodem: Yes. When programming over USB, you're talking to the bootloader, a bit of software running on the MCU. ISP programming is different, than you're talking directly to the MCU hardware, no software (on the MCU side) involved.
deskwizardIvo: You're pretty quiet.... not sure which way it went :P any luck ?
blathijsfaxmodem: On most Arduinos, USB programming happens through an USB->serial chip that is connected to the UART (serial) pins of the main MCU. On your Pro Micro, the USB connector is directly connected to the main MCU, on dedicated pins (not overlapping with SPI/ISP)
pwillardIt makes the Micro and Leonardo somewhat special in how it behaves when plugged in... as its not the same as the USB Serial behavior.
deskwizardpwillard: sorry to come back to this, but I need a sanity check ... Ivo's code (http://dpaste.com/0TV9JN8) yeah he sets the mask for pin 2 and 3, but on registers for PORTC, no way his interrupts are going to work it's on PORTD ... or am I totally crazy?
deskwizardlmfao only took me ...
deskwizard2hrs
deskwizardIvo: yeah, if you want to use the interrupts, it's on PD mate. your code works if you use the proper registers :P
pwillardPins 2 and 3 are special cases.. They are the external INT0 and INT1 interrupts, and they are therefore matched to Arduino pins 2 and 3.
deskwizardIvo: http://dpaste.com/0FNKRAA
deskwizardIvo: unrelated: let me know how that LCD works, I ordered one recently.
deskwizard*works out
lvlinuxI successfully got my Atmega163 to work with the Arduino IDE!
akkShould "console=serial0,115200 console=tty1" be okay for a pi1 in cmdline.txt if I want to use a serial cable from GPIO pins 6, 8 and 10?
akkAnd no enable_uart=1 or dtoverlay=pi3-disable-bt in config.txt, right?
akk(sorry, wrong tab)
pwillarddeskwizard: Akk: why the heck is there port manipulations in that code? this was one of main goals of arduino... to eliminate that...
pwillardAkk... that IS for the GPIO UART interface.
akkI thought so ... thanks, pwillard. I must have something somewhere else that got changed that breaks the serial console.
pwillardthe additional serial port got re-assigned to Bluetooth on Pi3 and ZeroW
pwillarddefault serial port is still there
pwillardI much prefer using a USB serial adapter for serial access to Pi... as accessing GPIO for serial is fiddly. However, when I mention it... you would think I grew an ear on my face.
akkI just got USB serial gadget working a week ago on a pi0 (and I agree, not many people talk about that, it seems like a great option)
pwillardand that is the weirdest way of reading an encoder I have seen in ages... akk
akkbut I need to get a USB B-B cable to get that to work on my B models.
akkSorry, what's the weirdest way of reading an encoder?
pwillardYour use of bit shifting
pwillardpersonally... I would have each INT (INT 0 and INT1) have their own interrupt service routine... but thats me
Rickta59interrupts are useful if you are sleeping and want to get alerted to wake up however there are other ways to deal with buttons and encoders if you are going to have the chip on all the time anyways
Rickta59I like this button stuff https://github.com/tcleg/Button_Debouncer
rawtazhm, could someone help me get an Adafruit Feather 32u4 uploadable? i followed the installations instructions very carefully, so all the software and drivers from adafruit are installed (using the Ardunino IDE, latest 1.8.5). im running it in a VM, but the feather connects fine and in the IDE under the Port menu i have one option, "COM4 (Adafruit Feather 32u4)", so it clearly does recognize the board being there, and it's the proper one
rawtazbut when i try to upload it just tells me "Cannot find a Board on the selected port" (i selected COM4), and that i can try pressing the reset button after initializing the upload. i tried that, no dice, doesn't change anything.
rawtazthe board DOES pulsate on the LED when i hit the upload button, so it seems to me that it does get a signal. but it just pulsates for a short amount of time, then goes back to the default blink program, and i get the aforementioned message in the IDE.
rawtaznot sure what else to try. ports etc look okay to me
rawtazah wait i might have figured it out, moment..
rawtazwohoo, success!
rawtazjust as with the teensy, i also had to add a filter for the bootloader usb thingie so it's connected to the VM, and make sure that windows installed drivers for it.
pwillardhehe... working in a VM always has those little gotchas when it comes to talking to real hardware.
akkpwillard: You might have meant someone other than me for the bit shifting ... at least I'm not sure what you're referring to.
pwillardDang it... yeah... that was Ivo... sory
akkAh, good. No wonder I was confused. :)
pwillardoh well... I can't remember everthing I want to.
rawtazpwillard: yeah :) but it's wonderful when it works =D
rawtazit's just sometimes a race condition between windows time it takes to install the drivers when the usb device connects, and the time that the board stays in program mode before switching back out of the bootloader :P
pwillardmakes sense
paule32hello
paule32arduino ide compiler (avr) can't find #include file
paule32is it possible to give parameters to compile a .pde ?
paule32in the ide ?
blathijspaule32: You can modify platform.txt to pass options, but that's a hassle. In this case, you probably installed the library wrong, or selected the wrong board?
pwillardYou want to get to the root cause of why the #include cannot be found
pwillardand we have not used PDE for years... so maybe your code should be looked at by us here to help out.
pwillardYou might need IDE 1.0 assistance with changes to base code and libraries due to changes when V 1.0 was introduced
JeffreyAnyone got an idea wat kind of small arduino (or clone) to use for a somewat complicated portable project?
rawtazby default i say Teensy 3.2 :D
rawtazwhether it does what you need, i have no idea. what features do you need?
JeffreyI am trying to build somthing like a bike computer for a walker or rollator
JeffreyIf possible the device has to: 1. measure and log walked distance and notify if daily target distance is achieved. 2. turn on a laserpointer for a certain amount of time (shines a green laser line on the ground ) 3. have a simple menu system for a few settings (target distance, time etc. ) 4. have a clock (for data log) 5. have a screen (to display all info) 6. have a way to measure status of the battery (wil most likely be a powerban
JeffreyIt will probably have somthing like a 128x64 I2c Oled screen, RTC, pushbutton, rotary encoder with button, sd cardreader and a hall sensor.
rawtazim pretty sure a teensy can do all of that, except i dont know if it has an RTC or not. if it doesnt, there's probably stuff you can add to it.
pwillardI'd still start with a teensy
Jeffreyat the moment all i have here are a bunch of pro micros and pro minis
pwillardadd a "dead-on" rtc
pwillardThe new teensy 3.6 even includes a SDcard plug... handy for logging
rawtazJeffrey: here's a couple of nice summaries: https://www.pjrc.com/teensy/pinout.html and https://www.pjrc.com/teensy/techspecs.html
rawtazi like those of them that are 5V tolerant, especially the 3.2 one since it's so small as well and yet has many ports
rawtazpins*
rawtazGPIOs*
BHXCan I use an ADM3251E as mosfet gate driver, or does anybody see a problem with that? ^^"
pwillard3.6 is NOT 5V tolerant though
rawtazyeah, unfortunately. but the 3.2 has a lot of GPIOs anyway so perhaps it's enough
pwillardright
pwillardBHX is there a reason you selected that part>
pwillard?
BHXMore or less, I want to drive a mosfet independent of the voltage at the drain/source. So I think I need a fully isolated solution. Since the ADM3251E provides isolated GND/VCC and an output switching between ±5V it seems to provide what I need. Even though somewat expensive...
BHXActually I just want to drive the gate of an N-channel mosfet to ±5V referenced to the mosfets source voltage. And I'm probably missing the most obvious solution? ^^"
paule32need help: https://pastebin.com/nDZa8KMv
paule32the last 2 messages ...
deskwizardman, if that blows it's going to ruin Teslas safety rating :| hhehehe
deskwizardlmfao
Rob235https://i.imgur.com/TMlGG0a.png
Rob235finally getting somewhere
xxoxxhi . anybody uses struct with arduino ?
drewmuttYep.
drewmuttLotsa folks do.
xxoxxthey work just like in regular C ?
ozzzystruct is part of the language
ozzzyyep... they do
xxoxxok
drewmuttAnd its more elusive cousin union.
xxoxxwhat's a union ? never used it in C before
ozzzyremember... 'arduino' is just C++ with a wrapper and some macros
xxoxxis there a way to detect chip model from within source file ?
xxoxx#ifdef ...
rawtazhm. according to the interwebs UDP_TX_PACKET_MAX_SIZE is 24, but people are using 48 as the value with e.g. Udp.read(packetBuffer,UDP_TX_PACKET_MAX_SIZE)
rawtaz.. successfully. if 48 works just fine, why is the constant set to 24? seems rather limiting
drewmuttxxoxx: Union is like struct but all the elements occupy the same space, so you can only use one at a time.
xxoxxdrewmutt: ok. i will look into that.
drewmuttxxoxx: in practice its not used terribly often, but something good to know about.
rawtazyeah it's indeed 24.
xxoxxcan you declare individual member of struct as volatile ?
Rickta59sure
xxoxxor does it have to be the entire struct, if at all ?
xxoxxokay. good to know
xxoxxthanks
xxoxxis there a channel for C on freenode ?
Rickta59sure
Rickta59* feels like a bot
Rickta59##c or ##c++
xxoxxok
xxoxxI tried #C, got into a place called ##namespace
Rickta59## groups are "official"
xxoxxok
Rickta59or the other way around .. not official .. i forget
xxoxxhttps://pastebin.com/bXv7pgtG
Rickta59look at that
akkI think the ## are the unofficial ones.
xxoxxhopefully this works
xxoxxwell I am chatting in ##C
akkAnd some channels bump you into a ## channel if you aren't registered on the server.
Rickta59could be akk
Rickta59what is int ptr?
Rickta59usually you don't call something a ptr that isn't
Rickta59is that really an index xxoxx ?
Rickta59usually the only reason to use volatile is that you are accessing a memory mapped register or you are sharing a variable between the main loop and an isr
xxoxxyeah this stuff gets called inside a tight ISR
xxoxxmultiple sound loops mixing
xxoxxwell i am happy. this stuff actually compiled ..
xxoxx'https://pastebin.com/RfdGPCsJ
Rickta59perfect
xxoxxhaven't played with C for ages ...
Rickta59i avoid names like 'data' as that is a symbol defined by the linker
xxoxxyeah. i changed ptr to index
Rickta59yes i noticed, i was moving down to line 8
xxoxxdata conforms with output of a tool that actually converts the wav to a C include file
xxoxxit's called wav2c
Rickta59uint8_t *samples
Rickta59or uint8_t *wave_data
Rickta59but that is me
xxoxxyeah. the wav2c generates stuff in progmem signed char
xxoxxfrom wav files
xxoxxa data array, and a length int
xxoxxhttps://pastebin.com/QUA7jk1J
xxoxxe.g. like this
Rickta59it is a style thing merged with a paranoia
xxoxxi am trying to figure out how to make one set of code work with multiple compile targets
xxoxx328, 2560, ESP8266, STM32
xxoxxall using Arduino
Rickta59isn't there a wav player library for that?
Rickta59* haven't looked
xxoxxthere's a wave shield, which requires additional hardware
xxoxxthere's also a pcm lib, which I am adapting
Rickta59https://github.com/TMRh20/TMRpcm/wiki that thing?
xxoxxi am using one counter to do push-pull
xxoxxyeah. similar to this
xxoxxbut no SD card
xxoxxmust using internal flash
xxoxxand tiny cut-up samples mixed to replicate a diesel engine sound
xxoxxnot to play entire mp3 music
xxoxxwav, I mean.
Rickta59the problem is that each chip probably has an optimal way to accomplish this task which probably isn't really an arduino solution
xxoxxright. the overall codebase is much more than just a wav player. the wav player is a pluggable mod. some architecture / config has it, some don't
xxoxxtrying to figure out a sane way to build / maintain / configure
rawtazhm, with the Ethernet library, is there a way i can define a static constant and give it to the IpAddress constructor, effectively replacing IPAddress ip(192, 168, 0, 2); with IPAddress ip(MY_CONSTANT); ?
rawtazim asking because i would like to put all parameters like that in a constants.h where i have a bunch of other static params
xxoxxrawtaz, I don't think you can change the function signature
rawtazindeed.. it's four parameters given to the constructor.. the https://www.arduino.cc/en/Reference/EthernetIPAddress doc explains it like "a comma delimited list representing the address (4 bytes, ex. 192, 168, 1, 1)" though. so i was thinking perhaps there's a way
rawtazwill i just have to do it with four static constants then :)
rawtazcheers
rawtazoh, unless i can just make it a macro?
rawtazhmm, there seems to be more constructors: https://github.com/arduino/Arduino/blob/8418eecca7e9d9b2f852194bd64a2563fd47943d/hardware/arduino/avr/cores/arduino/IPAddress.cpp
timemagerawtaz, hmm, what about them?
timemagerawtaz, you did see IPAddress::IPAddress(uint32_t address) yeah?
rawtazwell i can simply make a constant like "1.2.3.4" and use the IPAddress::fromString() to parse it
rawtazor the one you mentioned. i suppose i need to use some regular C function (addrtoinet or similar?) to produce that address
timemagerawtaz, #define /* or use static constexpr auto or whatever */ MY_CONSTANT 192UL << 24 | 168UL << 16 | 0U << 8 | 2U
timemagerawtaz, well, wrap the whole thing in () if you're using a define.
rawtazhm, is there no documentation in this source code? e.g. https://github.com/arduino/Arduino/blob/8418eecca7e9d9b2f852194bd64a2563fd47943d/hardware/arduino/avr/cores/arduino/IPAddress.h has hardly any REAL docs
timemagerawtaz, yeah, you could do it from a string if you wanted.
timemagerawtaz, alternately use uint8_t [4] lots of options.
rawtazhmm, can i do e.g. static const uint8_t[4] = {192,168,1,1} and then give that to IPAddress(uint32_t address) ?
timemagerawtaz, no need. bool IPAddress::operator==(const uint8_t* addr) const
timemagerawtaz, well, the ctor version of that.
timemagerawtaz, IPAddress::IPAddress(const uint8_t *address)
rawtazright, that
timemagerawtaz, kind of wondering why you're trying to go get away from static const IPAddress ip(192,168,1,1); IPAddress as a class is basically uint8_t[4] with some utility functions on it.
rawtaztimemage: cuz i want to put the ip address in a file which has just values for various settings. e.g. i have the port number, mac address as {...}, text strings, etc. all collected in one place. but i dont want to initialize objects etc there, i just want it to contain data
rawtazif that makes any sense
rawtazi want to separate the code and the parameters of my program basically
rawtazpreferrably i'd like to have something like IP_ADDR = "1.2.3.4" or IP_ADDR = {1,2,3,4} in there
timemagerawtaz, "in there" is a data file?
rawtazno, its a constants.h file
pwillard <facepalm>
rawtazthat i include in my main cpp file and any other files that might need it (i have #pragma once in the constants.h though)
timemagerawtaz, so then you're objecting to the fact that the data type you're using for the parameter involves a class or what?
rawtaztimemage: im not keen on instantiating classes/objects in that file, if thats what you mean by objecting. i would like to keep the contents of that file to defining types and values for my parameters/values used throughout the program
rawtazpwillard: is it that wrong to want to keep all those things in one single place, for easy maintenance?
rawtazFWIW in the main program file i instantiate the objects etc i use in the program, in init sections/functions.
timemagerawtaz, i'm not execting much difference between instanciating a uint8_t[4] and a thin wrapper around a uint8_t[4], which is what class IPAddress is.
rawtazthen later on i make use of it all
rawtazfair enough
pwillardNot wrong... maybe just use a simple struct... instatiating... wrapper... cripes... its just a few constant values defined at compile time.
rawtazi feel there's a difference though, cuz one is an object and the other a more primitive type
timemagerawtaz, it's worth seeing if the compiler shares your feelings. my guess is it doesn't.
rawtazhehe
rawtazwell in my last project (not this one) i ended up with quite a lot of classes which all referenced various "values", and i felt it was much cleaner to keep all of them in one single place instead of having to hunt around for them when needed
rawtazbut i come from a different background in programming than C/C++ so there's no wonder i have weird ideas :P
timemagerawtaz, well, i could be wrong. but it doesn't take much to test it. try both, look at the generated code.
rawtazim sure the compiler is happy with either way that meets the syntax requirements :)
rawtazi think illl try the uint8_t[] way, seems like a nice compromise
pwillardMicrocontrollers are the wild west... we run lean and mean and don't need no steenkin 8G of ram to get stuff done.
rawtazhehe true
djph\o/ i half figured it out ... I'm not giving the info to the shift registers right. Got a proof-of-concept matrix working now
pwillard(so don't bring your big city x86 ways to Dodge City. Marshall Dillon will arrest ya) ;-P
pwillardIt sure sounded like it djph...
rawtazhaha
rawtazyou should make an arduino song, you clearly have the skills :3
drewmuttHeh, it is pretty impressive what we pull off with grains of ram..
rawtazlike SUSE made various music videos
rawtazindeed drewmutt
djphpwillard: yeah, I was one CLK or LAT pulse off. Just gotta figure out a cleaner way than sending the same data $NUM_REGISTERS of times ...
Flea86drewmutt: My old ex-boss once told me you can do almost anything with 64KBytes of RAM and an 8-bit CPU :)
pwillardwell, that is the normal way... though you COULD tie the out of the last register to an input pin and shift until you get a "1" and that way you know hoe big to make your max_shirt_count be.
drewmuttHeh, he's not wrong, hell look what we got to the moon with.
drewmutt8 bits and monkeys.
pwillardMy old employer made a fortune selling 12 Bit 32K system in the late 60's
rawtazdid you guys see today's SpaceX Falcon Heavy test flight?
Flea86yeah
drewmuttTwas dope.
rawtaz(speaking of what amazing things we do)
rawtazyeah. epic
drewmuttIt's nothing short of insane that they landed at the same time.
Flea86Putting a car into space was probably the shittiest aspect of it :P
djphpwillard: yes, they're in series, which is what was throwing the original math off. I need to find a better way that can programmatically handle $NUM_REG properly
drewmuttFlea86: Agreed.
drewmuttBut if that's what the private sector needs to keep them motivated, so be it.
djphFlea86: you're only saying that because you can't afford it :P
drewmuttI would of applauded putting a pinto up there.
Flea86djph: If I had money, who said I'd not try and make my own electric car? :)
djphFlea86: "Power Wheels" doesn't count :)
Flea86(or at least mod an existing one)
drewmuttWhat does it teach other civilizations about our evolution without sending up an internal combustion engine?
Flea86pwillard: Did you see my latest update? :)
pwillardNot yet
pwillardOhhh minimig
pwillardnice
Flea86:D