Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : MMBasic Programming Challenge 2022

   Page 3 of 7    
Posted: 02:26pm
01 Jun 2022
Copy link to clipboard
LeoNicolas
Guru


I'm near to complete my code, but I will not be able to do it on time.
 
Posted: 05:16pm
01 Jun 2022
Copy link to clipboard
Volhout
Guru

A video of the SSTV program in operation.

First you see the waterfall screen showing what frequencies are in the audio signal. Clearly are the sync signals in every video line (between the vertical bars).

Then you see some pictures in dithered mode (white) in 360x360 upscaling from 120x120.

Finally a 4 level green-scale pictures.

SSTV demo

Sorry for the picture shaking, I did not have a stand for the camera and was controlling the keyboard at the same time. Must be age...or parkinson-light.

Thanks for watching...
 
Posted: 05:53pm
01 Jun 2022
Copy link to clipboard
Mixtel90
Guru


Wow.... impressive. :)

Now you just need people that know what SSTV is. It always intrigued me (I'm a non-operating-nowadays radio amateur so I came across it a long time ago).
 
Posted: 07:22pm
01 Jun 2022
Copy link to clipboard
Amnesie
Guru

Volhout,

this is really cool! More background information would be great! Do you have an application for the SSTV? How do you feed in the audio signal (from what device etc.)

Greetings
Daniel
 
Posted: 07:28pm
01 Jun 2022
Copy link to clipboard
Volhout
Guru

Hi Daniel, Mick,

Please unzip the document I posted earlier. It contains some more information. And much more can be found on the wiki page listed in that document.

Volhout
 
Posted: 10:07pm
01 Jun 2022
Copy link to clipboard
TassyJim
Guru


  Amnesie said  Volhout,

this is really cool! More background information would be great! Do you have an application for the SSTV? How do you feed in the audio signal (from what device etc.)

Greetings
Daniel


A brief introduction for to wet the appetite.

Slow Scan TeleVision has been used by radio amateurs (hams) for many years to send images over voice radio.
It started with small greyscale using slow decay crt tubes etc and progressed to full colour thanks to the introduction of home computers. The typical size of images is 320 x 240 and each image can take up to 90 seconds to transmit. A bit like watching paint dry!
There are a lot of different image standards to cater for the different challenges of talking around the world under different propagation conditions.
It doesn't stop in the world as the international space station often has radio amateurs on board and they have a SSTV transmitter available. Somewhere in the archives, I have many images received from the space station.

The usual equipment is a PC program attached to a radio but getting it to run on a picomite without extra hardware is an achievement.

Facebook without the internet crap.

Jim
 
Posted: 09:05pm
12 Jun 2022
Copy link to clipboard
thwill
Guru


Hi folks,

Slightly under 3 weeks remaining and so far we have entries* from:

   @Ludovik
   @vegipete
   @Volhout

No pressure, but is anybody else expecting to submit an entry ?

Best wishes,

Tom

* Thanks to overly enthusiastic email filters I'm not sure any of these have successfully arrived at the competition email address, but I'll finesse that problem once the deadline has passed.
Edited 2022-06-13 07:14 by thwill
 
Posted: 04:32am
13 Jun 2022
Copy link to clipboard
LeoNicolas
Guru


I will Tom.
I'm still working on my game. Unfortunately the three last weekends were very busy for me.

What is the due date?
 
Posted: 09:42am
13 Jun 2022
Copy link to clipboard
thwill
Guru


  LeoNicolas said  I will Tom.
I'm still working on my game. Unfortunately the three last weekends were very busy for me.

What is the due date?


The date for last submissions is Friday 1st July.

Best wishes,

Tom
 
Posted: 05:42pm
13 Jun 2022
Copy link to clipboard
TimD
Newbie

Hi Tom,

I will be submitting an entry  

Although I originally thought I wouldn't need it, the extension until 1 July turned out to be very welcome due to some maddening bugs and because I'm going through quite a battle to fit it within the 5K without losing any of the functionality!

Best wishes,
Tim.
 
Posted: 05:42pm
13 Jun 2022
Copy link to clipboard
TimD
Newbie

[Deleted - not quite sure how I managed to duplicate the message!]
Edited 2022-06-14 03:43 by TimD
 
Posted: 10:45pm
13 Jun 2022
Copy link to clipboard
Mindwarp
Newbie


Does anyone have a link to a guide on how to 'shrink' a program? Do you just string all the statements together with a : ?
 
Posted: 05:30am
14 Jun 2022
Copy link to clipboard
Volhout
Guru

For this contest that does not help much. Your best bet would be to use brief variable names.

I.e. ThisIsMyCounter becomes I

Then look at code that appears multiple times. Put that in a subroutine.

And, you can replace IF statements with inline conditional checks.

If a=3 then
c=15
Else
C=0
End if

Can be written as

C=(a=3)*15


And finally: remove comments, or compact them. Not a cooment every line but a comprehensive text for each block of code.
Edited 2022-06-14 15:45 by Volhout
 
Posted: 10:49pm
14 Jun 2022
Copy link to clipboard
Mindwarp
Newbie


Awesome, thanks for the tips Volhout!
 
Posted: 05:29am
26 Jun 2022
Copy link to clipboard
Mindwarp
Newbie


I have a program ready but it's on mmbasic 5.06. Once I update the firmware to 5.07 and test it, I'll upload it.
 
Posted: 09:32am
26 Jun 2022
Copy link to clipboard
thwill
Guru


Hi folks,

Less than a week to go.

The last day for submissions is Friday 1st July ... though you can probably sneak in under the radar before 2pm (BST) on Saturday 2nd when I will start pulling all the entries together for distribution to the judges.

Good luck,

Tom
 
Posted: 04:27am
27 Jun 2022
Copy link to clipboard
Mindwarp
Newbie


I submitted my program, it's called Groovy Trivia, it's a small trivia game that was mainly an exercise in playing with drawing commands and reading pixels to generate the play area.

cls RGB(0,0,0):colour rgb(200,200,0):font 1
?@(100,120)"Sensitivity Alert: Disable in-game flashing title? y/n"
fl=2
do while fl=2
flash=asc(ucase$(inkey$))
select case flash
case 89:fl=0
case 78:fl=1
end select
loop
cls RGB(0,0,0):colour rgb(0,32,0)
?@(50,42)"GROOVY TRIVIA":?@(250,212)"SCIENCE":?@(338,212)"MUSIC":?@(426,212)"MOVIES":?@(514,212)"GENERAL":dim cx=0:dim qt=0:dim p1=0:dim scr_sp=0:dim string cd(50,10)
screenSetup
mc(0)
ldq
dsq
title
do
k=asc(ucase$(inkey$))
select case k
case 131:d=1:mc(d)
case 130:d=2:mc(d)
case 129:d=3:mc(d)
case 128:d=4:mc(d)
case 49:d=5:ca(d)
case 50:d=6:ca(d)
case 51:d=7:ca(d)
case 52:d=8:ca(d)
end select
inkey$=""
if fl=1 then
hl=50:vl=10:for i=0 to 105:for ii=0 to 9
pix=PIXEL (50+i,42+ii)
if pix<>0 then
CIRCLE hl+(i*6.8)),vl+40+(ii*12),10,1,1,rgb(194,23,3):RBOX hl+(i*6.8)),vl+40+(ii*12),1,1,8,rgb(216,rnd*200,rnd*11),rgb(216,rnd*200,rnd*11)
end if
next ii:next i
end if
loop
sub mc(d)
hl=50:vl=185:RBOX hl+(176*cx),vl,170,32,8,rgb(0,0,0):RBOX hl+(176*cx),vl,170,32,10,rgb(0,0,0)
circle 140+(cx*142)+(qt*20),179,5,1,,rgb(black):FONT 4:COLOUR rgb(100,100,0):?@(311,405) string$(18,35)
colour rgb(black):?@(180+(cx*176),187+(qt*10)) chr$(254)
if d=1 then
cx=cx+1
if cx>3 then
cx=0
end if
else if d=2 then
cx=cx-1
if cx<0 then
cx=3
end if
else if d=3 then
qt=qt+1
if qt>1 then
qt=0
end if
else if d=4 then
qt=qt-1
if qt<0 then
qt=1
end if
end if
RBOX hl+(176*cx),vl,170,32,8,rgb(255,255,0):RBOX hl+(176*cx),vl,170,32,10,rgb(255,255,0)
dsq
end sub
sub screenSetup
RBOX 43,225,715,75,,rgb(255,0,0),rgb(0,0,0)
for bd=0 to 18 step 3
rbox 1+(bd*2),1+(bd*2),799-(bd*4),599-(bd*4),10,rgb(255,255-(bd*10),0):rbox 43+(bd*2),396+(bd*2),715-(bd*4),162-(bd*4),10,rgb(255,5,0+(bd*10))
next bd
for i=0 to 1:for ii=0 to 1:rbox 43+(i*360),305+(ii*45),355,40,10,rgb(red),rgb(0,0,0):for iii=0 to 1
box 190+(scr_sp*176),190+(iii*10),20,10,1,rgb(102,102,0):next iii:scr_sp=scr_sp+1:next ii:next i
RBOX 300,396,200,31,,rgb(255,100,0),rgb(0,0,0)
score
categories
end sub
sub score
colour rgb(0,32,0)
RBOX 375,435,340,80,5,rgb(0,0,0),rgb(0,0,0):FONT 1:?@(85,435) "SCORE "+str$(p1,5,0,"0")
hl=90:vl=442
for scri=0 to 88:for scrii=0 to 9:pix=PIXEL (85+scri,435+scrii)
if pix<>0 then
BOX hl+(scri*7),vl+(scrii*7),7,2,1,rgb(255,50+(scrii*10),0),rgb(255,50+(scrii*10),0)
end if
next scrii:next scri
end sub
sub categories
hl=55:vl=190:for i=0 to 400:for ii=0 to 9
pix=PIXEL (250+i,212+ii)
if pix<>0 then
BOX hl+(i*2),vl+(ii*2),2,1,1,rgb(255,50+(ii*10),0),rgb(255,50+(ii*10),0)
end if
next ii:next i
end sub
sub dsq
colour rgb(yellow):FONT 4:lfeed=0:RBOX 43,225,715,75,,rgb(255,0,0),rgb(0,0,0)
?@(50,317) SPACE$(34):?@(410,317) SPACE$(34):?@(50,362) SPACE$(34):?@(410,362) SPACE$(34)
for i=1 to 240 step 61
lfeed=lfeed+1:q_segment$=MID$(cd(((cx*2)+qt),1),i,61):?@(50,220+(lfeed*20)) q_segment$
next i
?@(180+(cx*176),187+(qt*10)) chr$(254):?@(50,317) "1: "+cd((cx*2)+qt,2):?@(410,317) "2: "+cd((cx*2)+qt,3)
?@(50,362) "3: "+cd((cx*2)+qt,4):?@(410,362) "4: "+cd((cx*2)+qt,5)
end sub
sub ca(d)
font 4
if cd((cx*2)+qt,7) <>"" then
COLOUR rgb(orange):?@(310,405)"Already answered!"
exit sub
end if
if cd((cx*2)+qt,6) = str$(d-4) then
cd((cx*2)+qt,7) = "1":p1=p1+100:COLOUR rgb(green):?@(360,405)"Correct!":box 191+(cx*176),191+(qt*10),18,8,1,rgb(green),rgb(green)
else
cd((cx*2)+qt,7) = "0":colour rgb(red):?@(350,405)"Incorrect!":box 191+(cx*176),191+(qt*10),18,8,1,rgb(red),rgb(red)
end if
score
qa=qa+1
if qa=8 then
COLOUR rgb(green):?@(311,405) string$(18,35):colour rgb(yellow):?@(360,405)"Final Score:"
end if
end sub
sub title
hl=50:vl=10:for i=0 to 105:for ii=0 to 9
pix=PIXEL (50+i,42+ii)
if pix<>0 then
CIRCLE hl+(i*6.8)),vl+40+(ii*12),10,1,1,rgb(194,23,3):RBOX hl+(i*6.8)),vl+40+(ii*12),1,1,8,rgb(216,rnd*200,rnd*11),rgb(216,rnd*200,rnd*11)
end if
next ii:next i
end sub
sub ldq
for ii=0 to 7:for iii=0 to 7:READ cd(ii,iii):next iii:next ii
data "1","The Apple II 8-bit home computer was released?","1971","1972","1975","1977","1",""
data "1","The Apollo 13 mission was aborted in April 1970, why?","Propulsiom system out of fuel","Crew member illness","Capsule went off course","Oxygen tank rupture","4",""
data "2","'freedom's just another word for nothin' left to...' Janis Joplin lyric","give","lose","win","chose","2",""
data "2","Who was 'Reelin' in the Years' back in '72?","Status Quo","Steely Dan","Captain and Tennille","Dr Hook","2",""
data "3","In what year was JAWS released?","1973","1975","1977","1979","2",""
data "3","Quote:'I find your lack of faith disturbing.'","The Godfather","The Sting","Star Wars","The Exorcist","3",""
data "4","Most produced car in the world in 1972?","VW Beele","Ford Pinto","Austin Mini","Honda Civic","1",""
data "4","The Sears Tower became the world's tallest building in 1974, where?","Chicago, IL","Trenton, NJ","Madison, WI","Carson City, NV","1",""
end sub

Edited 2022-06-27 14:29 by Mindwarp
 
Posted: 06:14am
27 Jun 2022
Copy link to clipboard
Turbo46
Guru


volhout, I'm sorry but my knowledge of SST is almost zero but I have a question for you:

Is it possible to demonstrate your program using an audio file recorded to an SD card so that it can be played by another 'mite and fed into the PicoMite VGA?

Bill
 
Posted: 07:26am
27 Jun 2022
Copy link to clipboard
Volhout
Guru

Hi Bill,

The SSTV program needs "logic levels" at the GP0 pin of the VGA mite.
Soup is never eaten as hot as it is served, so some deviation from these logic levels will also work.

Below is the MP3 that contains the audio part of the Youtube/Wiki page that I refered to in the documentation. Unzip it and you have an MP3 that will play on a PC ... and on a CMM2.

classic-slow-scan-television-sstv-demonstration.zip

If you would use a CMM2 (it has audio DAC's (not PWM's !!) and set the play volume as high as possible, and also directly connect the DAC pin to GP0 (no attenuator) you may get close to logic levels. Maybe that works. I cannot try .. my CMM2 is awaiting a new H743.

Adding a hifi amplifier will just overdrive the GP0 pin on the picomite. It may only destroy the chip. And if you add protection diodes and a resistor and a capacitor...you might as well build the input circuit I proposed.

Fact is that the VGA picomite does not have any analog input. It has ADC's, but these are also "floating pins, ready to be used". You also need to build a circuit to pass analog audio to the ADC's, if only bias resitors and protection.

I have a similar problem with the VGApicoGAME. I (almost) have a game ready that can be entered in the contest (*) as an alternative, but it requires 2x NES controllers to play. And that hardware is not in (all) judges hands (and the VGApicoGAME may also not be).

Volhout

(*) I invited my eldest 2 grandchildren to come an playtest the game today, but yesterday I had a positive diagnosis on the Corona. So I am in isolation now, with only myself to play with. Not funny for a 2 player game development (actually don't feel that good either, so I am off to bed with fever now, coughing and sneezing...).
Edited 2022-06-27 17:29 by Volhout
 
Posted: 09:15am
28 Jun 2022
Copy link to clipboard
thwill
Guru


Thank you @Mindwarp, I confirm that your entry has been received; and Outlook won't let me open it . I will pull the code from your TBS post, or setup a WeTransfer once the submission window closes.

Best wishes,

Tom
 
   Page 3 of 7    
© JAQ Software 2024