boat engine and hornanything is possible
what sound do you want..??
There are loads of boat engines and horns...... post some code so we can see how far you have got or a recording of a sound you want.
Looks good.... I must spend a bit of time reading through it.....Here's my thingy
Don't work.Here's my thingy that makes noises without a whotsit ... https://picaxeforum.co.uk/threads/a-method-to-make-complex-sounds-with-just-an-08m2.23176/
This was over 10 years ago, where has that time gone ?
' AV-Fan.bas
' control A/V cabinet cooling fan based on temperature reported by DS18B20
'
' Adapted from DS18B20_08M_3.Bas - PICAXE-08M
'
' Illustrates an interface with the DS18B20 in monitoring temperature. An alarm
' is associated with the temperature.
'
' If the temperature measured on the DS18B20 associated with IN1 is abve HighTrip, a relay
' on Out4 (term 3) is operated. It is released when the temperature falls below LowTrip
'
' Note that HighTrip and LowTrip are specified as the temperature plus 60 degrees C to avoid
' working with negative numbers.
'
' Note that a 4.7K pullup to +5 VDC is required on the DQ lead. +5 VDC is required on the
' V+ terminal of the DS18B20.
'
' 08M DS18B20
'
' IO1 (term 7) ------------------ DQ (term 2)
'
' 2N4401 ---(FAN)-- +
' |/
' OUT4 (term 3) ------- 4K7 ----->|\
' -- GRD
'
' Uses 68 of 2048 bytes (08M2) - or 65 of 256 bytes.(08M)
'
' original DS18B20 code copyright, Peter H Anderson, Baltimore, MD, Sept, '04
' AV-Fan changes copyright John E Carter 24 Sept 2006
symbol counter = b1
Symbol TempC_100 = W3
Symbol DevNum = W6
Symbol Temp_8 = B9
'need 100 as HighTrip and 98 as LowTrip for Traces 3210A solar controller external fan
Symbol HighTrip = 98 '(100.4F) ' 38 + 60 - fan on when temp hits 100F - adjust as necessary
Symbol LowTrip = 96 '(96.8F) ' 36 + 60 - fan off when 2 deg cooler
low 0 'set unused pin
high 4 'operation verification on power up (fan on)
high 2 '(status LED on)
pause 600
low 2
Low 4 ' turn off alarm
Top:
high 2 'indicate a read is in progress (power/activity light)
ReadTemp 1, Temp_8 ' read the high 8 bits - approx temp in deg C
low 2
' respond to the temperature
Temp_8 = Temp_8 + 60 ' to avoid negative numbers
If Temp_8 >= HighTrip Then OperateAlarm
if Temp_8 < LowTrip then continue
'indicate if above LowTrip but below HighTrip
for counter = 1 to 2
pause 200
high 2
pause 200
low 2
next counter
continue:
If Temp_8 < LowTrip Then ReleaseAlarm
' else
Goto SequenceDone
OperateAlarm:
High 4
Goto SequenceDone
ReleaseAlarm:
Low 4
Goto SequenceDone
SequenceDone:
Pause 1000 'was 20000
GoTo Top
The thingy does work...... DAC on Picaxe is not like DAC on any other MCU. It is basically a digital pot with 32 steps allowing volume control of the Vref voltage. The thingy sets the daclevel steps and at same time plays in pwm in C.1.....so It mixes them and outputs on the DAC pin which is also the Serial out pin....... Don't keep serial OUT plugged in at same time as it will load the DAC output and you will get very low signal out. Manual says you should buffer it, but at least put it through an amplifier....... for quick test I plugged it into linein on PC and watched it and listened to it in Audacity. Here is another wee example.....Don't work.![]()
#picaxe 08M2
pwmout pwmdiv64, 2, 200, 400
;dacsetup %10100000 ; external DAC to C.0, Vref = supply voltage
dacsetup %10100100 ; external DAC to C.0, Vref link into C.1
setfreq m32
main:
gosub stepp
gosub upp
gosub downn
goto main
upp:
for b0 = 1 to 31 step 1
daclevel b0
pause 100
next
daclevel 30
pause 2000
return
downn:
for b0 = 31 to 1 step -1
daclevel b0
pause 200
next
pause 5000
return
stepp:
for b0 = 0 to 10 step 1
daclevel 5
pause 100
daclevel 15
pause 100
daclevel 25
pause 100
daclevel 15
next
pause 1000
return
goto main