learn programming??? attract new users.
Pages: 1 2
John Hogg (3893) 40 posts |
Rick i was thinking the OWW weather one which used 1-wire sensors. Yes i agree nice to see how it works technicaly but for someone learning like me to see in code how its using the uart is useful to picture how code i would write could look. As i can see it starts at 9600 and goes up looking for a readable response. I kinda got what tech doc was saying but seeing the code did help me get an idea in practise how that translates. Hopefully we can use an Rpi uart on risc OS for 1-wire devices. |
John Hogg (3893) 40 posts |
The hackaday bit shows the circuit to hook up the sensor/1-wire that links into the tutorial and source. |
David Feugey (2125) 2709 posts |
Look at this too: |
John Hogg (3893) 40 posts |
Handy info David, thanks… Always good to have alternative ways. Hope uart works as it means almost any riscos machine even very early ones may be able to hook up to one wire if you wanted. But if can’t make uart work then this looks really useful. John |
Tristan M. (2946) 1039 posts |
This thread accidentally highlighted a big problem. Difficulty obtaining information. I just learned a few things from this thread. With programming and real world interfacing there’s another information void issue. I believe Tank’s GPIO module was incorporated into the RPi version of RO eventually. How is it used??? As interesting (although irrelevent to me) a thermostat application is, I’d be tempted to just use something like an esp8266 using Arduino for it. It’s exactly what I did for the temperature / humidity sensor, heating control, and webpage based monitoring on an egg hatcher I built. The really interesting uses are where RO being the OS version of a toybox really shine. Trying to do anything unique in Linux is a very slow, difficult battle. In RO I can plunge into its guts with relative ease and do whatever I want. I see RO as a tool for learning and exploring. I also prefer the way the ideology behind the design of the UI in general IMHO What RO needs is consolidation of information. Tutorials, guides etc. Maybe some on Instructables to draw the attention of some nuts’n’bolts people. Gavin, I feel hardware and software are essentially the same thing. It’s just when it comes to the stage of realising a design, one requires physical tools and components, and the other requires the virtual equivalent. |
Clive Semmens (2335) 3276 posts |
Some of us are old enough to have written them for the magazines… 8~) |
John Hogg (3893) 40 posts |
Typed in programs on my electron and a BBC b…. Maybe one was yours :) |
John Hogg (3893) 40 posts |
Think gpio module is great and has access to all gpio pins and stuff but don’t think it covers 1-wire though that was poss implemented in linux rather than hardware as you don’t enable a 1-wire in Rpi to make it work. These 1-wire sensors are probably useful for a huge host of diff projects as can get all sorts of sensors and because they have id’s you can hook em all on same wire so very useful. With my hope also bringing in z-wave 6ghz rf tvr’s it adds skills that can control lighting or sockets etc via similar 6ghz rf items I also want to make a light controller for my wee boy who is autistic. So a box with buttons for different effects, colours, items etc like you get in a high end sensory room. He’s 8 but autistic and non verbal so this will be able to turn on/off bubble tube, efx projectors disco lights, coloured room lighting and other stuff i haven’t decided yet. However i reckon the simplicity of hardware for the cent heat project but how clever the software can become its a great ,and very cheap, starter project for me to get my head back into programming and maybe others too and add some knowledge on using gpio, programming wimp interface and so on. Reckon all the thing’s i learn and trying to use the 6ghz rf would fit brilliantly with a later sensory light controller (maybe also incorporate music control to the interface too so he can choose if wants music and maybe a simple forward back track control). John |
John Hogg (3893) 40 posts |
Right,.my drag n drop USB dropped through door so away to have a good old look through ;) |
Tristan M. (2946) 1039 posts |
John, Those are great ideas. Regarding the sensory room, you may want to consider a configurable delay between state changes built into the program with some kind of non-intrusive feedback for when the time hasn’t elapsed. Just saying because there is a non-zero chance that something gets rapid cycled until it pops depending on the mood of the young master. More back on topic. People need guidance. Simple, well documented projects with a worthwhile outcome are the best. Just looking at the bits and pieces I have around me of cheaply acquired electronic modules, it’d probably only cost people the price of a coffee to do some satisfying programming and hardware projects. |
John Hogg (3893) 40 posts |
Agreed, i mean the sensor and relay and few bits for cent heat control isn’t expensive stuff. And the programming starts basic then moves up but in this case should give knowledge for others to use 1-wire for different sensors and different projects of their own. We want new users i can’t really think of anything except these diy electronics, robotics, etc type projects that give a really compelling reason to use risc OS in the modern day. More people we attract the more likely some can program or will learn and we maybe start to build more software too and maybe even hardware ports. But we need people first and although a lot of the arguments long term users use for risc OS are very valid they aren’t gonna bring people across and actually start messing with these projects. Rpi is perfect for these projects and risc OS is a seriously relevant as a tool to fulfil the projects. Esspecially as people say for things that haven’t been done before or can’t be done off shelf cheaply. Info around gpio, accessing diff types of hardware and programming to use them (even just a very basic non smart program that shows how to get data off sensor or make something moved almost gathered into an ever building ref guide/resource so we have more and more. That becomes more than a get started tutorial and becomes the resources to build what you imagine yourself. And that i belive is something we can sell to potential users via Rpi sites and other tech sites. Showing a small collection of projects and the tools avail to learn or for experienced to build their own projects. And tbh its not an area where the os lacks i don’t think where you’ll get usual yes but ot doesn’t have this or that or …… This use and this sort of project is exactly what Rpi was designed for so let’s be the best and most sensible 1st choice OS for those projects. Surely most of the other issues and problems we have become much easier to solve if we have some numbers on board. John |
John Hogg (3893) 40 posts |
With light controller may even need to make dmx work and possibly create my own led system for bubble tube and so kn so can control colour as requested. But first things first. The easier cent heat thing. |
Tristan M. (2946) 1039 posts |
John, Linux is a nightmare these days for people that want to DIY. Or really do anything with it at all. It’s gotten so scrambled and broken! I tried out Rick’s OLED driver last week. That’s an example of something which can be expanded on. Like a tutorial using his driver. Using one of RO’s text editors is lightyears ahead of using vim like a “Raspberry Pi” Linux tutorial. Personally, I’d love to know how to use RISCLua. Some more examples of RO-centric use would be great. |
John Hogg (3893) 40 posts |
Gotta make me a portable risc OS machine too… Due to wee mans autism sitting at a desk 90% of time ain’t gonna work. And need to make it self contained so no extra box or wires to connect. Thinking a 1st gen Nexdock is gonna be the candidate with pi-zero or compute module and i/o hidden inside. If i could find a screen that would run directly and was right size I’d even attempt shoving one in a psion 7/netbook, 5 or nec900c case but doubt I’d find compatible screen that’s a good fit for case. May just end up running an emulator but tbh nexdock ain’t too expensive and should be able to make clever cables to keep it self contained and hopefully get a longer lasting more modern bit of hardware than old lapdock. And it doesn’t need me pissing about to make a battery work and charge. Defo need something for lap/livingroom for when coding gets more complicated. And laptop i have is a bit heavy/cumbersome and heavy at 19" screen |
John Hogg (3893) 40 posts |
Could probs VNC from an old CE handheld pc to start with…. Have a Sigmarion 3 is too small a screen… And a Smartbook g138 may do it but will need to replace cells. May grab a nec900c, ibm z50 or similar thing as a dumb vnc unit effectively. |
John Hogg (3893) 40 posts |
See if can procure a psion netbook or jvc mp-c33 for vnc purposes. Though not sure how to solve middle button if do that ๐๐๐ |
GavinWraith (26) 1563 posts |
RiscLua is still available from http://www.wra1th.plus.com/riscos.html A while back I got round to running my webpages through the WWW validator. Unsurprisingly most failed – they were rather ancient. I decided that the time had come for a bit of updating, not only of the pages themselves but of the Weave application that I made to produce them. I pruned away all the RiscLua material, as it seemed to me that there had been little interest for a while. I am delighted in your interest, Tristan, and I will respond to
by updating the tutorial material and putting it back on my website. I started RiscLua in 2002 (with Lua version 4, initially) and over the years it has gone through many versions. That is partly to keep up with the development of Lua itself (currently at version 5.3.4) and partly to try out new twists, not all of which were successful. The watershed was October 2015 when GCC 4.7.2 became available for RISC OS (RiscLua version 6). Up till then dynamic linking , a staple of the standard Lua approach on other platforms, was not an option for RiscLua; that meant that I had to produce a statically linked version (I used the Norcroft C compiler) for RISC OS, and that in turn meant that I was faced with making some choices about which libraries to include in RiscLua. Those choices had varied a bit from version to version, and I must confess that I should have given more thought to making it easier for users to upgrade from one version to the next. In the early days the multiplicity of RISC OS machines was much less – if RiscLua worked on my Iyonix and old RiscPC then I presumed it would work for everybody. They have long disappeared and now I use an Rpi3, but have no way of testing RiscLua on all the other machines that are around now. I have have to hope that the line in the makefile, and the expertise of the maintainers of GCC for RISC OS, will be sufficient to ensure that RiscLua works for everybody.
A big problem with the multiplicity of ARM CPUs now being used for RISC OS is what to do about arithmetic? The standard Lua distribution has doubles as the default number type. RISC OS requires 32-bit integers. So early versions of RiscLua simply used integers as the default and various strategies were tried for providing users with floating point numbers, or fixed point numbers or big integers, all somewhat clumsily. It did not matter too much as ARM chips in those days did not provide floating point in hardware anyway. But now they do and it would be a shame if RiscLua did not take advantage of this. But that means giving up the Norcroft compiler, and the convenience of the shared C library module – at least until such time as they can accomodate floating point in hardware, say vfp. Perhaps it is time to give up the one version fits all approach, and instead produce different versions of RiscLua, each tailored to a particular CPU? There seem to be some users of RiscLua who have not been able to get RiscLua 6 working. Whether this is because of the extra complication of installing stuff in SharedLibs that is required by applications compiled with GCC, or something more fundamental I have not been able to test. The syntax of RiscLua 6 has not changed from RiscLua 5 (apart from needing to use the word require to load in libraries that were previously built in), so those people may have to revert to RiscLua 5 until the problem is sorted. |
Steve Pampling (1551) 8170 posts |
Utility to map the menu key to output the equivalent mouse button key value through? |
Tristan M. (2946) 1039 posts |
Gavin, John, you’d be surprised exactly how much we have in common. Steve, perhaps a small window or hmm… two Icon Bar icons that allow the user to choose between left and right buttion functionality and just have middle as a long press. That’d require a bit of code though. This is also where my pet peeve (not an actual issue) comes in with mouse and by extension keyboard handling. I would love an SWI entry or two that just lets me inject a keyboard scancode and / or a character into the buffers without resorting to the full driver thing. |
David Pitt (3386) 1248 posts |
SharedLibs as provided with the Lua download looks to be insufficient. Try this copy, http://www.riscos.info/index.php/GCC scrolling down to Shared libraries. RiscLua6 is fine here on the Titanium and VRPC. HTH. |
GavinWraith (26) 1563 posts |
I have put a link on the RISC OS part of my website to the pages on how to compile RiscLua for yourself. They should now validate properly. Over the years I seem to have churned out a lot of tutorial material. I must soon bite the bullet and distill them to something coherent to put on my website. My impression was that most of LuaRocks was tied very specifically to Unix. It was a great pleasure to find that Raspbian already contained various versions of Lua and also LuaJIT. Now that is something I would like to see ported to RISC OS. However, building LuaJIT seems to involve a rather complex series of bootstraps. |
Tristan M. (2946) 1039 posts |
I tried the NEON version on my Pi3. Didn’t try anything NEON specific but it seems to work fine. Trying to run it on the Pi Zero just made it crash, as expected. I played around a little with manually installing the files. Got as far as it tellimg me RiscLua doesn’t support io.popen, and got stuck there. |
GavinWraith (26) 1563 posts |
@Tristan M. Thanks very much for the feedback.
There is a footnote on page 65 of Programming in Lua (Fourth Edition) about io.popen:
Alas, RISC OS is not a major operating system :). There is a link on my website now to some notes about RiscLua. They will doubtless grow as the spirit takes me; though they do not as yet cover anything that is not standard computer science or to be found in Programming in Lua. If there is anything you feel would be particularly useful let me know. |
Pages: 1 2