![]() |
Forum Index : Microcontroller and PC projects : MicroMite to MicroMite IR communication
![]() ![]() |
|||||
Author | Message | ||||
panky![]() Guru ![]() Joined: 02/10/2012 Location: AustraliaPosts: 1114 |
@Geoff Fix works fine, thanks. Out of curiosity, can you indicate where the issue was? I had a look at the source but my very rudimentary knowledge of C was not enough to see the problem. Cheers, Doug. ... for matherp - problem also exists on the MZ 144 board running 5.03.04 ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
geoff: is there any chance you could also roll in the fix for the cut-and-paste bug in the editor? i've tested the fix fairly well, and it does work. in the file editor.c, edit the line: for(p = txtp; p <= mark; p++) if(*p == '\n') nbrlines--; to instead read: for(p = txtp; p < mark; p++) if(*p == '\n') nbrlines--; ie, replace "<=" with "<" in order to not decrement nbrlines in response to a CR character sitting right after (but still outside of) the block of marked text. cheers, rob :-) |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
Thanks Doug, The second line below (uSec(600);) was missing. It was in all versions up to 5.0 but then went AWOL! How come? I don't know. for(i = 0; i < 12; i++) { uSec(600); if(cmd & 1) IRSendSignal(pin, 92); else IRSendSignal(pin, 46); cmd >>= 1; } Geoff Geoff Graham - http://geoffg.net |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
Hi Rob, that release was just intended to test the fix for the IR bug and I have plenty of other improvements to go before the next release - but your bug fix is so simple that I have recomplied the source with your fix (now ver 5.3.4) and attached it below. 2017-04-21_174354_Micromite-V5.3.4.zip Hopefully that has fixed it. Geoff Geoff Graham - http://geoffg.net |
||||
jovian Regular Member ![]() Joined: 16/04/2017 Location: AustraliaPosts: 63 |
![]() ![]() Received the PicKit yesterday and have managed to upgrade the firmware no problem - IR SEND is working brilliantly, first time. Thanks for the incredible response Geoff and all for investigating. I'm getting such a hit off of this! I'll post a link to the end result when it's time, I intend to make it flash! Cheers all Joe ![]() |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
I've been considering using Infrared instead of HC-12 as a MM to MM link I've been reading the manual and while it's probably dead simple for those that understand it, to me it doesn't make sense Could anyone explain it in a simple way? I won't be using any device code? but another MM so I don't know the key code I'll be using this on a Pi-Cromite as the TX and Armmite as the RX IF I've understood properly then this "may" work pin 20 is the MM pin system "wget -q -O- "+p$+"https://api.darksky.net/forecast/458113cd1162af4b1f0677d08822fbaf/53.440120,-2.106181?units=uk2&exclude=flags,alerts,minutely"+p$,a() prob$=JSON$(a(),"currently.precipProbability")'Chance of Rain/Snow vis$=JSON$(a(),"currently.visibility")'visibility cloud$=JSON$(a(),"currently.cloudCover")'Cloud Cover IR SEND 20,vis$,cloud$,prob$ : PAUSE 26 : IR SEND 20,vis$,cloud$,prob$ :IR SEND 20,vis$,cloud$,prob$ I can't believe it's this simple and it maybe that you can only send numbers? But I saw earlier that you can do MM to MM communication Is there a way to do this so it will work? |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
The SONY codes can be any number from 0 to 127 so you can send text as individual characters. The system doesn't care of you are turning on your TV or feeding the cat. It's just a number to the firmware. You have to send the characters one at a time where 'key' is asc(char) It will be slow. Jim VK7JH MMedit |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
Ah, that means you can't send a decimal point... so that means you cannot use it as a serial transmiter/receiver because you can only send numbers and not letters? Edited 2020-11-15 19:46 by lew247 |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
You can send ANY of the 128 characters including letters, numbers, punctuation etc. It will be very slow. To send a character, you give it's ascii code. Jim VK7JH MMedit |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
IF I've got you right I have to convert vis$, cloud$ and prob$ to their ascii codes then send them in one go? If I IR SEND 20,vis$,cloud$,prob$ : PAUSE 26 : IR SEND 20,vis$,cloud$,prob$ :IR SEND 20,vis$,cloud$,prob$ with vis$ being 10.7 which would be 49484655 and cloud$ being 203 which would be 504851 and prob$ being 70% which would be 554837 so in effect it would be I could send IR SEND 20,49484655,504851,554837 : PAUSE 26 : IR SEND 20,49484655,504851,554837 : IR SEND 20,49484655,504851,554837 or would it be IR SEND 20,49484655504851554837 : PAUSE 26 : IR SEND 20,49484655504851554837 : IR SEND 20,49484655504851554837 |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
For n = 1 to len(vis$) ch$ = mid$(vis$,n,1) IR SEND 20, asc(ch$) next n VK7JH MMedit |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Here is a working example. You will need to change the IR sending pin number to suit your hardware. OPTION EXPLICIT OPTION DEFAULT NONE DIM INTEGER p = 15 ' IR sending pin DIM INTEGER dev = 4 ' anything will do as long as the receiver uses the same number DIM cloud$ = "203" TIMER = 0 sendIR cloud$ PRINT TIMER SUB sendIR txt$ LOCAL INTEGER n LOCAL ch$ FOR n = 1 TO LEN(txt$) ch$ = MID$(txt$,n,1) IR SEND p,dev,ASC(ch$) NEXT n END SUB It takes 58mS to send 3 characters which is about 50 characters per second. Very slow! Jim VK7JH MMedit |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
Thanks Jim. I totally understand how to send the data ![]() now to work on understanding how to reverse it and extract the data on receive |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |