timemagerapha, http://www.ecircuitcenter.com/Circuits/opsum/opsum.htm look at the section that says "level shifter" in particular.
raphathat looks a little familiar
raphai've started building the schematic in falstad
raphaalready understood some stuff
raphalike for example it's R2 and R4 controlling the gain!
rapha(of U1 and U2 respectively)
raphaneed food now, though. the thinking is taking its toll.
timemagerapha, some of it makes sense from what i remember from these. it did occur to me that you're more or less making a mixer/summing amplifier. so, just for the hell of it i thought i'd see if this could be made to work in simulation at least.
rapha"pH music" :)
raphahttps://tinyurl.com/ybzeegux
raphaworking lovely in simulation!!
timemagerapha, you're going to have to describe what's there, because i find that thing confusing as hell.
raphatimemage: it's just the first part of https://imgur.com/a/lzkOc
raphaand it's nothing more apparently than a "non-inverting amplifier"
raphaoh wait
raphalink was wrong, that was Mikeee's link from before
raphasorry
raphai've now added the second stage as well
raphaokay, tinyurl is broken horribly
timemagerapha, ah, okay.
timemagerapha, i thought it was supposed to be adding an offset, and i wans't seeing how.
raphano, falstad is broken
raphaokay, no, i'm just tired
raphatimemage: http://tinyurl.com/yacdbcnm try that one
timemagerapha, ehhh, feed it a sine wave varies from maximum to minimum of the ph sensor
timemagerapha, see if it still does what you expect.
raphai don't work like that
raphai need to move a slider
raphaif it's a sine wave then my brain goes bonkers
timemagerapha, okay. make the input negative then. it does generate negative voltages right?
raphaafter stage 1, yes
raphabut not after stage 2
raphaafter stage 2 it's all in the positive
raphaand it shows lovely how that potentiometer is the normalization potentiometer
raphaand now i'll try replacing R4 by another poti
timemagerapha, okay, i'm going to do what i usually do with falstad links =)
raphawhich is what?
timemagerapha, ignore it =)
raphalol
raphai'm sorry i didn't want to bore you
timemagerapha, i don't uses the thing often enough to able to understand how to control it. usually i see something i can't practically change or investigate. so that's what ends up happening. if i ever get the point where i'm using it to communicate ideas to someone else maybe i'll learn its weirdness enough to understand ones given to me.
raphait did have somewhat of a learning curve just now
raphaits the first time i'm using it
raphabut it's like GDB for hardware, it's awesome!
timemagerapha, i tend to use a more normal spice implementation. the things i've been posting are screenshots of ltspice running under wine.
raphasaw that i was a desktop program
raphathe falstad UI is actually not that bad once you've spent some time with it
raphatimemage: i take that back. potis are _really_ weird, UI-wise.
raphaYES!
raphathis is it!
raphaR4 needs to be the second trimmer!
raphaFIRE UP THE SOLDERING IRONS!
timemagerapha, http://picpaste.com/pics/2339613b0b75a41d34d6bfa824bd3d46.1512175645.png
raphathat's the TI-adapted design, right
timemagerapha, not really. it's using a summing amp setup. in the ti designed they just added and offset by letting the ph sensor float
raphahmm def. better about ltspice is that its opamps have V+ and V- pins
timemagerapha, this is taking it ground connected and feeding that and a fixed voltage into an inverting summing amp configuration. i cheated and just ran the offset and the sensor on the negative side so the output would be positive.
raphawhat do you mean by "float"?
timemagerapha, i mean that the "ground" of your ph sensor is not the ground of the circuit in the ti app note.
raphaso they are sending a voltage higher than necessary through the sensor?
timemagerapha, from what i could tell the sensor is a voltage source
raphayes, very small voltage source with very high resistance
timemagerapha, since it can have negative outputs, they referenced it to an offset voltage and *not* to ground.
raphaokay
timemagerapha, what i just sent is referenced to ground. and it adds the dc offset via the opamp. really there would probably be another buffer opamp in between, but i'm suing V2 to simulate it which doesn't have a high impedance.
raphaso the TI design is more elegant and yours is more ingenious?
timemagerapha, mine is just an attempt to gave it ground referenced like what you started with. the ti design is practical.
raphatbh i find their design confusing ... to me ground reference seems the natural thing
timemagerapha, imo, not more confusing that what i just posted.
raphayour latest thing it seems to invert the input signal but not amplify it or offset it, looking at the two sine waves
timemagerapha, it's only doing the offset.
raphawhen input is -500mV then output is +500mV
raphaoh
raphawait
raphayes
raphai see now
timemagerapha, it starts as -500mv to 500mv and winds up 0mv to 500mv. actualy it's atenuating it, which i didn't intend on. but there you have it.
raphaoffset and invert
timemagerapha, yeah, allthough it's inverted an already inverted signal because of the way V2 is attached.
raphaand you could control the level of offset by making R3 a trimmer
timemagerapha, that would change the amplification of both the offset and the signal.
timemagerapha, i just changed it to offset 0 and left the amplification level where it landed. the more important thing was to get it rising of 0v
timemagerapha, that link i gave does a reasonable job of explaining how the circuit works.
raphahttp://www.ecircuitcenter.com/Circuits/opsum/opsum.htm this one? i'm still reading that. lots of formula in there.
timemagerapha, with + at 0, the opamp is going to do what it can with the output to drive - to gnd.
timemagerapha, assuming you don't hit a rail, that means - is also at (or really near) 0 volts.
raphayeah hitting a rail also causes falstad to declare the caps blasted
timemagerapha, so the current going through RF has to be such that -I(RF) = I(R1) + I(R2)
raphatomorrow with sleep i'll read the wikipedia page on opamps
timemagerapha, a sum. well, inverted sum.
raphaWAAAH! a formula! big nope!
timemagerapha, lol.
rapha<-- worst subject in school, maths
timemagerapha, someone can probably explain it with beads, but not me. =)
raphalol with _beads_?
raphaalso what's RF i don't see anything labelled RF in your screenshot
raphaoh
timemagerapha, you want to do away with formulas, so... you're going to need something like that.
raphayou meant the link
timemagerapha, R3 holds that position.
raphawhen we did functions in math
raphai started making tables with concrete input and output values
raphathen i made dots on paper and connected them
raphathat's how i plotted functions
timemagerapha, that's a common thing to do to get your head around what a function can be.
raphai never got beyond it and the teacher gave up and accepted it because i did put the work in to make the tables
raphasame thing in physics
timemagerapha, i didn't learn math in math class. not after 4rd grade or so.
raphawell after 2nd grade i was given into a children's home and my grades in school tanked. i did recover from it somewhat in some subjects but not in maths
raphait _is_ frustrating because i do love tinkering with things, especially with electronics things. but i'll never get beyond a very basic level of understanding and abstraction because of that lack of mathematical understanding.
rapha*shrugs*
timemagerapha, from what i tell most people that are good at math are shit at explaining it. https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw/videos <- he's decent though.
raphasame with music
raphaawesome guitar players are shit at explaining it
raphainteresting question: does that hold true for any skill?
raphaoh cool
rapha"thinking visually about higher dimensions"
raphaour maths teacher definitely was shit at that
timemagerapha, nope. also yes on guitar players
timemagerapha, https://j2kun.svbtle.com/mathematicians-are-chronically-lost-and-confused
raphalol
rapha"it's a lot like learning to read"
timemagerapha, https://j2kun.svbtle.com/you-never-did-math-in-high-school
raphai spent the last three months as a teacher of german ... about 1/5th of my pupils were illiterate, even in their own languages. damn what an experience seeing a 50 year old man try to command the pencil precisely and consistently enough for him to be happy with his strokes forming into letters.
raphajeremy kun, bookmarked!
timemagerapha, https://jeremykun.com/2011/06/26/teaching-mathematics-graph-theory/ <-- more of the same guy. this is good.
raphahmm at least noone is _forcing_ me to do this anymore, i dunno, maybe it could be fun if i try to make it a hobby or something?
rapha"As we will see throughout the post, personalization (and the engagement inherent in it) is essential to the success of the lecture." YES! So true!!!
timemagerapha, https://tinyurl.com/yakgmmdw <- i sent that to someone recently as an example of something that was "explained" me that made little sense to me. turns out there's reason why it didn't make sense to me. it doesn't make sense. the sad thing is if you pay attention in school in can make you feel like an idiot where it won't to people that just regurgitate shit, which is the primary skill i remember in use.
raphaseems things are not better in the US than they are in Germany
raphathe sad thing is, this is not what Wilhelm von Humboldt had in mind when he was tasked with coming up with a new kind of school system
raphathe irony is that the systems we use still are said to be his system
oddalotanyone here experience with bit angle modulation?
oddalotexperience
oddalotexperienced*
Snert__never heard of BAM...sure it's called that?
Snert__oic binary code modulation.
szwetslootHey guys. I had to reinstall my PC due to software issues, but since then every time I try to upload a sketch to an atmega328pb I get "exit status 1 'Serial' was not declared in this scope"
szwetslootDoes anyone know how to fix this issue? Google isn't helpfull
szwetslootO and I also can't access PORTD directly (using digitalWrite does work)
szwetslootDoes anyone recognize this issue?
IcePicno, but pastebin the source and we could take a look at it.
szwetslootThis is the main function which throws the error.
szwetsloothttps://pastebin.com/zuKvqv8K
szwetslootLine 105
szwetslootD:\Dropbox\Arduino\Row 1\V1\Main\Main.ino: In function 'void setup()': Main:105: error: 'Serial' was not declared in this scope Serial.begin(9600);
IcePicYou might be missing an include, Arduino.h perhaps?
szwetslootI tried that, the only difference is that it then also throws an error on line 14
szwetslootWhen placing #include "Arduino.h" on line 35
IcePicyes, that name is reserved for analog pin 0
IcePicand the include placement isnt super important, either you or the include define A0 first, and the other re-defines it to something else.
IcePicI would make a search-n-replace of A0 to something else, then pull back Arduino.h in again
szwetslootOkay, I'll do that
szwetslootI suppose SDA and SCL have the same issues?
IcePicprobably, but I am not sure.
IcePicthe very common names are.. very commoon. ;)
szwetslootOkay, I fixed all of them, but still same issue with Serial
szwetslootHeh yeah :p
szwetslootBut so, that didn't change anything for the error, still Serial not recognized
deskwizardo/
szwetslootIt is weird because this exact code worked perfectly before I reinstalled my PC
IcePicI am on a ferry out at sea with really poor connection, so my googling fu is weak now.
IcePicdeskwizard: is there a Serial.h that needs to be included for normal serial.begin(9600) or should it just come with Arduino.h ?
szwetslootextra info: I am using the board definition from Waterott to programm the atmega328pb
szwetsloothttps://github.com/watterott/ATmega328PB-Testing
szwetslootThatone
szwetslootWprogramm.h is outdated right?
szwetslootWprogram.h*
IcePicyes, that was for arduino IDE <1.x I think
szwetslootOkay
IcePicthe PB seems to have two serials (the PDF says it has one extra)
IcePicso perhaps they are named Serial1 and Serial2 instead?
szwetslootThis is the entire Verbose compilation code, don't know if that helps: https://pastebin.com/qTvV9xYe
IcePic2.4. USART
IcePicATmega328PB has one additional USART with start-of-frame detection, which can wake up the MCU
szwetslootYeah, I though so as well, but those arn't recognized either
IcePicfrom all sleep modes
IcePicperhaps you need to look at the board definitions you got, for hints
szwetslootWould that be the boards.txt file in the avr folder?
IcePicit would be something from "I am using the board definition from Waterott"
szwetslootThat pretty much included me following instructions from here: https://github.com/watterott/ATmega328PB-Testing
szwetslootAnd no-one there seems to have had similar issues
szwetslootAnd.... I bricked my device -_-
szwetslootavrdude.exe: Device signature = 0x00ffff avrdude.exe: Expected signature for ATmega328PB is 1E 95 16
szwetslootdeskwizard: Do you know what this could be?
deskwizardszwetsloot: no clue whatsoever
deskwizardbad wiring, dead chip
deskwizardmake sure there the defs in Serial.h are set properly, I'm sure there's guards by MCU type, you might need to add the PB there
deskwizardbesides that, I'm half way through my first coffee so that's pretty much all I've got atm
deskwizardnice lower VIl there, good to know
szwetslootOkay, I'll try some there
szwetslootWhat is VIl?
deskwizardVoltage input low, not related to your problem, just thought it was cool
raphalol i'm like trying one '85 after the other, but only 1 rly wants to work. after a while, realize it's the only one set to 16MHz.
deskwizardanyhoo, bbiab, got to think about plan B and C since the LM48100Q totally fucked plan A.
raphahi and bye deskwizard
szwetslootBye deskwizard
szwetslootDoes anyone know where Serial is defined? The arduino folder doens't contain it
szwetslootHardwareSerial.h?
deskwizardsounds about right
raphakaoshavoc: so i clicked the autoroute button in EasyEDA just for the heck of it and to see what will happen. it's been at it for 20+ minutes now :-P
pwillardno surprise
raphappl were talking about it yesterday, how bad it was, made me curious
pwillardMost autorouters are either slow, silly, or only do 90% then give up
pwillardI find routing traces to be therapeutic and relaxing... like solving a big puzzle.
raphahhhh "router is time-out", it says
raphai can see that pwillard ... the therapeutic/relaxing thing that is
raphaEasyEDA is nice enough i think i'll actually try to make a PCB in that
TheHexaCubehey folks o/
rapha\o
deskwizardo/
deskwizardwell, there goes plan B and C, sadly I don't have a plan D ...
deskwizardACTION is fawked
jmasseohow costly is full board assembly usually?
jmasseodepends on the complexity?
jmasseowhy does 1 wire recommend against star topologies? capacitance?
deskwizardjmasseo: yes depends on complexity, smt is usually cheaper than tht
jmasseoi assume anything i had outsourced would be SMT by default
drzacekHello
deskwizardo/
Yotsono/
karlmag*looking around*
carl0s-does anyone use PlatformIO ? All of a sudden (may be to do with Windows update to latest win 10 creators edition 1709), the intellisense thing in vscode is not recognising uint8_t
Yotsonhttps://imgur.com/a/Ky4ov Nothing new, same old stuff. :)
YotsonHi there karlmag.
carl0s-it says "identifier "uint8_t" is undefined". The code compiles just fine mind you.
karlmagYotson: hello
yyyhi
timemagecarl0s-, include <stdint.h> (or maybe <cstdint> if you have that) and see what if anything changes.
carl0s-timemage, I have tried both of those actually alreayd. i'll try again mind you. neither resulted in errors (e.g. could not find that header file), but they didn't change the issue.
timemagecarl0s-, you recompiled after including them, yeah?
carl0s-oh hang on
carl0s-one of those has fixed it this time. maybe I mistyped last time.. I've put both in, and it's happy. will see which one sort it ;)
timemagecarl0s-, i don't know exactly what intellisense is doing, particularly when it comes to gcc. i would think that to implement something like intellisense in an ide with gcc you would need to ask gcc for diagnostic output (or use plugin that does that) which is something gcc supports.
carl0s-oh, no, it's put the red squiggly lines back again.
timemagecarl0s-, in other words the ide is probably not parsing the source. and the plugin for vs.net probably isn't parsing it either. if they wanted to do something crude they could, or try to use ctags/cscope on it. or better again, ask gcc for the information.
carl0s-I think all it does is look through all the includes, and I think it links to gcc as well because it does come back with compiler-output like errors too sometimes. but for some reason it's just stopped liking uint8_t in the ide, yet compiles fne.
timemagecarl0s-, dunno. (u)intN_t are c99 and c++11 onward. maybe the ide needs those selected.
carl0s-I did just buy a book by the way, but I haven't started it yet, and.. I now realise that Arduino is only a small subset of c++..
timemagecarl0s-, it's possible that it won't recognise intN under -std= options wher ethe compiler itself would support it.
carl0s-timemage, weird thing is, the autocomplete suggests it as an option when I start typing uin....
carl0s-says it's from stdint.h
timemagecarl0s-, hmm. it's not that bad. there's no template library. but that's normal for small mcu embedded work. there's no exception support by default but you could complete it if you really wanted, but then a lot of people avoid exceptions altogether in embedded work.
carl0s-timemage, https://pasteboard.co/GWnb3U6.png
timemagecarl0s-, no rtti i expect. again for similar reasons. the compiler is surprisingly complete otherwise.
timemagecarl0s-, uhh loading.
carl0s-timemage, I was going to learn about vectors... and then.. :) althogh somebody has written a C++ library for Arduino that adds all that std:: and cin cout business that I've yet to learn about
timemagecarl0s-, a lot of it is available in the esp8266 core, i think.
carl0s-timemage, you see the image there with the red underlining because it's not happy, yet at the same time it's suggesting it as a type from stdint.h ?
timemagecarl0s-, for avr very little of it makes sense except some really elementary stuff. std::array. std::swap, std::function might be nice. most of the containers have no place on an avr.
timemagecarl0s-, yeah, when it eventually loaded.
carl0s-timemage, i've not played with esp stuff, although have an AI Thinker board in my car somethwere. I'm sticking with the well supported adafruit feather for now.
carl0s-timemage, ahh :)
timemagecarl0s-, is there a tooltip when you point at the underlined keyword?
carl0s-yeah..
carl0s-give that message I quoted earlier..
carl0s-"identifier "uint8_t" is undefined".
timemagecarl0s-, okay.
carl0s-with the suggestion that I amend my includePath. but as far as I cna see that's all OK
timemagecarl0s-, i don't have that problem in vim =P
carl0s-:D
carl0s-i'll get good with vim one day. I do use it all the time but I doin't do anything clever with it.
timemagecarl0s-, i don't really expect to sell you on the idea.
carl0s-it's ok.. I subscribed to laracasts a while ago and he has good tutorials on vim
carl0s-i literally know the cursor keys, delete n lines, quit, write & quit, search, next search result, top, bottom...
carl0s-:D
carl0s-oh and quite without writing ;)
timemagecarl0s-, you can get by with surprisingly little of the full set of commands. particularly when you get used to recording and playing macros.
carl0s-*quit
carl0s-maybe that should be the next vim thing I learn then :)
timemagecarl0s-, not a lot to the basic thing. q<letter> <type stuff> q play back with @<letter>
carl0s-ah right ! i'll try that then!
timemagecarl0s-, so you can go to qa, begining of line. change case of three character. move forward two words, delete forward to open parentheseis. enter to new line. q (end macro). and then just do like 800@a
tcurdtanyone know of a cheap rs232 to usb adapter - similar to the ftdi uart to usb adapters you get everywhere? I need the full rs232 levels.
carl0s-ok i'm going to try to fix this PlatformIO / VSCode thing now. I sispect it's something speficic to this project.. maybe due to me renaming the directory it's in..
carl0s-tcurdt, yeah
carl0s-tcurdt, kind of.
carl0s-tcurdt, get the usb to ttl, and then get a ttl to rs232 max3232
carl0s-I am using the ttl to rs232 here for something and it works fine. 3.3 - 5v no probs. People say they are fake Max3232, but it seems to work just fine
carl0s-timemage, hmmm that sounds pretty powerful. does the 800@a mean ' run macro a 800 times' ?
timemagecarl0s-, yup. or because of the way the macro is constructed, 800 lines.
tcurdtcarl0s- do you remember where you bought it? or what you search for? max3232 rs232 adapter?
carl0s-tcurdt, ebay.. i'll find you a link. Sparkfun do one which is quite a bit more exprensive. I have one of those too but haven't used it yet as the cheaper ones came first.
carl0s-tcurdt, what country are you in?
carl0s-tcurdt, it's this module : https://www.ebay.co.uk/itm/Mini-RS232-To-TTL-MAX3232-Converter-Adaptor-Module-Serial-Port-Board-BY/112226347017?epid=28009794312&hash=item1a21362809:g:D~MAAOSwH2VaDpmx
tcurdtcarl0s- Germany ... something like this? https://de.aliexpress.com/item/For-Arduino-MCU-Mini-RS232-to-TTL-converter-Adapter-Board-Module-MAX3232-3-5-V-electronic/32802361687.html?spm=a2g0x.search0104.3.2.sNlr03&ws_ab_test=searchweb0_0,searchweb201602_2_10320_10152_10321_10065_5000015_10151_10344_10068_10345_10342_10547_10343_10322_10340_10341_10548_10193_10194_5130015_10541_10084_10083_10304_10307_10302_10539_10180_5080015_10312_10059_10313_10314_10184_1053
tcurdt4_100031_10319_10604_10603_10103_10605_10186_5060015_10596_10142_10107,searchweb201603_25,ppcSwitch_5&algo_expid=78f9bf08-609e-4351-a518-f6a44dee6815-0&algo_pvid=78f9bf08-609e-4351-a518-f6a44dee6815&rmStoreLevelAB=5
timemageheh
carl0s-tcurdt, yes exactly that one
tcurdtcarl0s- awesome! thanks!
carl0s-I have shrink-wrapped the wiring now, but it's easy to follow.
carl0s-no probs :)
carl0s-tcurdt, sometimes the module gets warm and doesn't work. have to disconnect the power and reconnect then it's fine. If it is warm at all then something has gone wrong and it wont work.. I think this might be due to my 3.3v supply from the Adafruit feather.. instead of a separate regulator. but just a warning for you when you try to get it going.
carl0s-it's hardly happened at all lately though, but did a few times when I was first trying to get my project talking to it
tcurdtcarl0s- actually - I am wondering why the two +/- ?
carl0s-tcurdt, not sure, but I only have power from my TTL side connected to it (3.3v), and ground from both sides of course, then rs232 in and ttl out (i am using it as one way only.. to receive a continous rs232 stream from a device)
tcurdtI basically need to shift my 0/+3.3V or 0/+5V to -3.3V/+3.3V or -5V/+5V.
tcurdtah ... ok
tcurdtI just order one and try :)
carl0s-tcurdt, http://www.ti.com/lit/ds/symlink/max3232.pdf
carl0s-yep
carl0s-i went for the book C++ Primer.. anyone heard of it?
jmasseowhat is the best way to interface standed wire to a breadboard?
baldengineerwhat do you mean by "standard wire"
jmasseostranded
jmasseoeven
timemagestr... nevermnid.
baldengineertwist it tightly and tin it with solder
jmasseoroger.
jmasseothank you.
jmasseoso cutting up jumpers and soldiering it to them is probably not required?
jmasseoesp if it's thin enough?
jmasseoi got these waterproofprobes that are on pigtails already and it's like 26/28 ga or something
jmasseoi think if i tin it'll just fit in though
baldengineerit's whatever you have to do to make it work
jmasseoright.
carl0s-jmasseo, what I have been doing it cutting jump leads and soldering (and heat shrinking) my normal wires to them. The jump leads are made of absolutely horrible terrible wire though which barely solders.. but the heatshrink keep it all together.
carl0s-i'm sure better quality wires are available but how do you know until you cut them apart and try to solder
jmasseoyeah i was expecting it to be about cheap earbud grade wire
jmasseothe pigtail is a little better than cheap earbud wire
jmasseolike i think if i tin it, it'll be mechanically sound enough for prototyping.
IcePicrj45 eth cables usually have rather good cable if you split them apart
baldengineerwhen dealing with really thin wires, i'll fish it through some perfboard and solder to that. then hot glue where I fished the insulated wire to give it strain relief
jmasseoi was also comtemplating crimping an rj45 end onto the pigtail
YotsonVery cheap wire can very well be aluminium/aluminum which doesn't solder nicely.
carl0s-the heatshrink gives good strain relief
jmasseoi got some cat5 and some cat6
jmasseoi may have some telephone wire
carl0s-yeah I thought it coul dbe copper clad alumin(i)um
carl0s-I bought loads of 'project wire' off ebay which is great quality.. it's just the breadboard jumper wires that are terrible, but I am using them for their ends.
carl0s-things are about to get super cool
carl0s-..if I can find a switch and a pot
carl0s-does no one make a 'switches and pots' breakout board for debugging timing stuff? so I don't have to keep recompiling every time I change a timer variabe?
klinepots only have three pins, usually with coarse pitch
klinewhy would you need a breakout board?
carl0s-kline, just be nice to have a board with ~ 3 pots and 3 switches on it ready for debug hookup.
carl0s-i have a couple of tiny trimmer pots here.. that's all i can find, so i'll see if they fit my breadboard
pwillardone was made eons ago by AP Circuits... failed miserably
klinecarl0s-, this used to exist but its not good business because its so simple: https://www.sparkfun.com/products/retired/9597
carl0s-that's pretty cool.
carl0s-i suppose I had something a little smaller in mind with rotary pots and a pin header at the top to attach jump leads to
carl0s-tbh it's no big deal i'm going to plug jumper wires into each other as the 'switch' (serial debug mode on/off), and i'm about to try one of these tiny trimmer pots for timing experiments
carl0s-hmm. ok so that works, but when i turn the pot all the way up, the board dies. obviosly I am shorting vcc + gnd. What are you supposed to do? put a fixed 1/4w resistor in line?
carl0s-err actually no im not am I.
pwillardwired very wrong if that happens
tonton81hi all
tonton81:)
carl0s-hi
carl0s-another oddity.
carl0s-I have pinMode(16, INPUT_PULLDOWN); in setup. I also have int debug = 0; globally, then I have within my main loop: debug = digitalRead(16). Right after that I have : if(debug){Serial.print(".");).. and that bit works. but I have the same if(debug) {} in a function which is called from the main loop, but that is enumerating debug to 1 even when it's disconnected.
carl0s-so basically lines 59 onwards here, are printing the debug stuff, even when I have my switch off (not connected to +v) https://pastebin.com/WBK0c1Zb
YotsonINPUT_PULLDOWN Compiling with this didn't produce errors?
carl0s-no
carl0s-apparently it's correct for ATSAMD
carl0s-https://learn.adafruit.com/adafruit-feather-m0-basic-proto/adapting-sketches-to-m0
YotsonAh ok. I was assuming AVR based hardware.
carl0s-and anyway, it's working for the main loop.. is it valid to just say if(variable) instead of if(variable == 1) ?
carl0s-or rather, if(int)
IcePicif(int) means if(int-is-not-zero)
IcePicso it could be -1, 2 or 434
carl0s-yeah that's what I thought.
deskwizardo/
carl0s-sure.. but with digitalRead it's only 0 or 1, I presume
carl0s-which is why i'm using it with INPUT_PULLDOWN, and connecting to +3v for my "debug on" switch
IcePicI think it is safe to assume HIGH being 1, LOW is 0 at least, but who knows, perhaps it could change later.
IcePicGuess tons of things would break
carl0s-hmm. it says it returns "HIGH" or "LOW". and it says they are constants but doesn't say if they are synonyms for 1 and 0
carl0s-my IDE says HIGh = 0x01
IcePicI think the general idea is that if you would ever .. "care" about the math or value of HIGH, you would use the constant, and never assume the value
carl0s-yeah
carl0s-makes for clean code if I can just write debug = digitalRead(16); and then if(debug) {};
carl0s-althogh it ain't working outside of the main loop :D
sibiriause defines and ifdefs instead
carl0s-how do you mean? I want to turn debug on/off while the stream of data is flying up my serial console.
carl0s-and while I turn the pot which varies the inter-request-delay
sibiriaaha, i thought you wanted it for debug vs production build
carl0s-no just experimenting without having to recompile every time
carl0s-I think for some reason it looks like I will have to re-request the digitalRead() at the beginning of the function that's called, which seems a bit weird to have to do. I set debug = 0 at program initialization, but some functions are seeing it as = 1
carl0s-ooh wait
carl0s-line 278
carl0s-bit of code left from when I had the switch working the other way and was using INPUT_PULLUP
carl0s- if (digitalRead(16) == 0) { debug = 1; }
carl0s-that's what I didn't lke, which is why I changed to pull_down so that I have my cleaner "debug = digitalRead(16)" code.
carl0s-I guess that's my bug right there :D
carl0s-beauty :P
lembronuhm, is that just me or is "adding a programmer" kinda on an impossible scale? - basically i just want to push it to an scp server... but any flaking around in tools,platforms, and that builders.txt only giives me NullExceptioins in the end :P
lembronor am i just better of to write a little shellscript, keep that running in the background, and just use the "export binary" function ((and let my script pickup that binary and ship it to my OTA server)
Bilzhi all. so I need to slide this slider up and down to turn my light on and off: https://imgur.com/wFgOwg4
Bilzi think i'd like to do it with an arduino or esp and a motor. any suggestions on type of motor / how I might do it?
carl0s-what's an efficient way of saying "trim any number so that it's not bigger than 63", without doing messy if statements. It's one of those bitwise operators isn't it. So i want to say number can stay as it is, as long as it's less than 63. any longer than 63 should be changed to 63.
carl0s-or should I just use if (x > 63) {x = 63} ? I suppose it's not that messy
carl0s-It just seems messy with so many nested ifs
carl0s-omg. this is awesome
carl0s-my kwp code now does partial receives once it reads the packet size from the first byte, if the size is over a particular constant. it returns to the main loop allowing the serial input buffer to fill, up to the 64 byte maximum. omg. so cool.
timemageACTION puts carl0s- in a machine so he can harvest that energy and sell it back to the grid.
carl0s-lol :D
carl0s-it works great! I had an issue in that a request for small data (6 bytes plus headers & chksum) took ~50ms to receive and process, but the large request payload (64 bytes), took ~90 - 100 ms. but if i did my "getResponse" 50ms after the requests, then that was perfect for the small request, but not good for the big one. Now it's perfect
carl0s-the time 'wasted' getting the big packet is now 50ms instead of ~100ms thanks to the buffer :)
carl0s-actually it's better than that. it takes 1ms of blocking program time instead of 50ms of blocking program time to read the big packet.